query-b2a0d542dea53a6e09cd7d54658ecac2

rq turtle/ttl

villages that should have P31 = Q3558970, but have Q532 SELECT ?item ?itemLabel ?adminLabel WHERE { ?item wdt:P31 wd:Q532 . ?item wdt:P17 wd:Q36 . ?item wdt:P131 ?admin SERVICE wikibase:label { bd:serviceParam wikibase:language "pl" } }

Use at

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#>
# villages that should have P31 = Q3558970, but have Q532
SELECT ?item ?itemLabel ?adminLabel
WHERE
{
    ?item wdt:P31 wd:Q532 .
    ?item wdt:P17 wd:Q36 .
    ?item wdt:P131 ?admin
    SERVICE wikibase:label { bd:serviceParam wikibase:language "pl" }
}

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v2("?admin") v1("?item"):::projected c2(["wd:Q532"]):::iri c7(["bd:serviceParam"]):::iri c9(["pl"]):::literal c4(["wd:Q36"]):::iri v1 --"wdt:P31"--> c2 v1 --"wdt:P17"--> c4 v1 --"wdt:P131"--> v2 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c7 --"wikibase:language"--> c9 end