query-74f58fceb00026c2dd8144102b62c555

rq turtle/ttl

Extended version: No mapping relation, instance-of, no organization

Use at

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
where {
  # pm20 id starting with "co/"
  ?item wdt:P4293 ?pm20Id .
  filter(regex(?pm20Id, "^co/"))
  # existing instance-of relationship
  filter (exists {
    ?item wdt:P31 [] .
  })
  # not an instance of (subclass of) organization
  filter (not exists {
      ?item p:P31/ps:P31/wdt:P279* wd:Q43229 .
    })
  # exclude items with mapping relations
  filter (not exists {
    ?item p:P4293/pq:P4390 ?relation .
    })
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE,de,en,es,fr]". }
}

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v1("?item"):::projected v3("?pm20Id") v2("?relation") a4((" ")) a2((" ")) a3((" ")) a1((" ")) c13(["#91;AUTO_LANGUAGE,de,en,es,fr#93;"]):::literal c6(["wd:Q43229"]):::iri c11(["bd:serviceParam"]):::iri f0[["not "]] subgraph f0e0["Exists Clause"] e0v1 --"p:P4293"--> e0a1 e0a1 --"p:qualifier/P4390"--> e0v2 e0v1("?item"):::projected e0v2("?relation"):::projected e0a1((" ")):::projected end f0--EXISTS--> f0e0 f0 --> v1 f0 --> c1 f0 --> a1 f0 --> c2 f0 --> v2 v1 --"p:P4293"--> a1 a1 --"p:qualifier/P4390"--> v2 f1[["not "]] subgraph f1e1["Exists Clause"] e1v1 --"p:P31"--> e1a1 e1a1 --"p:statement/P31"--> e1a2 e1a2 --"p:direct/P279"--> e1c4 e1v1("?item"):::projected e1a1((" ")):::projected e1a2((" ")):::projected e1c4(["wd:Q43229"]):::iri end f1--EXISTS--> f1e1 f1 --> v1 f1 --> c3 f1 --> a2 f1 --> c4 f1 --> a3 f1 --> c5 f1 --> c6 v1 --"p:P31"--> a2 a2 --"p:statement/P31"--> a3 a3 --"p:direct/P279"--> c6 f2[[" "]] subgraph f2e2["Exists Clause"] e2v1 --"p:direct/P31"--> e2a1 e2v1("?item"):::projected e2a1((" ")):::projected end f2--EXISTS--> f2e2 f2 --> v1 f2 --> c7 f2 --> a4 v1 --"p:direct/P31"--> a4 f3[["regex(?pm20Id,'^co/')"]] f3 --> v3 v1 --"p:direct/P4293"--> v3 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c11 --"wikibase:language"--> c13 end