Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save davidsbatista/ea5bf3a984cfa6e5ec0f27440a008f04 to your computer and use it in GitHub Desktop.
Save davidsbatista/ea5bf3a984cfa6e5ec0f27440a008f04 to your computer and use it in GitHub Desktop.
Number of connections served for a given airport
SELECT ?iata_code ?airport_name (COUNT(?connectsairport) AS ?nr_connections)
WHERE
{
VALUES ?airport { wd:Q17480 wd:Q9694 wd:Q160556 wd:Q403671}
?airport wdt:P238 ?iata_code.
?airport rdfs:label ?airport_name.
OPTIONAL {
?airport wdt:P81 ?connectsairport.
}
FILTER(LANG(?airport_name) = "en")
}
GROUP BY ?iata_code ?airport_name
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment