Dealing with spatial data in Neo4j
Neo4j has a built-in type for dealing with spatial data, but only for points so far (lines and polygons are not supported (yet)).
Wikidata contains coordinates information for many entities. For instance, each country has a location. We can extract it using the following query:
SELECT ?country ?countryLabel ?lat ?lon WHERE { ?country rdfs:label "India"@en; wdt:P31 wd:Q6256. ?country p:P625 ?coordinate. ?coordinate psv:P625 ?coordinate_node. ?coordinate_node wikibase:geoLongitude ?lon. ?coordinate_node wikibase:geoLatitude ?lat. SERVICE wikibase:label {bd:serviceParam wikibase:language "en" .} }
Going further
Explanations of the new parts of this query are available here: https...