i am tagging you the cypher query which i have been using to process the data
"MATCH p=(b:Vendor)-[*0..30]->(child)
where (child:MatPlant or child:Customer) and b.node_id="US1|0010764006"
and NONE( rel in relationships(p) WHERE type(rel)="VendorToVendorPurchaseOrder")
optional match (child)--(wc:WorkCenter)
return p
for this query there are data which are working that is only for small dataset but for large dataset if i use this query the neo4j broswer is not responding and couldnt able to get the graph could you guys help me in optimizing it or get the details for big data
Hi @saisannihith741 !
In order to improve performance you may need APOC.
Try something like
MATCH (b:Vendor {node_id : 'US1|0010764006'})
CALL apoc.path.subgraphNodes(b, {
relationshipFilter: "-VendorToVendorPurchaseOrder",
minLevel: 0,
maxLevel: 30,
labelFilter: 'MatPlant|Customer'
})
YIELD node
optional match p = (child)--(wc:WorkCenter)
return p
I change a bit the nature of p nont knowing why WorkCenter was not used. You can use spanningTree if you are bit more into paths from root.
Bennu
thank you wil try and update
Thanks for the query but I need the flow to start from Vendor Ends at Customer .
vendor-->MatplantS(can be mutliple matplants) ----->Customer
Have you tried something like?
MATCH (b:Vendor {node_id : 'US1|0010764006'})
CALL apoc.path.expandConfig(b, {
relationshipFilter: "-VendorToVendorPurchaseOrder",
minLevel: 0,
maxLevel: 30,
labelFilter: 'MatPlant|/Customer',
uniqueness : 'NODE_GLOBAL'
})
YIELD path
return path
Bennu
MATCH (p:Vendor {node_id: "US1|0430095406"})
MATCH (k:Customer)
WITH p,k
CALL apoc.path.spanningTree(p, {
relationshipFilter: "VendorToMatPlant|MfgMatPlant_To_MatPlant|TrfInterCommMatPlant_To_MatPlant|TrfSTOMatPlant_To_MatPlant|SalesMatPLant_To_Customer",
minLevel: 1,
maxLevel: 30,
endNode:k
})
YIELD path
RETURN path;
"This is spanning tree query which i have used
And Also my data is having a large graph depth its a big data please consider that also.
You are executing count(:Customer) queries here. If you now that your end node has a Customer label use the label filter property with /Customer. Take a look into the docs of Apoc.
Bennu