query-a1dcf484b8298e915d9756697da674ac

rq turtle/ttl

Items that are in the tree below medicine, medical-condition, medical-procedure, or pharmaceutical drug and missing an en-label SELECT DISTINCT ?item ?itemLabel WHERE { { ?item wdt:P31/wdt:P279 wd:Q11190 } UNION { ?item wdt:P31/wdt:P279 wd:Q12136 . } UNION { ?item wdt:P31/wdt:P279 wd:Q796194 . } UNION { ?item wdt:P31/wdt:P279 wd:Q12140 . } FILTER NOT exists { ?item rdfs:label ?enlabel filter (lang(?enlabel) = "en") } . SERVICE wikibase:label { bd:serviceParam wikibase:language "en". } }

Use at

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#>
# Items that are in the tree below medicine, medical-condition, medical-procedure, or pharmaceutical drug and missing an en-label
SELECT DISTINCT ?item ?itemLabel WHERE {
  { ?item wdt:P31*/wdt:P279* wd:Q11190 }
  UNION  {
    ?item wdt:P31*/wdt:P279* wd:Q12136 .
  }
  UNION {
    ?item wdt:P31*/wdt:P279* wd:Q796194 .
  }
  UNION {
    ?item wdt:P31*/wdt:P279* wd:Q12140 .
  }
  FILTER NOT exists { ?item rdfs:label ?enlabel filter (lang(?enlabel) = "en") } .
  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("?enlabel") v2("?item"):::projected a1((" ")) a2((" ")) a3((" ")) a4((" ")) c10(["bd:serviceParam"]):::iri c8(["wd:Q12140"]):::iri c1(["en"]):::literal c7(["wd:Q796194"]):::iri c5(["wd:Q11190"]):::iri c6(["wd:Q12136"]):::iri f0[["not "]] subgraph f0e0["Exists Clause"] e0f0[["?enlabel = 'en'"]] e0f0 --> e0v1 e0v2 --"rdfs:label"--> e0v1 e0v1("?enlabel"):::projected e0v2("?item"):::projected end f0--EXISTS--> f0e0 f0 --> v1 f0 --> v2 f0 --> c2 f1[["?enlabel = 'en'"]] f1 --> v1 v2 --"rdfs:label"--> v1 subgraph union0[" Union "] subgraph union0l[" "] style union0l fill:#abf,stroke-dasharray: 3 3; subgraph union1[" Union "] subgraph union1l[" "] style union1l fill:#abf,stroke-dasharray: 3 3; subgraph union2[" Union "] subgraph union2l[" "] style union2l fill:#abf,stroke-dasharray: 3 3; v2 --"wdt:P31"--> a4 a4 --"wdt:P279"--> c8 end subgraph union2r[" "] style union2r fill:#abf,stroke-dasharray: 3 3; v2 --"wdt:P31"--> a3 a3 --"wdt:P279"--> c7 end union2r <== or ==> union2l end end subgraph union1r[" "] style union1r fill:#abf,stroke-dasharray: 3 3; v2 --"wdt:P31"--> a2 a2 --"wdt:P279"--> c6 end union1r <== or ==> union1l end end subgraph union0r[" "] style union0r fill:#abf,stroke-dasharray: 3 3; v2 --"wdt:P31"--> a1 a1 --"wdt:P279"--> c5 end union0r <== or ==> union0l end subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c10 --"wikibase:language"--> c1 end