query-1720925f6717f51a2583d40504668710
Optimization?Could the following query be optimized to not time out?
Use at
- https://query.wikidata.org/sparql
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT ?item ?itemLabel (GROUP_CONCAT(?p31Label; separator="; ") as ?p31s)
WHERE {
?item wdt:P830 [] .
OPTIONAL { ?item wdt:P31 ?p31 }
MINUS { ?item wdt:P31 wd:Q16521 . }
SERVICE wikibase:label { bd:serviceParam wikibase:language "en". }
}
GROUP BY ?item ?itemLabel
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
v3("?p31")
v4("?p31Label"):::projected
v5("?p31s")
a1((" "))
c5(["bd:serviceParam"]):::iri
c7(["en"]):::literal
c3(["wd:Q16521"]):::iri
v2 --"wdt:P830"--> a1
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v2 -."wdt:P31".-> v3
end
subgraph minus0["MINUS"]
style minus0 stroke-width:6px,fill:pink,stroke:red;
v2 --"wdt:P31"--> c3
end
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c5 --"wikibase:language"--> c7
end
bind2[/"?p31Label"/]
v4 --o bind2
bind2 --as--o v5