The hint:Prior optimization on the property path might help a bit?
https://www.wikidata.org/wiki/Wikidata:SPARQL_query_service/query_optimizat…
https://w.wiki/4Jas
Jeff
From: Thad Guidry <thadguidry(a)gmail.com>
Date: Friday, October 29, 2021 at 10:12 AM
To: David Causse <dcausse(a)wikimedia.org>rg>, Discussion list for the Wikidata project.
<wikidata(a)lists.wikimedia.org>rg>, stevenliuyi(a)gmail.com <stevenliuyi(a)gmail.com>
Subject: [External] [Wikidata] Help make this Property Query faster
Hi David and team,
In Yi Liu's tool, Wikidata Property Explorer, I noticed that the query performance
could be better ideally. Currently the query takes about 9 seconds and I'm asking if
there might be anything to help reduce that considerably? Refactoring query for
optimization, backend changes, anything you can think of Davd?
SELECT DISTINCT ?prop ?label ?desc ?type (GROUP_CONCAT(DISTINCT ?alias; SEPARATOR = "
| ") AS ?aliases) WHERE {
?prop (wdt:P31/(wdt:P279*)) wd:Q18616576;
wikibase:propertyType ?type.
OPTIONAL {
?prop rdfs:label ?label.
FILTER((LANG(?label)) = "en")
}
OPTIONAL {
?prop schema:description ?desc.
FILTER((LANG(?desc)) = "en")
}
OPTIONAL {
?prop skos:altLabel ?alias.
FILTER((LANG(?alias)) = "en")
}
}
GROUP BY ?prop ?label ?desc ?type
Thad
https://www.linkedin.com/in/thadguidry/<https://www.linkedin.com/in/thad…
https://calendly.com/thadguidry/<https://calendly.com/thadguidry/>