Appending graphs and attributes

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
MT_OMH
Posts:4
Joined:04 Aug 2014 14:28
[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
Appending graphs and attributes

Post by MT_OMH » 26 Mar 2015 01:44

I know it is possible to append a second graph to a first graph.
1st question: Is it possible to merge the attributes of the nodes and edges to the attributes of the first existing graph?

For example:
graph 1:
"Node A" has attribute X=12, Y=4
"Node B" has attribute X=1, Y=2
"Edge AB" has attribute E=1.02

graph2:
"Node A" has attribute X=4, Y=16
"Node B" has attribute X=1, Y=2
"Edge AB" has attribute E=1
"Edge BA" has attribute E=1

Merged graph has to be: (all nodes and edges, sum of attribute values)
"Node A" has attribute X=16, Y=20
"Node B" has attribute X=2, Y=4
"Edge AB" has attribute E=2.02
"Edge BA" has attribute E=1

2nd question: Is it possible to do this for 100 graphs?


Thanks in advance!

User avatar
seinecle
Gephi Community Support
Posts:546
Joined:08 Feb 2010 16:55
Location:Lyon, France
Contact:

Re: Appending graphs and attributes

Post by seinecle » 27 Mar 2015 06:02

Hi,
What you could do is:
- change the name of the attribute X in he second graph.
- append this second graph to the first one.
- use the merge attributes functionalities to merge your att X with the att you had renamed.

This said,
- this is the kind of operation that you'd rather do in a spreadsheet before importing to Gephi (or after exporting a graph from Gephi, before reimporting).
- this cannot be automatized with the desktop version of Gephi. you'd neee to use programming for that (possibly using the Gephi toolkit if it helps)

Best,
Clement

MT_OMH
Posts:4
Joined:04 Aug 2014 14:28
[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: Appending graphs and attributes

Post by MT_OMH » 30 Mar 2015 10:36

Hi!
Thanks for the information.
I fixed the problem by combining the attributes using python before importing in Gephi.

Best regards!

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