Created
May 10, 2019 15:30
-
-
Save vladbatushkov/4389612c46bf84a1fb71eb583b6c147c to your computer and use it in GitHub Desktop.
List all not terminated IATA codes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MERGE (bkk:Airport { IATA: "BKK" }) | |
WITH ("https://en.wikipedia.org/wiki/List_of_Thai_Airways_destinations") as url, bkk | |
CALL apoc.load.html(url, { codes: "table.sortable tr[style!=\"background-color:#DDDDDD\"] td:eq(2)" }) YIELD value | |
WITH filter(code IN value.codes WHERE code.text <> "BKK") as outsideCodes, bkk | |
UNWIND outsideCodes as code | |
MERGE (a:Airport { IATA: code.text }) | |
MERGE (bkk)-[:TO]->(a) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment