I need to select an object that has a "taxon rank (P105)" from "species (Q7432)" that have a label that matches an alphabetic string, such as Jerusalem artichoke.
I am testing queries https://query.wikidata.org ; this request goes well and returns the object to me with a satisfactory response time:
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema
SELECT * WHERE {
?entity rdfs:label "Topinambur"@de .
?entity wdt:P105 wd:Q7432.
}
LIMIT 100
The problem is that my attribute is not to specify the language , but the lexical forms of labels in the basic dataset (wikidata) have language tags , so I need a way to get Literal equality for any language .
I tried some possible solution, but I did not find any query that would not lead to the following:
TIMEOUT messagecom.bigdata.bop.engine.QueryTimeoutException: Query deadline is expired
Here is a list of what I tried (..and always get TIMEOUT):
1) based on this answer I tried:
SELECT * WHERE {
?entity rdfs:label ?label FILTER ( str( ?label ) = "Topinambur") .
?entity wdt:P105 wd:Q7432.
}
LIMIT 100
2) based on other documentation that I tried:
SELECT * WHERE {
?entity wdt:P105 wd:Q7432.
?entity rdfs:label ?label FILTER regex(?label, "^Topinambur") .
}
LIMIT 100
3) and
SELECT * WHERE {
?entity wdt:P105 wd:Q7432.
?entity rdfs:label ?label .
FILTER langMatches( lang(?label), "*" )
FILTER (?label = "Topinambur")
}
LIMIT 100
What I'm looking for is a solution for performers or some kind of SPARQL syntax that does not end with a TIMEOUT message .
PS: with reference to http://www.rfc-editor.org/rfc/bcp/bcp47.txt I do not understand if language rangesor `` wildcards '' could have been in any way.
EDIT
( ) DbPedia :
https://dbpedia.org/sparql
( IRI): http://dbpedia.org
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX dbo: <http://dbpedia.org/ontology/>
SELECT ?resource
WHERE {
?resource rdfs:label ?label . FILTER ( str( ?label ) = "Topinambur").
?resource rdf:type dbo:Species
}
LIMIT 100
, Wikidata, .