To test whether a Relationship has one or another label has two possible solutions:
MATCH(n)-[r:ACTED|DIRECTED]-(m)
RETURN count(r)
and
MATCH(n)-[r]-(m)
WHERE r:ACTED_IN OR r:DIRECTED
RETURN count(r)
But to test whether a Node has one or the other label has only one solution:
MATCH(n)
WHERE n:Movie OR n:Person
RETURN count(n)
This doesn't work. Why not?
MATCH(n:Movie|Person)
RETURN count(n)
It returns an error:
Invalid input '|': expected ")", "{" or "$" (line 1, column 14 (offset: 13))
"MATCH(n:Movie|Person)"
(Neo4J 4.2.1)