query-a101cab881de72415c68cf6f6ec98883

rq turtle/ttl

Items with PM20 subject code (P8484), which are not an instance of PM20 subject category (Q92707903)

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#>
select distinct ?item ?itemLabel
where {
  ?item wdt:P8484 ?subjectCode .
  filter( not exists {
    ?item wdt:P31 wd:Q92707903 .
  })
  SERVICE wikibase:label { bd:serviceParam wikibase:language "en". }
}

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v1("?item"):::projected v2("?subjectCode") c2(["wd:Q92707903"]):::iri c5(["bd:serviceParam"]):::iri c7(["en"]):::literal f0[["not "]] subgraph f0e0["Exists Clause"] e0v1 --"wdt:P31"--> e0c2 e0v1("?item"):::projected e0c2(["wd:Q92707903"]):::iri end f0--EXISTS--> f0e0 f0 --> v1 f0 --> c1 f0 --> c2 v1 --"wdt:P31"--> c2 v1 --"wdt:P8484"--> v2 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c5 --"wikibase:language"--> c7 end