Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
12-01-2021 11:21 AM
Hi,
What is the appropriate syntax from creating a GDS graph based on virtual relationships? As an example I have a straight forward Cypher query that creates a virtual relationship between companies and I would like to do some cummings detection algorithms on the results.
match (a1:company)-[]-(a:patent)-[r:Cites{who:'applicant'}]->(b:patent)-[:Assigned_to]-(c:company)
with a1,c,count(distinct(a)) as patnum
return a1,c, apoc.create.vRelationship(a1,'Notices',{num:patnum},c) as rel
If I use this as a starting point:
CALL gds.graph.create.cypher(
'persons',
'MATCH (n:Person) RETURN id(n) AS id',
'MATCH (n:Person)-[r:KNOWS]->(m:Person) RETURN id(n) AS source, id(m) AS target')
YIELD
graphName AS graph, nodeQuery, nodeCount AS nodes, relationshipQuery, relationshipCount AS rels
It is straight forward to for the node definition (n:Person) becomes (n:company)
I don't know how to craft the relationship query. Advice?
Andy
All the sessions of the conference are now available online