Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
07-15-2020 03:50 PM
We have a db of UK companies and company officers, using apoc.path.expand:
MATCH (c:Company) where c.name = "REGULATION TECHNOLOGIES LTD"
call apoc.path.expandConfig(c, {maxLevel:4, relationshipFilter:'HAS_PERSON_RECORD|HAS_COMPANY|HAS_COMPANY_OFFICER', uniqueness:'RELATIONSHIP_GLOBAL'}) YIELD path
RETURN path
The final visualisation I want is orange node-blue node-orange node..., i.e. removing the grey node. (With help from the forum previously) made some progress using virtual relationships:
MATCH (c:Company) where c.name = "REGULATION TECHNOLOGIES LTD"
call apoc.path.expandConfig(c, {maxLevel:4, relationshipFilter:'HAS_PERSON_RECORD|HAS_COMPANY|HAS_COMPANY_OFFICER', uniqueness:'RELATIONSHIP_GLOBAL'}) YIELD path
UNWIND relationships(path) as rel
WITH DISTINCT rel
WITH startNode(rel) as event, collect(DISTINCT endNode(rel)) as toConnect
WITH toConnect[0] as toConnect1, toConnect[1] as toConnect2
CALL apoc.create.vRelationship(toConnect1,'CONNECTED_TO',{}, toConnect2) YIELD rel
RETURN toConnect1, rel, toConnect2
The desired output is to have the blue nodes where the grey ones are. If it's a case of re-working the virtualisation step or some other step after it I have failed to crack it! Any help gratefully received.
Thanks
All the sessions of the conference are now available online