I have 2 nodes created in graph database, origin airport and destination airport. It is related by a property named 'delayed_by'. I need to associate multiple values to this property 'delayed_by'. There are various reasons for delays such as weather delay, carrier delay, nas delay and I need to link all of them to this property in graph database. I am expecting values as that of below tabular format in graph database
ORIGIN DEST carr_delay weather_delay nas_delay
ABE ATL 492 56 56
I used the below code for the relation:
MATCH (origin:origin_airport {name: row.ORIGIN}),
(destination:dest_airport {name: row.DEST})
CREATE (origin)-[:delayed_by {carr_delay: row.carr_delay}]->(destination)
CREATE (origin)-[:delayed_by {weather_delay: row.weather_delay}]->
(destination)
CREATE (origin)-[:delayed_by {nas_delay: row.nas_delay}]->(destination)
But the delayed_by relationship is getting mapped 3 times and it produces something like below:
ORIGIN DEST carr_delay weather_delay nas_delay
ABE ATL 492 NULL NULL
ORIGIN DEST carr_delay weather_delay nas_delay
ABE ATL NULL 56 NULL
ORIGIN DEST carr_delay weather_delay nas_delay
ABE ATL NULL NULL 56
I tried to use the below code as suggested in one other post,
MATCH (origin:origin_airport {name: row.ORIGIN}),
(destination:dest_airport {name: row.DEST})
CREATE (origin)
-[:delayed_by {type: carr_delay, value: row.carr_delay}]->
(destination)
CREATE (origin)
-[:delayed_by {type: weather_delay, value: row.weather_delay}]->
(destination)
CREATE (origin)
-[:delayed_by {type: nas_delay, value: row.nas_delay}]->
(destination)
But it is not accepting type:, value: properties and I am getting an error at type
Error: Client error: (400) Bad Request
Neo.ClientError.Statement.SyntaxError
How to add multiple value to a property using cypher queries in Neo4j?. I am writing these queries in R by connecting R to Neo4j.