You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Another technique for subverting the optimizer into delivering results is to invert the property path used in the query; possibly particularly useful when dealing with timeouts of reports having wdt:P31/wdt:P279* constructions. Consider the following examples - the first times out, the second works speedily:
# Museums in Northern Ireland - TIMES OUT
SELECT distinct ?museum ?museumLabel WHERE {
?museum wdt:P131* wd:Q26 .
?museum wdt:P31/wdt:P279* wd:Q33506 .
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
# Museums in Northern Ireland - SUCCEEDS
SELECT distinct ?museum ?museumLabel WHERE {
?museum wdt:P131* wd:Q26 .
wd:Q33506 ^wdt:P279*/^wdt:P31 ?museum .
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
It is worth a try.
The text was updated successfully, but these errors were encountered:
https://www.wikidata.org/wiki/Wikidata:SPARQL_query_service/query_optimization#Inverse_property_paths
It is worth a try.
The text was updated successfully, but these errors were encountered: