The following cypher query is not returning anything in results, rather null.
MATCH (scene:Scene)-[c:CONTAINS]->(object_obs:ObjectObservation)
MATCH (object:Object)-[i:WAS_OBSERVED]->(lane:LaneObservation)
WITH scene, object_obs, object, lane,
{
sceneNodeProperties: scene {scene_id: coalesce(scene.scene_id, 0)},
obj_obsNodeProperties: object_obs {obj_obs: coalesce(object.obj_type, 0)},
objectNodeProperties: object {obj_type: coalesce(object.obj_type, 0)},
laneNodeProperties: lane {which_lane: coalesce(lane.which_lane, 0)}
} AS properties
WITH gds.graph.project(
'sceneGraph',
scene,
object_obs,
object,
lane,
properties
) AS g
RETURN g.graphName AS graph, g.nodeCount AS nodes, g.relationshipCount AS rels
I have verified that graph exists as expected based on the following data load:
LOAD CSV WITH HEADERS FROM 'file:///ttraffic_scenario.csv' AS row
MERGE (scene:Scene {scene_id: toFloat(row['scene_id']), timestamp: datetime(row['timestamp'])})
MERGE (object:Object {obj_type: toFloat(row['obj_type']),obj_id: toFloat(row['obj_id'])})
MERGE (object_obs:ObjectObservation {obj_type: toFloat(row['obj_type']),timestamp: (row['timestamp'])})
MERGE (lane:LaneObservation {which_lane: toFloat(row['lane']),timestamp: (row['timestamp'])})
MERGE (scene)-[:CONTAINS]->(object_obs)
MERGE (object_obs)-[:IN_LANE]->(lane)
MERGE (object)-[:WAS_OBSERVED]->(object_obs)
Input data example from CSV:
scene_id,obj_id,lane,obj_type,timestamp
1,1,1,1,2024-03-01T10:00:00
1,2,2,1,2024-03-01T10:00:00
1,3,3,2,2024-03-01T10:00:00
2,1,1,1,2024-03-01T10:00:01
2,2,2,1,2024-03-01T10:00:01
2,3,3,2,2024-03-01T10:00:01
3,1,1,1,2024-03-01T10:00:02
3,2,2,1,2024-03-01T10:00:02
3,3,3,2,2024-03-01T10:00:02
- neo4j version: desktop version
- what kind of API / driver do you use: Cypher