I have written the below query but if I write this I am not getting the Capacity Node. I want to expand the node connected to the Production Node.
match p=(:WIPCapacity)-[:throughput]->(d:WIPProduction)-[r4:transport]->(e:WIPStorage)-[r5:transport]->(f:WIPStorage)-[r7:transport]->(h:Production)-[r8:transport]->(i:Storage)-[r9:transport]->(j:Storage)-[r10:transport]->(k:Storage)
return p;
Please let me know if you can suggest how to write the cypher query to get the full path.
Try this:
MATCH (a:WIPCapacity)
//Add this to select a specific node.....
//WHERE a.name = "CAP1"
//End....
CALL apoc.path.spanningTree(a, {}) YIELD path
return path
Thanks
This works and it gives me the full path, but if I know the name of Capacity Node, and want to return the Node WIP Capacity which is connected to that so for this I tried something similar like you did using apoc.
I tried this, but its not returning the WIPCapacity, its giving Capacity Node only in output:
Thank You for the explanation, I am also getting this correct till here but instead of this full path that we get in result can I just get the CAP1 node and its properties ?
Is there a way to put where condition, as my main goal is to check the properties of CAP1 and CAP2 which are on the same path, and compare the value of a particular property, then return the node where the value of a particular property( Required_Capacity) is greater.
MATCH (p {name: "CAP2"})
CALL apoc.path.subgraphNodes(p, {
relationshipFilter: "<transport|throughput",
minLevel: 0,
maxLevel: 8
})
YIELD node
where node.Available_Capacity<node.Required_Capacity
return node.name, node.Required_Capacity-node.Available_Capacity as d order by d desc;
I tried this putting where condition and returning the desired propeties and this seems to give me the correct output.
I hope this implementation is correct and we can add further steps if required in this query.