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