Skip to content

Latest commit

 

History

History
44 lines (33 loc) · 1.43 KB

7.md

File metadata and controls

44 lines (33 loc) · 1.43 KB

Find products having a name that contains some text

Description

The consumer remembers parts of a product name from former searches. He wants to find the product again by searching for the parts of the name that he remembers.

The corresponding query is just one of the words from the list of words that were used during dataset generation by the BSBM Data Generator.

Sample

"Search products whose name contains ales".

Expected Outcome

Given the sample dataset bsbm-1000products, the product labels the user should obtain if restricted to the first 5 ordered alphabetically are:

"cogitations centralest recasting", "overapprehensively dales ventless", "skidooed finales noisemaker" and "unwed convalescents".

SPARQL Query to Perform

SELECT ?product ?label
WHERE {
	?product rdfs:label ?label .
	?product rdf:type bsbm:Product .
	FILTER regex(?label, "%word1%")
}
ORDER BY ?productLabel
LIMIT 5

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#>
SELECT ?product ?label
WHERE {
	?product rdfs:label ?label .
	?product rdf:type bsbm:Product .
	FILTER regex(?label, "ales")
}
ORDER BY ?label
LIMIT 5