query-da87fde9f93d7d4009a91eb6ac2cc107
Propertiesproperty constraint (P2302)subclass of (P279)instance of (P31)class (P2308)
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/>
SELECT (URI(CONCAT(STR(?item), "#", STRAFTER(STR(?wdt), STR(wdt:)))) AS ?violation)
WHERE {
?prop wikibase:directClaim ?wdt ;
wdt:P2302 wd:Q21503250 .
?item ?wdt [] .
MINUS {
?prop p:P2302 [
ps:P2302 wd:Q21503250 ;
pq:P2308 ?declaredClass
] .
?acceptableClass wdt:P279* ?declaredClass .
?item ?wdt [];
wdt:P31 ?acceptableClass .
}
}
LIMIT 10
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v5("?acceptableClass")
v4("?declaredClass")
v3("?item"):::projected
v1("?prop")
v6("?violation")
v2("?wdt"):::projected
a1((" "))
a3((" "))
a2((" "))
c3(["wd:Q21503250"]):::iri
v1 --"wikibase:directClaim"--> v2
v1 --"p:direct/P2302"--> c3
v3 -->v2--> a1
subgraph minus0["MINUS"]
style minus0 stroke-width:6px,fill:pink,stroke:red;
a2 --"p:statement/P2302"--> c3
a2 --"p:qualifier/P2308"--> v4
v1 --"p:P2302"--> a2
v5 --"p:direct/P279"--> v4
v3 -->v2--> a3
v3 --"p:direct/P31"--> v5
end
bind1[/"concat(str(?item),'#',substring-after(str(?wdt),str('p:direct/')))"/]
v3 --o bind1
v2 --o bind1
bind1 --as--o v6