Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save davidsbatista/3f9310a25274b3e2063bee3e1f5f877d to your computer and use it in GitHub Desktop.

Select an option

Save davidsbatista/3f9310a25274b3e2063bee3e1f5f877d to your computer and use it in GitHub Desktop.
capitals of counties in the USA, with state and state code, filtered by population
SELECT DISTINCT ?capital ?capital_label ?pop ?code WHERE {
?county wdt:P31/wdt:P279* wd:Q47168 .
?county wdt:P36 ?capital .
?capital rdfs:label ?capital_label .
?capital wdt:P1082 ?pop .
?county wdt:P131 ?state .
?state wdt:P31 wd:Q35657 .
?state wdt:P300 ?code .
FILTER(LANG(?capital_label) = "en")
FILTER(?pop >= 50000).
} ORDER BY DESC(?pop)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment