How to Merge Datasets

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
Moe Overload
Posts:2
Joined:25 Aug 2017 05:38
[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 Merge Datasets

Post by Moe Overload » 25 Aug 2017 05:57

Hi all. I hope someone can tell me what the best way to merge multiple datasets is, when there's some overlap between the data.

I'm working with multiple DAGs (Directed Acyclic Graphs) from several data sources. I have to get the data manually, so I've been making the graphs by hand. However, the same node can appear in multiple data sources (accounting for different types of dependencies between the nodes).

What would make my life much easier is to create the graphs from each data source individually, give duplicate nodes a shared label to let gephi know to merge the nodes and use the edges that both nodes had.


A very simple example:
Data 1:
1->3
2->3

Data 2:
a->b

Shared nodes:
a=1
b=2

Merged result:
1->2
1->3
2->3


The only idea I've had come to mind (aside from doing it all by hand), is to export all my graphs to a file, concatenate them, manually combine nodes and fix their edges, the reimport to Gephi. However, I'd like to automate that process somehow as I'm sure it'll be very dull and repetitive (and likely to introduce errors).

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 Merge Datasets

Post by eduramiba » 25 Aug 2017 12:17

Hi,
This is easier in 0.9.2 Please download latest snapshot (pre-release) from https://github.com/gephi/gephi/#nightly-builds and follow these steps:

1. Import the desired files
2. During import report, select the 'Append to workspace' option instead of creating a new workspace

Moe Overload
Posts:2
Joined:25 Aug 2017 05:38
[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 Merge Datasets

Post by Moe Overload » 26 Aug 2017 08:11

Thanks. Haven't had a chance to try it yet, but I'm worried that while this will merge the datasets, it won't merge shared nodes across the various datasets.

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 Merge Datasets

Post by eduramiba » 27 Aug 2017 17:50

Hi,
It should merge nodes based on their ids correctly.

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