All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.bigdata.rdf.sparql.ast.eval.bsbm.bi.query2.rq Maven / Gradle / Ivy

There is a newer version: 2.1.4
Show newest version
# BSBM BI Q2.  Q2 needs further exploration. See my notes.
#
# Query 2: The top 10 products most similar to a specific product, rated by the count of features they have in common.
#
# Use Case Motivation:  A consumer wants to list similar products to the product they are viewing right now.
#
# Last Changed Rev: 5682
# Last Changed Date: 2011-11-17 20:09:12 -0500 (Thu, 17 Nov 2011)
#
# 1. solutions=10, chunks=1, elapsed=102699ms.
# 2. solutions=10, chunks=1, elapsed=89905ms.
# 3. solutions=10, chunks=1, elapsed=86678ms.
#
prefix bsbm: 

SELECT ?otherProduct ?sameFeatures
{
  ?otherProduct a bsbm:Product .
  FILTER(?otherProduct != )
  {
    SELECT ?otherProduct (count(?otherFeature) As ?sameFeatures)
    {
       bsbm:productFeature ?feature .
      ?otherProduct bsbm:productFeature ?otherFeature .
      FILTER(?feature=?otherFeature)
    }
    Group By ?otherProduct
  }
}
Order By desc(?sameFeatures) ?otherProduct
Limit 10




© 2015 - 2024 Weber Informatics LLC | Privacy Policy