prefix bsbm:
prefix bsbm-inst:
prefix xsd:
Select ?feature (?withFeaturePrice/?withoutFeaturePrice As ?priceRatio)
{
{ Select ?feature (avg(xsd:float(xsd:string(?price))) As ?withFeaturePrice)
{
?product a %ProductType% ;
bsbm:productFeature ?feature .
?offer bsbm:product ?product ;
bsbm:price ?price .
}
Group By ?feature
}
{ Select ?feature (avg(xsd:float(xsd:string(?price))) As ?withoutFeaturePrice)
{
{ Select distinct ?feature {
?p a %ProductType% ;
bsbm:productFeature ?feature .
} }
?product a %ProductType% .
?offer bsbm:product ?product ;
bsbm:price ?price .
FILTER NOT EXISTS { ?product bsbm:productFeature ?feature }
}
Group By ?feature
}
}
Order By desc(?withFeaturePrice/?withoutFeaturePrice) ?feature
Limit 10