Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
05-18-2022 09:56 PM
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
05-19-2022 01:41 AM
Hi @saisannihith7419 !
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
05-19-2022 02:27 AM
thank you wil try and update
05-19-2022 05:50 AM
Thanks for the query but I need the flow to start from Vendor Ends at Customer .
vendor-->MatplantS(can be mutliple matplants) ----->Customer
05-23-2022 08:08 AM
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
05-23-2022 08:38 AM
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
05-23-2022 08:42 AM
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
05-23-2022 08:42 AM
And Also my data is having a large graph depth its a big data please consider that also.
All the sessions of the conference are now available online