Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Predicate path with (^schema:about)? takes forever #333

Closed
hannahbast opened this issue Apr 27, 2020 · 1 comment
Closed

Predicate path with (^schema:about)? takes forever #333

hannahbast opened this issue Apr 27, 2020 · 1 comment
Assignees

Comments

@hannahbast
Copy link
Member

hannahbast commented Apr 27, 2020

The following query requires four minutes and a lot of memory. The runtime info shows a TRANSITIVE PATH operation costing 170 seconds, as well as a large UNION costing 60 seconds.

PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX schema: <http://schema.org/>
SELECT ?x ?sitelinks WHERE {
  ?x wdt:P31 wd:Q5107 .
  ?x (^schema:about)?/wikibase:sitelinks ?sitelinks .
}

The following query, which replaces the ? via a UNION and the / via a temporary object, both in the natural way, finishes in a reasonable 13 seconds with a cold cache:

PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX schema: <http://schema.org/>
SELECT ?x ?sitelinks WHERE {
  ?x wdt:P31 wd:Q5107 .
  { ?x wikibase:sitelinks ?sitelinks }
  UNION
  { ?x ^schema:about ?tmp . ?tmp wikibase:sitelinks ?sitelinks }
}
@joka921
Copy link
Member

joka921 commented May 10, 2024

This was resolved by our recent implementations to the Transitive Path implementation and its query planning.

@joka921 joka921 closed this as completed May 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants