query-d3da2e1741a134743681e090074957bf
TODO
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 ps: <http://www.wikidata.org/prop/statement/>
PREFIX pq: <http://www.wikidata.org/prop/qualifier/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT ?item ?itemLabel ?exception ?exceptionLabel
WHERE
{
?item wdt:P31 wd:Q18667213;
p:P2302 ?constraint.
FILTER(?item = wd:P301)
?constraint ps:P2302 wd:Q21502410;
pq:P2303 ?exception.
FILTER NOT EXISTS {
?exception wdt:P301 ?value.
}
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v4("?constraint")
v1("?exception"):::projected
v3("?item"):::projected
v2("?value")
c7(["wd:Q21502410"]):::iri
c4(["wd:Q18667213"]):::iri
c10(["bd:serviceParam"]):::iri
c12(["#91;AUTO_LANGUAGE#93;,en"]):::literal
f0[["not "]]
subgraph f0e0["Exists Clause"]
e0v1 --"p:direct/P301"--> e0v2
e0v1("?exception"):::projected
e0v2("?value"):::projected
end
f0--EXISTS--> f0e0
f0 --> v1
f0 --> c1
f0 --> v2
v1 --"p:direct/P301"--> v2
f1[["?item = 'wd:P301'"]]
f1 --> v3
v3 --"p:direct/P31"--> c4
v3 --"p:P2302"--> v4
v4 --"p:statement/P2302"--> c7
v4 --"p:qualifier/P2303"--> v1
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c10 --"wikibase:language"--> c12
end