com.bigdata.rdf.sparql.ast.eval.bsbm-bi-q5.rq Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of bigdata-rdf-test Show documentation
Show all versions of bigdata-rdf-test Show documentation
Blazegraph(TM) RDF Test Suites
prefix bsbm:
prefix bsbm-inst:
prefix rev:
prefix xsd:
Select ?country ?product ?nrOfReviews ?avgPrice
{
#hint:Query hint:mergeJoin "false" .
#hint:Query hint:analytic "true" .
{ Select ?country (max(?nrOfReviews) As ?maxReviews)
{
{ Select ?country ?product (count(?review) As ?nrOfReviews)
{
?product a bsbm-inst:ProductType1 .
?review bsbm:reviewFor ?product ;
rev:reviewer ?reviewer .
?reviewer bsbm:country ?country .
}
Group By ?country ?product
}
}
Group By ?country
}
{ Select ?product (avg(xsd:float(str(?price))) As ?avgPrice)
{
?product a bsbm-inst:ProductType1 .
?offer bsbm:product ?product .
?offer bsbm:price ?price .
}
Group By ?product
}
{ Select ?country ?product (count(?review) As ?nrOfReviews)
{
?product a bsbm-inst:ProductType1 .
?review bsbm:reviewFor ?product .
?review rev:reviewer ?reviewer .
?reviewer bsbm:country ?country .
}
Group By ?country ?product
}
FILTER(?nrOfReviews=?maxReviews)
}
Order By desc(?nrOfReviews) ?country ?product
© 2015 - 2024 Weber Informatics LLC | Privacy Policy