Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
03-03-2020 12:41 AM
I HAVE ONE RELATIONSHIP
(p)-[s:Rel_A]->(c) and another RELATIONSHIP (p)-[s:Rel_B]->(b)
how will i combine this relationship? AND create one
03-03-2020 01:03 AM
Hi kanthalepriyanka,
since your first relationship is going to a node "c" and your second is going to a different node "b", how do you want to "combine" the relationships? Do you also want to merge the nodes and then only have one relationship? A single relationship cannot connect three different nodes...
Please specify, which end result you want to achieve.
Regards,
Elena
03-03-2020 01:05 AM
is it possible to combine node p and then from p create relationship for node c and b?
03-03-2020 01:15 AM
Yes, of course. Where does your data come from? If you load e.g. all nodes first from a csv and then want to load the relationships, you can "match" for node p and node b, and then for node p and node c and create your relationships and then you will only have one node "p". However, without knowing where this all comes from, it is difficult to advise. Maybe this entry might also help you if you only have one file for nodes and relationships: How to create a relation from two columns in one table?
03-03-2020 01:20 AM
YES but how will i able to combine relationship
i want p node and want to generate c and b from p in one relationship
03-03-2020 01:31 AM
Can you draw up an example of what you want? As far as I understand, you want to end up with:
Is that correct or is that wrong?
You can never have three nodes connected by one relationship.
03-03-2020 01:40 AM
yes i want the same .So what alternate thing we can do ?
03-03-2020 01:56 AM
As I said before, I would need a little example from you in terms of a graph or a csv to help you further because I am not sure what the problem actually is. Is it a code problem? Is it a loading problem? Is it a modelling problem?
03-03-2020 02:01 AM
MATCH p=(g:first)-[r:one_to_two]-(g1:second)-[part:two_to_three]-(re:third)-[regu:three_to_four]-(h:fourth)
RETURN p
MATCH p=(re:third)-[regy:three_to_five]-(d:fifth)
NOW what i want is three_to_four and three_to_fifth combined
and for both starting point is three
03-03-2020 02:17 AM
So, if I understand it correctly, you situation is the following:
And you do not want to have the node "3" twice, but only once. What you can do is:
MATCH (re:third)-[regu]->(h:fourth), (re1:third)-[regy]->(d:fifth)
CREATE (re)-[edgeNew:three_to_five]->(d)
SET edgeNew = regy
DETACH DELETE re1
Then you end up with
03-03-2020 02:37 AM
yes this will work. BUT y does java heap error occures
03-08-2020 08:26 PM
Reason of heap memory error is -> There is Cartesian Product in the query and you might not have enough memory
03-15-2020 10:54 PM
can we extend the memory ?
03-15-2020 11:08 PM
It depends on How much feee memory u have in your system? How much is the data size? If both are enough to run the query then you might need to update the Neo4j configuration file
03-15-2020 11:33 PM
OK ! i will update the neo4j configuration file
03-15-2020 11:46 PM
Merely updating config file will not help if you do not have sufficient free memory available
03-03-2020 07:52 AM
I do not have a heap error occuring. So, I can't say why it occurs for you...
All the sessions of the conference are now available online