Why does Gephi map Neo4j reference node id 0 to 1

Once it's running
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
KungFoo
Posts:2
Joined:22 Nov 2011 14:10
[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
Why does Gephi map Neo4j reference node id 0 to 1

Post by KungFoo » 22 Nov 2011 14:16

I'm using gephi to visualize my graphs out of neo4j.

I'm using this java snippet to traverse all the nodes in DFS order and print out the node IDs.

Code: Select all

Traverser dfs = node.traverse(Order.DEPTH_FIRST, StopEvaluator.END_OF_GRAPH,
                                    ReturnableEvaluator.ALL,
                                    MyRelationshipTypes.D, Direction.BOTH);

for( Node n : dfs ) {
        System.out.print( n.getId() );
        printNodeProperties( n );
}
Let's say my graph has 221 nodes in Neo4j from node ID 1 to 222 (since 0 is the reference node).

When I look at the Gephi DataLaboratory I see node IDs 2 to 223 as my graph. Gephi seems to map the reference node ID 0 (Neo4j) to ID 1 (Gephi). Can I prevent this? Why does Gephi do this?

Payne
Gephi Plugin Developer
Posts:22
Joined:28 Feb 2010 19:07
[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: Why does Gephi map Neo4j reference node id 0 to 1

Post by Payne » 23 Nov 2011 08:53

Hi,

the IDs in Gephi are in fact Gephi IDs, not Neo4j (when you are looking at ID column). There should be a Neo4j_Id column which contains the real Neo4j id.

Mapping it directly would not be good idea, there were reasons why the IDs are not the same.

KungFoo
Posts:2
Joined:22 Nov 2011 14:10
[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: Why does Gephi map Neo4j reference node id 0 to 1

Post by KungFoo » 23 Nov 2011 10:44

Hmm I had a look at gephi again. I can't find any column "Neo4j_Id". Do I have to set some option to display it can you show me where this column should be?

peterneubauer
Posts:1
Joined:23 Nov 2011 11: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: Why does Gephi map Neo4j reference node id 0 to 1

Post by peterneubauer » 23 Nov 2011 11:27

Mmh, this sounds like a bug to me, maybe raise an issue at https://github.com/gephi/gephi-plugins/issues ?

Payne
Gephi Plugin Developer
Posts:22
Joined:28 Feb 2010 19:07
[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: Why does Gephi map Neo4j reference node id 0 to 1

Post by Payne » 23 Nov 2011 18:54

It needs further investigation, and now I am at one conference with notebook where I do not have Gephi set up. Will look at it at weekend...

Anyway, thanks for reporting...

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