How to preserve both sets of node attributes when merging nodes?

Get help with your data
Post Reply [phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable
mbrowning
Posts:8
Joined:05 Mar 2018 17:21
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable
How to preserve both sets of node attributes when merging nodes?

Post by mbrowning » 05 Mar 2018 17:30

I am having a problem with duplicate nodes that aren't technically duplicates, because their attributes are different.

For example, my node attributes are Label, DOB, Item Numbers. Node 1 and Node 2 have identical labels, but different Item Numbers. I want to concatenate the item numbers when I merge the nodes, so no information is lost:

Label DOB Item Numbers

Micaela 4/2/85 B, C, F
Micaela 4/2/85 Q, D

Ideal result:

Label DOB Item Numbers

Micaela 4/2/85 B, C, F, Q, D



Is this possible?

User avatar
eduramiba
Gephi Code Manager
Posts:1064
Joined:22 Mar 2010 15:30
Location:Madrid, Spain
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable

Re: How to preserve both sets of node attributes when merging nodes?

Post by eduramiba » 05 Mar 2018 17:52

Not possible to merge sets at the moment, sorry.

mbrowning
Posts:8
Joined:05 Mar 2018 17:21
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable

Re: How to preserve both sets of node attributes when merging nodes?

Post by mbrowning » 05 Mar 2018 18:16

It seems like the "join values with a separator" option does what I need, thank you.

When I do this, though, I notice that not all of the edges are preserved. If I merge three duplicate nodes, ideally, all those edges remain after the merge. Right now, it seems only the edges of one of the duplicates remain after the merge.

Am I missing something here?

User avatar
eduramiba
Gephi Code Manager
Posts:1064
Joined:22 Mar 2010 15:30
Location:Madrid, Spain
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable

Re: How to preserve both sets of node attributes when merging nodes?

Post by eduramiba » 05 Mar 2018 18:29

Hi,
Actually join with separator will add all values, but if they are repeated in several lists, it will have duplicates.

All edges should be preserved, but if some become duplicated, I think their weights are summed. Can you post an example?

mbrowning
Posts:8
Joined:05 Mar 2018 17:21
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable

Re: How to preserve both sets of node attributes when merging nodes?

Post by mbrowning » 05 Mar 2018 19:31

I think I figured it out, thank you! I had my id column labeled as something else, so an id column was created on importing the edges file, messing up the source and target IDs.

Post Reply
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable