The consumer has found a product that fulfills his requirements. He now wants to find products with similar features.
The corresponding query starts from a random product and looks for all other products with at least one common feature and a wider range of values for two of its numeric properties.
"Look for products similar to boozed, with at least one shared feature, and a productPropertyNumeric1 value between 427 and 627 (100 more or less than its value for boozed, 527) and a productPropertyNumeric2 value between 545 and 945 (200 more or less than its value for boozed, 745)".
Given the sample dataset bsbm-1000products, the product labels the user should obtain if restricted to the first 5 ordered alphabetically are:
"debouches orangs unethically", "dirk professionalize", "grappled", "imposed", "pepperiness gothically shiner".
SELECT DISTINCT ?product ?productLabel
WHERE {
?product rdfs:label ?productLabel .
FILTER (%ProductXYZ% != ?product)
%ProductXYZ% bsbm:productFeature ?prodFeature .
?product bsbm:productFeature ?prodFeature .
%ProductXYZ% bsbm:productPropertyNumeric1 ?origProperty1 .
?product bsbm:productPropertyNumeric1 ?simProperty1 .
FILTER (?simProperty1 < (?origProperty1 + 100) && ?simProperty1 > (?origProperty1 – 100))
%ProductXYZ% bsbm:productPropertyNumeric2 ?origProperty2 .
?product bsbm:productPropertyNumeric2 ?simProperty2 .
FILTER (?simProperty2 < (?origProperty2 + 200) && ?simProperty2 > (?origProperty2 – 200))
}
ORDER BY ?productLabel
LIMIT 5
PREFIX bsbm: <http://www4.wiwiss.fu-berlin.de/bizer/bsbm/v01/vocabulary/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX pr13: <http://www4.wiwiss.fu-berlin.de/bizer/bsbm/v01/instances/dataFromProducer13/>
SELECT DISTINCT ?productLabel
WHERE {
?product rdfs:label ?productLabel .
FILTER (pr13:Product594 != ?product)
pr13:Product594 bsbm:productFeature ?prodFeature .
?product bsbm:productFeature ?prodFeature .
pr13:Product594 bsbm:productPropertyNumeric1 ?origProperty1 .
?product bsbm:productPropertyNumeric1 ?simProperty1 .
FILTER (?simProperty1 < (?origProperty1 + 100) && ?simProperty1 > (?origProperty1 - 100))
pr13:Product594 bsbm:productPropertyNumeric2 ?origProperty2 .
?product bsbm:productPropertyNumeric2 ?simProperty2 .
FILTER (?simProperty2 < (?origProperty2 + 200) && ?simProperty2 > (?origProperty2 - 200))
}
ORDER BY ?productLabel
LIMIT 5