Wikidata:WikiProject Medicine/Queries

From Wikidata
Jump to navigation Jump to search

Home

 

Properties

 

Data models

 

Items and Queries

 

Literature

 


Lists

 


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". }
}
Try it!
# 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" }
}
Try it!


# 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"  }    
}
Try it!
# 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". }
}
Try it!
#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". }
}
Try it!

Countries without hospitals

[edit]
#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

Try it!

Articles published in journal: Clinical Breast Cancer

[edit]
# 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" }
}

Try it!

Neurological diseases ordered by prevalence

[edit]
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)

Try it!