createRel
createRel(alice, "KNOWS", charles, props)
Would be nice to have:
createRel(alice, "KNOWS", charles, props, duplicates = TRUE )
or
getOrCreateRel = createRel(alice, "KNOWS", charles, props, duplicates = FALSE )
createRel(
In this case duplicates with default value TRUE, to not modify the actual functionality in previous implementations.
the code:
before the link creation, is it possible to check if the link exists if duplicates is FALSE.
query = paste0("MATCH (a),(b) WHERE ID(a)={a} AND ID(b)={b} CREATE (a)-[r:", .relType, " {props}]->(b) RETURN r")
Country->Region
createRel(lknGcCt_n, 'IS_IN',lknGcS_n)
if the script runs several times creates the same relationship multiple times.

At the moment it is possible to use:
if ( is.null( outgoingRels(lknGcCt_n,'IS_IN') ) )
The relationship is One to One, in cases One to many it is not possible.
At the moment I'm using something like:
num_rels <- getRels(graph,"MATCH (:Geo_Code {code:{from_code}})-[r:IS_IN]->(:Geo_Code {code:{to_code}}) RETURN r", from_code = lknGcCt_n$code, to_code = lknGcS_n$code)
if ( length(num_rels) == 0 ) {
createRel(lknGcCt_n, 'IS_IN',lknGcS_n)