Running the following query on the mini movie graph which comes with Neo4j throws 12 results, which is in fact wrong:
MATCH (actor:Person{name:"Tom Hanks"})-[role:ACTED_IN]->(movie) return count(role) as roles
There are indeed 12 relationships from "Tom Hanks" node to movie nodes, but the property role of the ACTED_IN relationship is actually an array, which can contain more then one value (an actor had more then one role in one movie).
So my question is how can I count all values from the role array as well to get the total number of roles actor have played?