I'm struggling with importing "dynamic" relations. The relations are the results from join-operations in an RDBMS. The export works as intended but I struggle to import it into Neo4j. The "dynamic" relations are solved by using the apoc.merge.relationship function but I'm running into problems with the properties for the relations as they're sometimes NULL. Is it possible to perform some sort of "CASE" operation to solve this? My current Cypher approach looks like this:
LOAD CSV WITH HEADERS FROM 'http://hostname/exports/relation_person_organisation_position.txt' AS row FIELDTERMINATOR '\t'
MATCH (o:Organisation {id: row.organisation_id})
MATCH (p:Person {id: row.person_id})
CALL apoc.merge.relationship(p, row.relation_in_neo4j, {since: row.since, notes: row.notes}, {}, o) YIELD rel RETURN rel;
I'm far from a Cypher guru so please bare with my Cypher code above :)