Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
05-23-2019 05:12 AM
Is there a way of running and aggregating very many queries without using the step-wise WITH?
My case is that I need to run x10's or x100's of EXPAND queries and return all of them. As Neo (can) automatically connect result nodes this produces a 'super' expansion limited to those starting nodes.
TIA Mike
MATCH (c:Company)
WHERE c.name ="AFRICA DRIVE (SOUTHAMPTON) LIMITED"
CALL apoc.path.expandConfig(c,{maxLevel:4, relationshipFilter:'CONCERNS|HAS_SURNAME|HAS_FORNAME', labelFilter: '/Surname|/ForeNames', uniqueness:'NODE_GLOBAL'}) YIELD path
WITH path AS path1
MATCH (c:Company)
WHERE c.name ="AIS (MARINE) 2 LIMITED"
CALL apoc.path.expandConfig(c,{maxLevel:4, relationshipFilter:'CONCERNS|HAS_SURNAME|HAS_FORNAME', labelFilter: '/Surname|/ForeNames', uniqueness:'NODE_GLOBAL'}) YIELD path
WITH path AS path2, path1
MATCH (c:Company)
WHERE c.name ="AIS (MARINE) 3 PLC"
CALL apoc.path.expandConfig(c,{maxLevel:4, relationshipFilter:'CONCERNS|HAS_SURNAME|HAS_FORNAME', labelFilter: '/Surname|/ForeNames', uniqueness:'NODE_GLOBAL'}) YIELD path
WITH path AS path3, path2, path1
RETURN path1, path2, path3
LIMIT 100
Solved! Go to Solution.
05-23-2019 11:20 PM
Hey Mike,
Please try with below query and let us know it solves your query or not
MATCH (c:Company)
WHERE c.name IN ['AFRICA DRIVE (SOUTHAMPTON) LIMITED', 'AIS (MARINE) 2 LIMITED', 'AIS (MARINE) 3 PLC']
CALL apoc.path.expandConfig(c,{maxLevel:4, relationshipFilter:'CONCERNS|HAS_SURNAME|HAS_FORNAME', labelFilter: '/Surname|/ForeNames', uniqueness:'NODE_GLOBAL'}) YIELD path
WITH path AS path1
RETURN path1
LIMIT 100
05-23-2019 11:20 PM
Hey Mike,
Please try with below query and let us know it solves your query or not
MATCH (c:Company)
WHERE c.name IN ['AFRICA DRIVE (SOUTHAMPTON) LIMITED', 'AIS (MARINE) 2 LIMITED', 'AIS (MARINE) 3 PLC']
CALL apoc.path.expandConfig(c,{maxLevel:4, relationshipFilter:'CONCERNS|HAS_SURNAME|HAS_FORNAME', labelFilter: '/Surname|/ForeNames', uniqueness:'NODE_GLOBAL'}) YIELD path
WITH path AS path1
RETURN path1
LIMIT 100
05-24-2019 12:41 AM
you are welcome mike
All the sessions of the conference are now available online