query-b83d7311669f958e34ba29718329c6d7
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 rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT ?item ?itemLabel (GROUP_CONCAT(?p31Label; separator="; ") as ?p31s) WHERE{
{
SELECT ?item ?p31 WHERE {
?item wdt:P830 [];
wdt:P31 ?p31
FILTER ( ?p31 != wd:Q16521 )
}
}
MINUS {?item wdt:P31/wdt:P279* wd:Q16521}
SERVICE wikibase:label {
bd:serviceParam wikibase:language "en" .
?item rdfs:label ?itemLabel .
?p31 rdfs:label ?p31Label
}
} GROUP BY ?item ?itemLabel ORDER BY ?itemLabel
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v3("?item"):::projected
v1("?itemLabel"):::projected
v2("?p31")
v4("?p31Label"):::projected
v5("?p31s")
a1((" "))
a2((" "))
c6(["bd:serviceParam"]):::iri
c8(["en"]):::literal
c1(["wd:Q16521"]):::iri
f0[["?p31 != 'wd:Q16521'"]]
f0 --> v2
v3 --"wdt:P830"--> a1
v3 --"wdt:P31"--> v2
subgraph minus1["MINUS"]
style minus1 stroke-width:6px,fill:pink,stroke:red;
v3 --"wdt:P31"--> a2
a2 --"wdt:P279"--> c1
end
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c6 --"wikibase:language"--> c8
v3 --"rdfs:label"--> v1
v2 --"rdfs:label"--> v4
end
bind3[/"?p31Label"/]
v4 --o bind3
bind3 --as--o v5