I am completely new to Neo4j. I am testing the graph database and I have the following simple graph test-structure: different labeled nodes with properties, which are connected.
All the nodes have a property, which is called access. It is a list of string elements such as:
{access: ['http', 'www']}
I'm searching for a solution, where I get all nodes from a starting node which are connected (doesn't matter which type or direction) and their relationship where an intersection on the access property of the nodes exists. I will start at a given node and compare the access property with the next connected node. Then, take the property of the second node and compare this access property with the nodes, which are connected to them. And so on. The goal should be all nodes and their connections, where an interesection on access property exists. On the concrete structure of the graph, for example, we start at the node ENC 2009 and should traverse all connected nodes until a node with no intersection on the access property is reached. For this example, the following goal should be reached: traversed graph
I tried the following cypher query, but it is not working fine on each node as starting node.
MATCH (n:CONFERENCE_SERIE) WHERE n.full_name =~ 'mex.*'
MATCH p = n-[*]-m WHERE FILTER(x IN n.access WHERE x IN m.access)
RETURN p
Is there a solution, with the java traversal framework or with cypher, to reach the goal and to get the path of such an graph?
Thanks in advance for your help.
access
property in common? Or do you look for an intersection at each individual step, i.e. the first and last node do not need an intersection? Does the size of the intersection matter? – Martin Preusse