cancel
Showing results for 
Search instead for 
Did you mean: 

Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.

apoc.path.subgraphAll: Retrieve also non required Relationship

rinaldo_bonazzo
Node Clone

The following query 

MATCH (f:Company {companyId:998})
CALL apoc.path.subgraphAll(f, {
relationshipFilter: "INVOICE",
minLevel: 1,
maxLevel: 6 })
YIELD nodes, relationships
RETURN nodes, relationships;
 
Return not only the relationship INVOICE but also the other relationship (SummaryInvoice, invoicePaid, invoiceUnpaid). How can I solve this problem?
Attached the Screenshot 

I have the same problem in Bloom
 
Thanks for your help 
Rinaldo 
 
1 ACCEPTED SOLUTION

Keep in mind not all data is being displayed since you have a lot of it. Note the 'note' on the side stating only the first 300 are being shown, so maybe one end of some to the relationships are not displayed, so their relationship would not be displayed.  I suggest you review the results in the text or table format to verify it is as you expect. 

View solution in original post

7 REPLIES 7

This may be a result of the browser showing all relationships between displayed nodes, regardless if they are in the result. The is a configuration in browser to toggle this behavior off.  Try that and see if you get the results you expected. See the screenshot below that shows the checkbox ("Connect result nodes") to disable the behavior.

Screen Shot 2023-01-17 at 10.57.19 AM.png

Do you see the other relationships in the output when you view the results by 'table' or 'view' formats? 

Hi in 'table' format only 'INVOICE' type is present

Hi thank you for the answer

try and all the relationships disappear, not what I expect

That is not the behavior I am seeing when I experiment.  With the checkbox deselected, I see just the result nodes and relationships returned and they are connected. 

Can you provide some of the results? 

Result are


Keep in mind not all data is being displayed since you have a lot of it. Note the 'note' on the side stating only the first 300 are being shown, so maybe one end of some to the relationships are not displayed, so their relationship would not be displayed.  I suggest you review the results in the text or table format to verify it is as you expect.