Steps to Reproduce:
I try to execute the following query on https://query.wikidata.org/ :
SELECT distinct ?id ?lang ?n WHERE { { ?id rdfs:label|skos:altLabel "Paris"@en . BIND("EN" AS ?lang) } UNION { ?id rdfs:label|skos:altLabel "Paris"@eu . BIND("EU" AS ?lang) } ?id wikibase:statements ?n . }
Actual Results:
Query timeout
Expected Results:
No timeout
Additional information:
In the following similar cases the query executes successfuly:
Removing the UNION (with the second condition):
SELECT distinct ?id ?lang ?n WHERE { { ?id rdfs:label|skos:altLabel "Paris"@en . BIND("EN" AS ?lang) } ?id wikibase:statements ?n . }
Removing the BIND statements:
SELECT distinct ?id ?n WHERE { { ?id rdfs:label|skos:altLabel "Paris"@en . } UNION { ?id rdfs:label|skos:altLabel "Paris"@eu . } ?id wikibase:statements ?n . }
Removing the "wikibase:statements" statement:
SELECT distinct ?id ?lang ?n WHERE { { ?id rdfs:label|skos:altLabel "Paris"@en . BIND("EN" AS ?lang) } UNION { ?id rdfs:label|skos:altLabel "Paris"@eu . BIND("EU" AS ?lang) } }