Wikidata:WikiProject Medicine/Queries
Jump to navigation
Jump to search
Try it!
Try it!
Try it!
Try it!
Try it!
|
Queries
[edit]# Items that are in the tree below medicine, medical-condition, medical-procedure, or pharmaceutical drug and missing an en-label
SELECT DISTINCT ?item ?itemLabel WHERE {
{ ?item wdt:P31*/wdt:P279* wd:Q11190 }
UNION {
?item wdt:P31*/wdt:P279* wd:Q12136 .
}
UNION {
?item wdt:P31*/wdt:P279* wd:Q796194 .
}
UNION {
?item wdt:P31*/wdt:P279* wd:Q12140 .
}
FILTER NOT exists { ?item rdfs:label ?enlabel filter (lang(?enlabel) = "en") } .
SERVICE wikibase:label { bd:serviceParam wikibase:language "en". }
}
# Map of hospitals
SELECT ?item ?itemLabel ?coord
WHERE
{
?item wdt:P279*/wdt:P31* wd:Q16917 .
?item wdt:P625 ?coord .
SERVICE wikibase:label { bd:serviceParam wikibase:language "en" }
}
# List of defined daily dosages, the unit and route of administration
SELECT ?item ?itemLabel ?ddd ?dddUnitLabel ?routeLabel
WHERE
{
?item wdt:P4250 ?ddd .
?item p:P4250/psv:P4250 ?value_statement .
?value_statement wikibase:quantityUnit ?dddUnitLabel .
?item p:P4250 ?statement .
OPTIONAL { ?statement pq:P636 ?route }
SERVICE wikibase:label { bd:serviceParam wikibase:language "en" }
}
# Conditions: List where item's type is 'health problem' or sub-type or sub-sub-type/etc
SELECT ?item ?itemLabel
WHERE
{
?item p:P31/ps:P31/wdt:P279* wd:Q2057971.
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
#PubMed Articles
SELECT ?item ?itemLabel ?pmid
WHERE
{
?item wdt:P31 wd:Q191067.
?item wdt:P698 ?pmid .
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
Countries without hospitals
[edit]- Items used: hospital (Q16917)
- Properties used: instance of (P31) , subclass of (P279) , country (P17) , is a list of (P360)
#countries without hospitals
SELECT ?country ?countryLabel (COUNT(?entity) as ?count) (SAMPLE(?entity) as ?sample)
WHERE
{
{
?entity wdt:P31/wdt:P279* wd:Q16917 ; wdt:P17 ?country .
}
UNION
{
SELECT DISTINCT ?country { ?item wdt:P360 wd:Q16917 ; wdt:P17 ?country . }
}
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
GROUP BY ?country ?countryLabel
HAVING (?count = 0)
ORDER BY ?countryLabel
Articles published in journal: Clinical Breast Cancer
[edit]- Items used: Clinical Breast Cancer (Q332245)
- Properties used: published in (P1433) , PubMed publication ID (P698) , main subject (P921) , volume (P478) , issue (P433) , page(s) (P304)
# List of articles published in journal: Clinical Breast Cancer
SELECT ?item ?pmid ?itemLabel ?mainTopicLabel ?volume ?issue ?pages
WHERE
{
?item wdt:P1433 wd:Q332245 .
OPTIONAL {?item wdt:P698 ?pmid }
OPTIONAL {?item wdt:P921 ?mainTopic }
OPTIONAL {?item wdt:P478 ?volume }
OPTIONAL {?item wdt:P433 ?issue }
OPTIONAL {?item wdt:P304 ?pages }
SERVICE wikibase:label { bd:serviceParam wikibase:language "en" }
}
Neurological diseases ordered by prevalence
[edit]- Items used: neurology (Q83042)
- Properties used: health specialty (P1995) , prevalence (P1193)
SELECT ?disease ?diseaseLabel (AVG(?prev) AS ?prevalence) WHERE {
?disease wdt:P1995 wd:Q83042;
wdt:P1193 ?prev.
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE]". }
}
GROUP BY ?disease ?diseaseLabel
ORDER BY DESC (?prevalence)