query-d7c3ac85a297dbb415b6bf8d670d93a1

rq turtle/ttl

Propertiesinstance of (P31)subclass of (P279)ICD-10 ID (P494)

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#>
PREFIX schema: <http://schema.org/>

SELECT ?disease ?diseaseLabel (MIN(?icd) AS ?ICD10) ?article WHERE {
  ?disease wdt:P31/wdt:P279* wd:Q12136.
  ?disease wdt:P494 ?icd.
  ?article schema:about ?disease.
  ?article schema:isPartOf <https://en.wikipedia.org/>.
  SERVICE wikibase:label { bd:serviceParam wikibase:language "en,[AUTO_LANGUAGE]". }
}
GROUP BY ?disease ?diseaseLabel ?article
ORDER BY ?diseaseLabel
LIMIT 2000

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v5("?ICD10") v4("?article"):::projected v2("?disease"):::projected v1("?diseaseLabel"):::projected v3("?icd"):::projected a1((" ")) c7([https://en.wikipedia.org/]):::iri c9(["bd:serviceParam"]):::iri c11(["en,#91;AUTO_LANGUAGE#93;"]):::literal c3(["wd:Q12136"]):::iri v2 --"wdt:P31"--> a1 a1 --"wdt:P279"--> c3 v2 --"wdt:P494"--> v3 v4 --"schema:about"--> v2 v4 --"schema:isPartOf"--> c7 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c9 --"wikibase:language"--> c11 end bind1[/"min(?icd)"/] v3 --o bind1 bind1 --as--o v5