Hi all!
I have a problem in which I have to filter a relationship r by a property, let's say r.weight > 7. It will mostly result in a graph with unconnected subgraphs. So, I would like to also connect these subgraphs in the match by some other criter...
Hi all,
I came across a merge/group problem. I have to build a "supernode" from nodes sharing the same property. I've been trying to use apoc.refactor.mergeNodes to get the desired result with no luck.
I need to merge the nodes but also to sum up the...
Hi all,
I have a tree Neo4j structured with a specific type of relation. The leaves of this tree are connected with a relation of a different type(I know that because of that, it's not technically a tree anymore). I want to select some of those leave...
Hi all,
I'm struggling for days on a strategy for bulk creation of relationships on existing nodes. I have a set of nodes already in Neo4j and an external base of relationships in a dict (or dataframe):
{('A', 'B'): {
'sim1': 0.2943630213889271,
...
Hi all,
I'm struggling with APOC text functions to filter nodes by matching a string with a slice of a string in nodes' attributes.
In python, I can easily do that by treating strings as arrays:
test = "a test string"
'test' == test[2:6]
True
How ca...
Hi again @Bennu!
I've managed to solve the problem of duplicate nodes. It's a classic Neo4j cardinality issue.
MATCH(a:NODE)-[:CON]-()
with a, id(a) as IDa
MATCH(b:NODE {property:a.property})
WHERE id(b) > IDa
with a + collect(b) as nodes
CALL apoc.n...
Thanks again @Bennu!
I kinda understand your approach, however the collapsed nodes appear twice in the return.
Additionally, as I mentioned in the first post, I need to sum up the interger property of edges connecting the collapsed nodes with the oth...
Hi @Bennu ,
Thanks for the help.
In fact, I have to collapse several nodes with the same property. apoc.collapse can take an array of any size.
Now I'm stuck in how to "collect" one set of nodes with a matching a property and then collapse them.
Whe...
Bennu:
apoc.agg.maxItems(rel, rel.w) as r
Hello @Bennu !!
Thanks a lot. There is so much going on in your answer! I'm still figuring out all that new stuff!
Could you please clarify a couple of aspects of your answer?
The first one:
I didn't r...
Thanks for the help. I'm going to try your approach.
I thought that this kind of operation was not that difficult.
I really need the result to be virtual, as I'm not supposed to write in the db through a visualization application. Or, at least I have...