cancel
Showing results for 
Search instead for 
Did you mean: 

Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.

Graph projection

aprilsong0323
Node Link

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.
1 REPLY 1

glilienfield
Ninja
Ninja

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.