Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

apoc.meta.stats return false relationship count when having multi-labeled nodes #1910

Closed
tomasonjo opened this issue May 20, 2021 · 1 comment · Fixed by #2097
Closed

apoc.meta.stats return false relationship count when having multi-labeled nodes #1910

tomasonjo opened this issue May 20, 2021 · 1 comment · Fixed by #2097
Labels

Comments

@tomasonjo
Copy link
Contributor

If you have multi-labeled nodes in a graph, the apoc.meta.stats procedure return false information about relationship count.

Example dataset:

CREATE (:Node:Test)-[:REL]->(:Node)<-[:REL]-(:Node:Test)

We can then run the apoc.meta.stats procedure

call apoc.meta.stats YIELD relCount, relTypesCount, relTypeCount

The results are actually quite weird:

results_stats

I guess the global number of relCount is correct as it return a value of 2. The relTypesCount duplicates the relationship count when you are dealing with a multilabeled node. OTOH I don't really know what relTypeCount of 7 is really doing

@InverseFalcon
Copy link
Collaborator

InverseFalcon commented May 20, 2021

Thanks for reporting, we'll look into it.

In the meantime try using the counts in relTypes, though be aware that several of those are going to be referring to the same relationship, as it's looking for path matches considering varied labels on start and end nodes. You should at least see a "()-[:REL]->()": 2 entry.

Can you include the version(s) of Neo4j and apoc.meta.stats() you've observed this on? I can see some weirdness on Neo4j 4.2.5 and APOC 4.2.0.2 myself so far.

vga91 added a commit to vga91/neo4j-apoc-procedures that referenced this issue Jul 5, 2021
conker84 pushed a commit that referenced this issue Sep 10, 2021
Fixes #1910

Co-authored-by: Giuseppe Villani <giuseppe.villani@larus-ba.it>
conker84 pushed a commit that referenced this issue Sep 10, 2021
Fixes #1910

Co-authored-by: Giuseppe Villani <giuseppe.villani@larus-ba.it>
github-actions bot added a commit that referenced this issue Sep 10, 2021
Fixes #1910

Co-authored-by: Giuseppe Villani <giuseppe.villani@larus-ba.it>
conker84 pushed a commit that referenced this issue Sep 30, 2021
… (#2202)

Fixes #1910

Co-authored-by: Giuseppe Villani <giuseppe.villani@larus-ba.it>

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Giuseppe Villani <giuseppe.villani@larus-ba.it>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
2 participants