Skip to content

Latest commit

 

History

History
75 lines (64 loc) · 2.76 KB

8.md

File metadata and controls

75 lines (64 loc) · 2.76 KB

Retrieve in-depth information about a specific product including offers and reviews

Description

The consumer has found a product which fulfills his requirements. Now he wants in-depth information about this product including offers from Chinese vendors and product reviews if existent.

The corresponding query refers to a randomly selected product and defines a current date within the "valid from" and "valid to" range of the offers.

Sample

"For the product waterskiing sharpness horseshoes list details for all its offers by Chinese vendors and still valid by 2008-05-28 plus details for all reviews for this product, including values for rating1 and rating2 if available".

Expected Outcome

Given the sample dataset bsbm-1000products, the user should get access to the details about the following offers and reviews:

"Offer10801", "Offer5335", "Offer10597", "Review5481", "Review7546", "Review2669", "Review5731", "Review8494".

SPARQL Query to Perform

SELECT ?productLabel ?offer ?price ?vendor ?vendorTitle
	?review ?revTitle ?reviewer ?revName ?rating1 ?rating2
WHERE {
   %ProductXYZ% rdfs:label ?productLabel .
   OPTIONAL {
	?offer bsbm:product %ProductXYZ% .
	?offer bsbm:price ?price .
	?offer bsbm:vendor ?vendor .
	?vendor rdfs:label ?vendorTitle .
	?vendor bsbm:country <http://downlode.org/rdf/iso-3166/countries#CN> .
	?offer dc:publisher ?vendor .
	?offer bsbm:validTo ?date .
	FILTER (?date > %currentDate% )
   }
   OPTIONAL {
	?review bsbm:reviewFor %ProductXYZ% .
	?review rev:reviewer ?reviewer .
	?reviewer foaf:name ?revName .
	?review dc:title ?revTitle .
	OPTIONAL { ?review bsbm:rating1 ?rating1 . }
	OPTIONAL { ?review bsbm:rating2 ?rating2 . }
   }
}

SPARQL Query for the Sample Query

PREFIX bsbm: <http://www4.wiwiss.fu-berlin.de/bizer/bsbm/v01/vocabulary/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX pr16: <http://www4.wiwiss.fu-berlin.de/bizer/bsbm/v01/instances/dataFromProducer16/>
SELECT ?productLabel ?offer ?price ?vendor ?vendorTitle
	?review ?revTitle ?reviewer ?revName ?rating1 ?rating2
WHERE {
   pr16:Product768 rdfs:label ?productLabel .
   OPTIONAL {
		 ?offer bsbm:product pr16:Product768 .
		 ?offer bsbm:price ?price .
		 ?offer bsbm:vendor ?vendor .
		 ?vendor rdfs:label ?vendorTitle .
		 ?vendor bsbm:country <http://downlode.org/rdf/iso-3166/countries#CN> .
		 ?offer dc:publisher ?vendor .
		 ?offer bsbm:validTo ?date .
		 FILTER (?date > "2008-05-28"^^xsd:date )
   }
   OPTIONAL {
		 ?review bsbm:reviewFor pr16:Product768 .
		 ?review rev:reviewer ?reviewer .
		 ?reviewer foaf:name ?revName .
		 ?review dc:title ?revTitle .
		 OPTIONAL { ?review bsbm:rating1 ?rating1 . }
		 OPTIONAL { ?review bsbm:rating2 ?rating2 . }
   }
}