query-550762431e59dd29957127ae8fde8850

rq turtle/ttl

How to avoid query timeout?Hello everyone! I have a query that should check if some items is sub-classes of the base material (Q214609):

Use at

PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
SELECT DISTINCT ?item ?itemLabel
WHERE {
VALUES (?item) {(wd:Q296955) (wd:Q1348059)}
?item wdt:P279* wd:Q214609 .
?item rdfs:label ?itemLabel.
FILTER(EXISTS { FILTER((LANG(?itemLabel)) = "en")})
}
ORDER BY ?itemLabel

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v2("?item"):::projected v1("?itemLabel"):::projected c3(["wd:Q214609"]):::iri f0[[" "]] subgraph f0e0["Exists Clause"] e0f0[["?itemLabel = 'en'"]] e0f0 --> e0v1 e0v1("?itemLabel"):::projected end f0--EXISTS--> f0e0 f0 --> v1 f1[["?itemLabel = 'en'"]] f1 --> v1 bind2[/VALUES ?item/] bind2-->v2 bind20(["wd:Q296955"]) bind20 --> bind2 bind21(["wd:Q1348059"]) bind21 --> bind2 v2 --"wdt:P279"--> c3 v2 --"rdfs:label"--> v1