query-6233331d2dda999e8ad5dfdd51ee9ef6

rq turtle/ttl

Propertiessymptoms and signs (P780)

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#>
SELECT
      ?disease ?diseaseLabel (COUNT(?symptom) AS ?symptom_count) (GROUP_CONCAT(?symptom_label; separator=" // ") AS ?symptoms) 
WHERE
{
      wd:Q84263196 wdt:P780 ?symptom .
      ?disease wdt:P780 ?symptom . 
      FILTER (wd:Q84263196 != ?disease)
      ?symptom rdfs:label ?symptom_label . FILTER(lang(?symptom_label) = "en")
      SERVICE wikibase:label { bd:serviceParam wikibase:language "en". }
}
GROUP BY ?disease ?diseaseLabel
ORDER BY DESC(?symptom_count)

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v3("?disease"):::projected v4("?symptom"):::projected v5("?symptom_count") v2("?symptom_label"):::projected v5("?symptoms") c2(["wd:Q84263196"]):::iri c6(["bd:serviceParam"]):::iri c1(["en"]):::literal f0[["?symptom_label = 'en'"]] f0 --> v2 f1[["'wd:Q84263196' != ?disease"]] f1 --> v3 c2 --"wdt:P780"--> v4 v3 --"wdt:P780"--> v4 v4 --"rdfs:label"--> v2 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c6 --"wikibase:language"--> c1 end bind4[/"count(?symptom)"/] v4 --o bind4 bind4 --as--o v5 bind5[/"?symptom_label"/] v2 --o bind5 bind5 --as--o v5