cancel
Showing results for 
Search instead for 
Did you mean: 

Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.

Is there an error in this graph embedding tutorial?

lingvisa
Graph Fellow

I am looking at this graph embedding tutorial, as shown below:

https://neo4j.com/developer/graph-data-science/applied-graph-embeddings/

In the graph creation cypher script, there is only one node type, Place:

CREATE CONSTRAINT ON (p:Place) ASSERT p.name IS UNIQUE;

:auto USING PERIODIC COMMIT 1000
LOAD CSV WITH HEADERS FROM "https://github.com/neo4j-examples/graph-embeddings/raw/main/data/roads.csv"
AS row

MERGE (origin:Place {name: row.origin_reference_place})
SET origin.countryCode = row.origin_country_code

MERGE (destination:Place {name: row.destination_reference_place})
SET destination.countryCode = row.destination_country_code

MERGE (origin)-[eroad:EROAD {number: row.road_number}]->(destination)
SET eroad.distance = toInteger(row.distance), eroad.watercrossing = row.watercrossing;

It created only one node type, Place without Country, but in the tutorial text, and the schema visualization, it shows there are two node types, Place & Country and a relationship, place_in_country, as shown below:

How could it be possible based on the cypher script? I created the graph using the script and get the schema visualization as below, which is consistent with the script:

So is the schema diagram in the tutorial not quite right? Just curious about this.

1 ACCEPTED SOLUTION

lingvisa
Graph Fellow

OK. I got this updated cypher script which is consistent with the tutorial text:

View solution in original post

1 REPLY 1

lingvisa
Graph Fellow

OK. I got this updated cypher script which is consistent with the tutorial text: