Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
09-09-2020 07:58 PM
Let's say there are graphs A and B made by A', C' and B', C'. Then They could be both matched with a graph C made by C' and X' (a graph regular expression sort?).
09-09-2020 07:59 PM
09-10-2020 05:54 PM
It's not entirely clear what part or parts of the property graph you are referring to. Is this about how nodes of labels can be matched? Or entire subgraphs? It would help if you used the language of property graphs for this, or provided some example pseudo-cypher, or used some example visuals which use property graph elements.
09-11-2020 09:33 PM
Let's say each node has a number, if two nodes have the same number they could match.
But some nodes would contain a set of numbers and it could match nodes who contain a subset.
09-12-2020 12:05 PM
You can try something like this:
merge (a:A1 {prop: [1,2,3,4]})
merge (b:B1 {prop: [1,2,3,5,6]})
match (a:A1)
match (b:B1)
RETURN apoc.coll.intersection(a.prop, b.prop)
Result:
[1, 2, 3]
Use your logic to create relationships
09-12-2020 04:17 PM
CREATE (c:typeA{value:3})<-[:sp]-(a :typeA{value:1})-[:sp]->(b :typeA{value:2})-[:sp]->(c)-[:sp]->(d:typeB {value:[4,5]})
CREATE (c1:typeA{value:3})<-[:sp]-(a1 :typeA{value:1})-[:sp]->(b1 :typeA{value:2})-[:sp]->(c1)-[:sp]->(d1:typeB {value:4})
CREATE (c2:typeA{value:3})<-[:sp]-(a2 :typeA{value:1})-[:sp]->(b2 :typeA{value:2})-[:sp]->(c2)-[:sp]->(d2:typeB {value:5})
The graph looks like the above when created with cypher.
09-12-2020 11:14 PM
Looking at this:
CREATE (c:typeA{value:3})<-[:sp]-(a :typeA{value:1})-[:sp]->(b :typeA{value:2})-[:sp]->(c)-[:sp]->(d:typeB {value:[4,5]})
The datatype of property value is string in node 'typeA' and in 'typeB' it is an array. We cannot compare two different data types. One suggestions is to make all datatypes of property 'value' to be array
Here is the modified query:
CREATE (c:typeA{value:[3]})<-[:sp]-(a :typeA{value:[1]})-[:sp]->(b :typeA{value:[2]})-[:sp]->(c)-[:sp]->(d:typeB {value:[4,5]})
This will not fetch any result when you use the function apoc.coll.intersection() because there is nothing common between typeA node and typeB node.
All the sessions of the conference are now available online