The hint:Prior optimization on the property path might help a bit?

https://www.wikidata.org/wiki/Wikidata:SPARQL_query_service/query_optimization#h-Property_paths-Optimization_strategies


https://w.wiki/4Jas

Jeff

From: Thad Guidry <[email protected]>
Date: Friday, October 29, 2021 at 10:12 AM
To: David Causse <[email protected]>, Discussion list for the Wikidata 
project. <[email protected]>, [email protected] 
<[email protected]>
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/thadguidry/>
https://calendly.com/thadguidry/<https://calendly.com/thadguidry/>
_______________________________________________
Wikidata mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to