Graph projection

can you create new relationships using graph projection? Here is the code i have that doesn't work. However, it works after i remove the create relationships part.

CALL gds.graph.project.cypher(

'temp5',

'MATCH (n) WHERE n:Publication OR n:Model OR n:Relation OR n:Element RETURN id(n) AS id',

"Match (p:Publication)--(m:Model{modelTitle:'Research model'})--(r:Relation{type:'causal'}) WITH r MATCH (c:Element)<-[:HAS{role:'consequent'}]-(r:Relation{type:'causal'})-[:HAS{role:'antecedent'}]->(a:Element) CREATE (a)-[:RELATES_TO]->(c) RETURN id(a) AS source, id(c) AS target;")

YIELD

graphName, nodeCount AS nodes, relationshipCount AS rels

RETURN graphName, nodes, rels

The error I received is

Failed to invoke procedure `gds.graph.project.cypher`: Caused by: org.neo4j.graphdb.NotInTransactionException: The transaction has been closed.

The intent of the cypher queries are to identify the nodes and relationships to project. As such, I suspect the queries are executed in a read transaction, so write operations are not allowed.

I suggest you create the relationships prior to projecting.your relationship query in your projection will be much simpler as a result.