So, after installing APOC and copying the data file into your import folder, you can simply call the apoc.import.graphml procedure in this way:
CALL apoc.import.graphml("manhattan_road_network.graphml", {defaultRelationshipType:"LINKED_TO"})
After a couple of seconds, you will see a result similar to this one:
4,426 nodes (junctions) were inserted and 9,626 relationships of type LINKED_TO representing road segments were created between them.
In order to facilitate the queries in the rest of this chapter, we will assign a label, Junction, to the newly created nodes:
MATCH (n)
WHERE n.latitude IS NOT NULL AND n.longitude IS NOT NULL
SET n:Junction
Our graph is well imported. You can check a few nodes and relationships. For instance, those associated with Fifth Avenue look like the following diagram:
In the final section of this chapter, we will learn how to represent this data on a map for a more realistic visualization. Before that, let&apos...