query-fae78e23afd18d7d2bfb38c0c06dd8e5

rq turtle/ttl

Patients and those they are treated by

Use at

PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX bd: <http://www.bigdata.com/rdf#>
select ?patient ?patientLabel ?treater ?treaterLabel ?medical_condition ?medical_conditionLabel where {
  ?patient wdt:P3205 ?treater .
  optional { ?patient wdt:P1050 ?medical_condition . }
  SERVICE wikibase:label {
     bd:serviceParam wikibase:language "da" .
   } 
}

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v3("?medical_condition"):::projected v1("?patient"):::projected v2("?treater"):::projected c4(["bd:serviceParam"]):::iri c6(["da"]):::literal v1 --"wdt:P3205"--> v2 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v1 -."wdt:P1050".-> v3 end subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c4 --"wikibase:language"--> c6 end