Open marcderbauer opened 8 months ago
Wanted to watch this to check if my cypher output is correct. Postponing this for now. I'll just try to load the cypher query and if it works then good, if not I'll watch this course.
Better: figure out how to load the cypher query into Neo4j in python. (See #23)
UPDATE: Managed to load cypher query into Neo4j. However, relations aren't created correctly. Will need to watch course to debug.
WHAT IT LOOKS LIKE
! THIS IS WRONG!!!
CREATE (:Event {name: "Civil_War"})
MATCH (start:South_Sudan), (end:Civil_War) CREATE (start)-[:has_conflict{levels: 'high'}]->(end)
WHAT IT SHOULD LOOK LIKE
CREATE (:Event {name: "Civil War"})
MATCH (start:Country{name: "South Sudan"}), (end:Event{name:"Civil War"}) CREATE (start)-[:has_conflict{levels: 'high'}]->(end)
Not sure if it will exactly work like that, but in general the problem is:
Manually adjust development set of utterances to fit new schema and develop with that. Shouldn't be too hard to fix this. Once we know the "final" schema that works we can adjust the conversion function to output that schema.
I also considered changing the ChatGPT output, but we want to keep it as simple as possible for now to avoid errors.
NODE: ENTITY, TYPE, PROPERTY ["South Sudan", "Country", {}]
RELATION: [ENTITY1, RELATIONSHIP, ENTITY2, PROPERTIES] ["South Sudan", "has_conflict", "Civil War", {"levels": "high"}],
Looking at it a bit more the entity labels seem correct here.
The actual issue seem to be the CREATE Statements. They're creating nodes with the label country and the property "name=xyz". They instead should be creating nodes with the label=name and category=Country/City/...
How it is
"CREATE (:Country {name: \"South_Sudan\"})",
"CREATE (:City {name: \"Juba\"})",
"CREATE (:Organization {name: \"Government\"})",
How it should be
"CREATE (:South_Sudan {category: \"Country\"})",
"CREATE (:Juba {category: \"City\"})",
"CREATE (:Government {category: \"Organization\"})",
So the CREATE statements work now, but I have the MATCH CREATE statements don't...
Seems like all entities need to be created before you can match them. Might have to create a set of entities from the match statement to create first and then can create the matches
Watched course, rest is separate ticket (see #30)
https://graphacademy.neo4j.com/courses/cypher-fundamentals/
Unblocks #7