Created
May 18, 2019 11:29
-
-
Save vladbatushkov/d16f11a72f8a3ae1c13c3c0625f9e0b6 to your computer and use it in GitHub Desktop.
Museums.
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
WITH "https://en.wikipedia.org" as url | |
CALL apoc.load.html(url + "/wiki/List_of_museums_in_Moscow", { data: "div.mw-content-ltr > div > ul a" }) YIELD value | |
UNWIND value.data as item | |
WITH { name: item.text, url: item.attributes.href } as m, url | |
CALL apoc.load.html(url + m.url, { data: "table.infobox.vcard span.geo" }) YIELD value | |
UNWIND value.data as coord | |
WITH apoc.text.split(coord.text, "; ") as coords, m | |
WITH { name: m.name, latitude: toFloat(coords[0]), longitude: toFloat(coords[1]) } as n | |
MERGE (:Museum { name: n.name, location: point({ latitude: n.latitude, longitude: n.longitude }) }) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment