Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
03-08-2020 12:28 AM
Hello !
I am trying to create a new database that will contain how similar certain things are.
It seems that around 25- 30% of my nodes will be 100% similar.
So I was wondering whether it would be more efficient performance wise to instead group them to single nodes. For example, instead of having 50 - 100 nodes of 100% similarity have 1 node that has all of the 100% similar objects as properties values.
Solved! Go to Solution.
03-15-2020 11:53 AM
Q: Can I search nodes and ask for all object with a certain origin if they are in a list inside a property ?
A: Yes you can search. Here is an example:
Created two nodes:
merge (c:Test {val: ["red", "blue"]})
merge (d:Test {val: ["white", "red", "green"]})
Search for "green":
match (c:Test) where "green" in c.val return c
result: returns the second node with "green" only.
The above query returns all nodes that contain "green" in their property list.
03-08-2020 07:53 PM
If these nodes have similar properties and **they possess same label ** then logically they are same .
There is no reason to not merging them
03-08-2020 08:24 PM
Did you create the database already or are you planning to create a new database? Depending on that I can suggest ways to address this situation.Let mew know.
03-09-2020 02:29 AM
I am creating a new database.
The object itself is the same however I need to make note of the origin of the object.
This is the value I thought I could just add as a property.
However, this will mean I will have a list in the "origin" property. Will this still be ok ?
Can I search nodes and ask for all object with a certain origin if they are in a list inside a property ?
03-14-2020 09:05 AM
Not able to understand your requirement. Kindly explain so that we can help you
03-15-2020 11:53 AM
Q: Can I search nodes and ask for all object with a certain origin if they are in a list inside a property ?
A: Yes you can search. Here is an example:
Created two nodes:
merge (c:Test {val: ["red", "blue"]})
merge (d:Test {val: ["white", "red", "green"]})
Search for "green":
match (c:Test) where "green" in c.val return c
result: returns the second node with "green" only.
The above query returns all nodes that contain "green" in their property list.
03-16-2020 03:16 AM
I believe this solves the main question I had.
I had another question related to this then.
WIll this query work for nodes who are not "combined" ?
will it return nodes that have a single value in val as well ?
I believe it will but having an answer here will simply calm me a bit ^^
Thank you very much 🙂 !
03-16-2020 09:34 AM
Yes, it will work. No worries!
Added another node to the previous two nodes:
merge (new:Test {val: "green"})
Ran this query:
match (c:Test) where "green" in c.val return c
result: two nodes -(new) and (d)
03-17-2020 02:56 AM
Thank you very much this is excellent news !
All the sessions of the conference are now available online