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.

A flaw of `call apoc.meta.data()` and the order of labels

Hello,
I found there is a flaw of apoc procedure call apoc.meta.data() .
I used the example dataset:
cineasts_12k_movies_50k_actors.tgz (14MB).
When I execute call apoc.meta.data(),


For the relationship "RATED", it only records one label "User".
Then when I execute match (x:User)-[r:RATED]->(y:Movie) where labels(x)=["User"] return r, the result is (no changes, no records).
Then I execute match (x:User)-[r:RATED]->(y:Movie) return labels(x),r, there are many results like:

labels(x) r
["Person", "User"] { "stars": 5 }

Hence, there are two labels of the source in the "RATED" relationship.

Then, I execute match (x:User)-[r:RATED]->(y:Movie) where labels(x)=["Person","User"] return r, the result is correct.
But when I execute match (x:User)-[r:RATED]->(y:Movie) where labels(x)=["User","Person"] return r, the result is (no changes, no records).

Hence, there are mainly two problems of my post:

  1. Why does call apoc.meta.data() procedure not provide full labels of the source in the relationship "RATED"?
  2. Is there any method to ignore the order of labels in the where clause?
    Thank you!
1 REPLY 1

What you call full labels is a combination of labels.

apoc.meta.data() only looks at individual labels.
We could add a column that lists "other labels", please raise a GH issue on the apoc repository.

Btw. you should use WHERE x:User for a faster query.