query-9a0ae3da1fdc16f8f117b49f9cbaa6e0

rq turtle/ttl

Diseases with "medical specialty" not associated with the top 20 medical specialties SELECT ?item ?itemLabel ?specLabel WHERE { ?item wdt:P31 wd:Q12136 . ?item wdt:P1995 ?spec . MINUS {?item wdt:P1995 wd:Q1071953 .} MINUS {?item wdt:P1995 wd:Q788926 .} MINUS {?item wdt:P1995 wd:Q162606 .} MINUS {?item wdt:P1995 wd:Q162555 .} MINUS {?item wdt:P1995 wd:Q83042 .} MINUS {?item wdt:P1995 wd:Q7867 .} MINUS {?item wdt:P1995 wd:Q171171 .} MINUS {?item wdt:P1995 wd:Q120569 .} MINUS {?item wdt:P1995 wd:Q327657 .} MINUS { ?item wdt:P1995 wd:Q161437 .} MINUS {?item wdt:P1995 wd:Q103824 .} MINUS {?item wdt:P1995 wd:Q105650 .} MINUS {?item wdt:P1995 wd:Q10379 .} MINUS {?item wdt:P1995 wd:Q203337 .} MINUS {?item wdt:P1995 wd:Q2861470 .} MINUS {?item wdt:P1995 wd:Q101929 .} MINUS {?item wdt:P1995 wd:Q123028 .} MINUS {?item wdt:P1995 wd:Q5284418 .} MINUS {?item wdt:P1995 wd:Q189553 .} MINUS {?item wdt:P1995 wd:Q177635 .}

SERVICE wikibase:label { bd:serviceParam wikibase:language "en" } } LIMIT 10000

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#>
#Diseases with "medical specialty" not associated with the top 20 medical specialties
SELECT ?item ?itemLabel ?specLabel
  WHERE {
  ?item wdt:P31 wd:Q12136 .
  ?item wdt:P1995 ?spec .
  MINUS {?item wdt:P1995 wd:Q1071953 .}
  MINUS {?item wdt:P1995 wd:Q788926 .}
  MINUS {?item wdt:P1995 wd:Q162606 .}
  MINUS {?item wdt:P1995 wd:Q162555 .}
  MINUS {?item wdt:P1995 wd:Q83042 .}
  MINUS {?item wdt:P1995 wd:Q7867 .}
  MINUS {?item wdt:P1995 wd:Q171171 .}
  MINUS {?item wdt:P1995 wd:Q120569 .}
  MINUS {?item wdt:P1995 wd:Q327657 .}
  MINUS { ?item wdt:P1995 wd:Q161437 .}
  MINUS {?item wdt:P1995 wd:Q103824 .}
  MINUS {?item wdt:P1995 wd:Q105650 .}
  MINUS {?item wdt:P1995 wd:Q10379 .}
  MINUS {?item wdt:P1995 wd:Q203337 .}
  MINUS {?item wdt:P1995 wd:Q2861470 .}
  MINUS {?item wdt:P1995 wd:Q101929 .}
  MINUS {?item wdt:P1995 wd:Q123028 .}
  MINUS {?item wdt:P1995 wd:Q5284418 .}
  MINUS {?item wdt:P1995 wd:Q189553 .}
  MINUS {?item wdt:P1995 wd:Q177635 .}

  SERVICE wikibase:label { bd:serviceParam wikibase:language "en" }
}
LIMIT 10000

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v1("?item"):::projected v2("?spec") c20(["wd:Q123028"]):::iri c13(["wd:Q161437"]):::iri c15(["wd:Q105650"]):::iri c18(["wd:Q2861470"]):::iri c11(["wd:Q120569"]):::iri c19(["wd:Q101929"]):::iri c22(["wd:Q189553"]):::iri c25(["bd:serviceParam"]):::iri c9(["wd:Q7867"]):::iri c6(["wd:Q162606"]):::iri c14(["wd:Q103824"]):::iri c16(["wd:Q10379"]):::iri c2(["wd:Q12136"]):::iri c23(["wd:Q177635"]):::iri c10(["wd:Q171171"]):::iri c21(["wd:Q5284418"]):::iri c27(["en"]):::literal c5(["wd:Q788926"]):::iri c17(["wd:Q203337"]):::iri c8(["wd:Q83042"]):::iri c7(["wd:Q162555"]):::iri c12(["wd:Q327657"]):::iri c4(["wd:Q1071953"]):::iri v1 --"wdt:P31"--> c2 v1 --"wdt:P1995"--> v2 subgraph minus0["MINUS"] style minus0 stroke-width:6px,fill:pink,stroke:red; v1 --"wdt:P1995"--> c4 end subgraph minus1["MINUS"] style minus1 stroke-width:6px,fill:pink,stroke:red; v1 --"wdt:P1995"--> c5 end subgraph minus2["MINUS"] style minus2 stroke-width:6px,fill:pink,stroke:red; v1 --"wdt:P1995"--> c6 end subgraph minus3["MINUS"] style minus3 stroke-width:6px,fill:pink,stroke:red; v1 --"wdt:P1995"--> c7 end subgraph minus4["MINUS"] style minus4 stroke-width:6px,fill:pink,stroke:red; v1 --"wdt:P1995"--> c8 end subgraph minus5["MINUS"] style minus5 stroke-width:6px,fill:pink,stroke:red; v1 --"wdt:P1995"--> c9 end subgraph minus6["MINUS"] style minus6 stroke-width:6px,fill:pink,stroke:red; v1 --"wdt:P1995"--> c10 end subgraph minus7["MINUS"] style minus7 stroke-width:6px,fill:pink,stroke:red; v1 --"wdt:P1995"--> c11 end subgraph minus8["MINUS"] style minus8 stroke-width:6px,fill:pink,stroke:red; v1 --"wdt:P1995"--> c12 end subgraph minus9["MINUS"] style minus9 stroke-width:6px,fill:pink,stroke:red; v1 --"wdt:P1995"--> c13 end subgraph minus10["MINUS"] style minus10 stroke-width:6px,fill:pink,stroke:red; v1 --"wdt:P1995"--> c14 end subgraph minus11["MINUS"] style minus11 stroke-width:6px,fill:pink,stroke:red; v1 --"wdt:P1995"--> c15 end subgraph minus12["MINUS"] style minus12 stroke-width:6px,fill:pink,stroke:red; v1 --"wdt:P1995"--> c16 end subgraph minus13["MINUS"] style minus13 stroke-width:6px,fill:pink,stroke:red; v1 --"wdt:P1995"--> c17 end subgraph minus14["MINUS"] style minus14 stroke-width:6px,fill:pink,stroke:red; v1 --"wdt:P1995"--> c18 end subgraph minus15["MINUS"] style minus15 stroke-width:6px,fill:pink,stroke:red; v1 --"wdt:P1995"--> c19 end subgraph minus16["MINUS"] style minus16 stroke-width:6px,fill:pink,stroke:red; v1 --"wdt:P1995"--> c20 end subgraph minus17["MINUS"] style minus17 stroke-width:6px,fill:pink,stroke:red; v1 --"wdt:P1995"--> c21 end subgraph minus18["MINUS"] style minus18 stroke-width:6px,fill:pink,stroke:red; v1 --"wdt:P1995"--> c22 end subgraph minus19["MINUS"] style minus19 stroke-width:6px,fill:pink,stroke:red; v1 --"wdt:P1995"--> c23 end subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c25 --"wikibase:language"--> c27 end