neo4j / apoc

Apache License 2.0
95 stars 28 forks source link

apoc.meta.graph does not display ALL relationships #130

Closed neo-technology-build-agent closed 1 year ago

neo-technology-build-agent commented 2 years ago

Issue by adriens Tuesday Aug 14, 2018 at 10:51 GMT Originally opened as https://github.com/neo4j-contrib/neo4j-apoc-procedures/issues/884


Runtime Configuration :

2018-08-14 21_49_50-neo4j desktop - 1 1 8

2018-08-14 21_50_29-neo4j desktop - 1 1 8

Description

i have a graph datbase with the following nodes and relationships (please note the relation between a column and a view):

2018-08-14 21_42_53-neo4j bolt___localhost_7687 - neo4j browser

but when i ask to apoc to show me the graph structure, i'm missing the relations between column->view

2018-08-14 21_41_47-neo4j bolt___localhost_7687 - neo4j browser

I wonder how is this possible ?...in the documentation it is said that this procedure does not sample datas, but it looks like all nodes have not been parsed.

neo-technology-build-agent commented 2 years ago

Comment by adriens Tuesday Aug 14, 2018 at 10:54 GMT


But db.schema seems to do the job :

2018-08-14 21_53_00-neo4j bolt___localhost_7687 - neo4j browser

neo-technology-build-agent commented 2 years ago

Comment by jexp Tuesday Aug 14, 2018 at 11:10 GMT


Thanks for reporting. The problem is that the db-statistics only store half of the relationship information (only one label) so db.schema reports often false positives.

apoc.meta.graph samples a subset of the graph to confirm those relationships. In your case it seems that those (:Column)-[:COLUMN_OF]->() that were sampled didn't include (:View) and the views also didn't include those columns.

I'll check if there is an omission in the implementation.

neo-technology-build-agent commented 2 years ago

Comment by adriens Tuesday Aug 14, 2018 at 11:22 GMT


Yes, it looks somehting like that...as to feed the graph, i first load column->tables then column-> views...

i do this in a sequential way. So the sample does maybe stop after a certain range, after the first load.

neo-technology-build-agent commented 2 years ago

Comment by adriens Tuesday Aug 14, 2018 at 11:22 GMT


...hence causin the second sample to be skipped...

neo-technology-build-agent commented 2 years ago

Comment by adriens Wednesday Aug 15, 2018 at 00:18 GMT


I've added new kind of nodes and it seems like having added this has changed the sample used , now

db.schema and call apoc.meta.graph() give the same output, see below the correct relationships getting out of Column :

2018-08-15 11_15_27-neo4j bolt___localhost_7687 - neo4j browser

2018-08-15 11_15_06-neo4j bolt___localhost_7687 - neo4j browser

gem-neo4j commented 1 year ago

We have recently released (4.4.0.14 and 5.5.0) fixes for these procedures that apply fixes to the sampling. I cannot reproduce this issue, so will close this issue as assumed fixed. If you come across it in those or future builds feel free to reopen and supply a reproducible case :) Thank you!