On 10/29/21 10:11 AM, Thad Guidry wrote:
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://calendly.com/thadguidry/
Wikidata mailing list --wikidata@lists.wikimedia.org To unsubscribe send an email towikidata-leave@lists.wikimedia.org
Hi Thad,
Don't know what your expectations are, but here are results from our Wikidata instance:
* Query Solution Page with "Anytime Query" Feature Enabled https://wikidata.demo.openlinksw.com/sparql?default-graph-uri=http%3A%2F%2Fwww.wikidata.org%2F&query=SELECT+DISTINCT+%3Fprop+%3Flabel+%3Fdesc+%3Ftype+%28GROUP_CONCAT%28DISTINCT+%3Falias%3B+SEPARATOR+%3D+%22+%7C+%22%29+AS+%3Faliases%29+WHERE+%7B%0D%0A++%3Fprop+%28wdt%3AP31%2F%28wdt%3AP279*%29%29+wd%3AQ18616576%3B%0D%0A++++wikibase%3ApropertyType+%3Ftype.%0D%0A++OPTIONAL+%7B%0D%0A++++%3Fprop+rdfs%3Alabel+%3Flabel.%0D%0A++++FILTER%28%28LANG%28%3Flabel%29%29+%3D+%22en%22%29%0D%0A++%7D%0D%0A++OPTIONAL+%7B%0D%0A++++%3Fprop+schema%3Adescription+%3Fdesc.%0D%0A++++FILTER%28%28LANG%28%3Fdesc%29%29+%3D+%22en%22%29%0D%0A++%7D%0D%0A++OPTIONAL+%7B%0D%0A++++%3Fprop+skos%3AaltLabel+%3Falias.%0D%0A++++FILTER%28%28LANG%28%3Falias%29%29+%3D+%22en%22%29%0D%0A++%7D%0D%0A%7D%0D%0AGROUP+BY+%3Fprop+%3Flabel+%3Fdesc+%3Ftype%0D%0A&format=text%2Fx-html%2Btr&timeout=360000&signal_void=on&signal_unconnected=on * Query Solution Page with "Anytime Query" Feature Disabled https://wikidata.demo.openlinksw.com/sparql?default-graph-uri=http%3A%2F%2Fwww.wikidata.org%2F&query=SELECT+DISTINCT+%3Fprop+%3Flabel+%3Fdesc+%3Ftype+%28GROUP_CONCAT%28DISTINCT+%3Falias%3B+SEPARATOR+%3D+%22+%7C+%22%29+AS+%3Faliases%29+WHERE+%7B%0D%0A++%3Fprop+%28wdt%3AP31%2F%28wdt%3AP279*%29%29+wd%3AQ18616576%3B%0D%0A++++wikibase%3ApropertyType+%3Ftype.%0D%0A++OPTIONAL+%7B%0D%0A++++%3Fprop+rdfs%3Alabel+%3Flabel.%0D%0A++++FILTER%28%28LANG%28%3Flabel%29%29+%3D+%22en%22%29%0D%0A++%7D%0D%0A++OPTIONAL+%7B%0D%0A++++%3Fprop+schema%3Adescription+%3Fdesc.%0D%0A++++FILTER%28%28LANG%28%3Fdesc%29%29+%3D+%22en%22%29%0D%0A++%7D%0D%0A++OPTIONAL+%7B%0D%0A++++%3Fprop+skos%3AaltLabel+%3Falias.%0D%0A++++FILTER%28%28LANG%28%3Falias%29%29+%3D+%22en%22%29%0D%0A++%7D%0D%0A%7D%0D%0AGROUP+BY+%3Fprop+%3Flabel+%3Fdesc+%3Ftype%0D%0A&format=text%2Fx-html%2Btr&timeout=0&signal_void=on&signal_unconnected=on
Hope this helps.