Skip to content

Instantly share code, notes, and snippets.

@hammedb197
Last active July 3, 2020 11:39
Show Gist options
  • Select an option

  • Save hammedb197/cfcb6f23dfa01f25df24fb158d16a4aa to your computer and use it in GitHub Desktop.

Select an option

Save hammedb197/cfcb6f23dfa01f25df24fb158d16a4aa to your computer and use it in GitHub Desktop.
SparkQL queries
get symptoms of COVID-19
SELECT ?categoryLabel
?symptom ?symptomLabel
WHERE {
?category wdt:P31* wd:Q84263196 .
?category wdt:P780 ?symptom.
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
#get incubation period and detected date
SELECT ?categoryLabel
?minIncubation ?maxIncubation ?detected
WHERE {
?category wdt:P31* wd:Q84263196 .
?category wdt:P3488 ?minIncubation.
?category wdt:P3487 ?maxIncubation.
?category wdt:P575 ?detected.
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
#Treatment
SELECT ?categoryLabel
?drug ?drugLabel
WHERE {
?category wdt:P31* wd:Q84263196 .
?category wdt:P2176 ?drug.
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment