DBpedia SPARQL Querying for a specific rdfs:label

Sam picture Sam · Jan 20, 2012 · Viewed 8.2k times · Source

Basically I have a query (shown below) which works efficiently. However, I want my search to be more precise where the label is the actual string 'yago' rather than containing the string 'yago'. I want to try to do it without filters if possible as I think using FILTER makes querying DBpedia take longer.

SELECT ?uri ?label 
WHERE {
?uri rdfs:label ?label.
?label bif:contains "'yago'" .
}

Answer

ip. picture ip. · Jan 21, 2012

You can try doing the following if you want to do it without filters:

SELECT ?uri ?label
WHERE {
?uri rdfs:label "Yago"@en .
?uri rdfs:label ?label
}

I not sure though it if it is much faster than the corresponding query with filters:

SELECT ?uri ?label
WHERE {
?uri rdfs:label ?label .
filter(?label="Yago"@en)
}