I'm trying to extract a list of diseases that have symptoms from Wikidata.
The thing is, when I query I get a list of entity URIs, not a list of labels, for the Symptoms column.
My query, tested on here :
SELECT ?disease ?diseaseLabel (GROUP_CONCAT(?symptoms; SEPARATOR = ", ") AS ?Symptoms)
WHERE {
?disease wdt:P31 wd:Q12136.
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
OPTIONAL { ?disease wdt:P780 ?symptoms. }
FILTER(EXISTS { ?disease wdt:P780+ ?symptom. })
}
GROUP BY ?disease ?diseaseLabel
Which gives the following result :
For example , at the disease measles ,what I want to select for the Symptoms column is : fever, cough, runny nose, maculopapular rash, lymphadenopathy, anorexia, diarrhea..
Which are the exact labels for the URIs in the Symptom column for the particular disease.
Any help/hint and suggestions are welcomed , thank you !