Gephi database import error

101 views
Skip to first unread message

Alan Pereyra

unread,
Jan 2, 2014, 2:54:49 PM1/2/14
to ne...@googlegroups.com
While attempting to import a database from Neo4j to Gephi, I get the following error:

Exception in thread "main" java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Long
at org.gephi.neo4j.plugin.impl.Neo4jDelegateProviderImpl.getNodeAttributeValue(Neo4jDelegateProviderImpl.java:37)
at org.gephi.data.attributes.AttributeValueImpl.getValue(AttributeValueImpl.java:81)
at org.gephi.data.attributes.AttributeValueImpl.equals(AttributeValueImpl.java:103)
at org.gephi.data.attributes.AttributeRowImpl.setValue(AttributeRowImpl.java:153)
at org.gephi.data.attributes.AttributeRowImpl.setValue(AttributeRowImpl.java:141)
at org.gephi.data.attributes.AttributeRowImpl.setValue(AttributeRowImpl.java:128)
at org.gephi.data.attributes.AttributeRowImpl.setValue(AttributeRowImpl.java:110)
at org.gephi.neo4j.plugin.impl.GraphModelImportConverter.fillGephiNodeDataWithNeoNodeData(GraphModelImportConverter.java:160)
at org.gephi.neo4j.plugin.impl.GraphModelImportConverter.createGephiNodeFromNeoNode(GraphModelImportConverter.java:135)
at org.gephi.neo4j.plugin.impl.Neo4jImporterImpl.processNode(Neo4jImporterImpl.java:181)
at org.gephi.neo4j.plugin.impl.Neo4jImporterImpl.importNodes(Neo4jImporterImpl.java:175)
at org.gephi.neo4j.plugin.impl.Neo4jImporterImpl.importGraph(Neo4jImporterImpl.java:159)
at org.gephi.neo4j.plugin.impl.Neo4jImporterImpl.doImport(Neo4jImporterImpl.java:137)
at org.gephi.neo4j.plugin.impl.Neo4jImporterImpl.importDatabase(Neo4jImporterImpl.java:131)
at org.gephi.neo4j.plugin.impl.Neo4jImporterImpl.importDatabase(Neo4jImporterImpl.java:91)
at main.algo(main.java:62)
at main.main(main.java:42)

My source: 

              graphDb = new EmbeddedGraphDatabase (DB_PATH);
     owned_addresses = graphDb.index().forNodes("nodes");
     final long ownerId = 1;
 
     // Import by traversing the entire ownership network along the "transfers" edges
     System.out.println("Importing Ownership Network from Neo4j Database...");
     final Collection<RelationshipDescription> relationshipDescription = new ArrayList<RelationshipDescription>();
     relationshipDescription.add(new RelationshipDescription(RelTypes.KNOWS, Direction.BOTH));
     //relationshipDescription.add(new RelationshipDescription(GraphBuilder.OwnerRelTypes.transfers, Direction.BOTH));
     final Neo4jImporter importer = new Neo4jImporterImpl();      
 
     // Load the graph in memory
     importer.importDatabase(graphDb, ownerId, TraversalOrder.BREADTH_FIRST, Integer.MAX_VALUE, relationshipDescription); 
     // Grab the graph that was loaded from the importer      
     final ProjectController projectController = Lookup.getDefault().lookup(ProjectController.class);
     final Workspace workspace = projectController.getCurrentWorkspace();
     final GraphModel graph = Lookup.getDefault().lookup(GraphController.class).getModel(workspace);   
     System.out.println("Graph Imported.  Nodes: " + graph.getDirectedGraph().getNodeCount() + "Edges: " + graph.getDirectedGraph().getEdgeCount());
 
     // Layout
     final ForceAtlas2 layout = new ForceAtlas2(new ForceAtlas2Builder());
     layout.setGraphModel(graph);

The data base was generated as follows:


                graphDb = new EmbeddedGraphDatabase(DB_PATH);
Transaction tx = graphDb.beginTx();
try { 
       myFirstNode = graphDb.createNode();
       myFirstNode.setProperty("name", "Hellooo");
       mySecondNode = graphDb.createNode();
       mySecondNode.setProperty("name", "Hellooo2");
       
       myRelationship = myFirstNode.createRelationshipTo(mySecondNode, RelTypes.KNOWS);
       myRelationship.setProperty("relationship-type", "knows");
       myString =  myFirstNode.getProperty("name").toString() + " "+ myRelationship.getProperty("relationship-type").toString()+" "+                                     mySecondNode.getProperty("name").toString();
       System.out.println(myString);
       tx.success(); 
 } finally { 
        tx.finish(); 
 }

Thank you!
Alan.

Patrick Ian

unread,
Jan 4, 2014, 7:51:54 PM1/4/14
to ne...@googlegroups.com
I'm getting the same error! The github tickets are closed: https://github.com/gephi/gephi/issues/740

But this is clearly still a problem with the latest plugin. Are these plugins still being maintained?

Michael Hunger

unread,
Jan 4, 2014, 8:34:50 PM1/4/14
to ne...@googlegroups.com
We tried to. But got no support from the gephi people merging our changes into their master / deployment.


--
You received this message because you are subscribed to the Google Groups "Neo4j" group.
To unsubscribe from this group and stop receiving emails from it, send an email to neo4j+un...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Message has been deleted

Patrick Ian

unread,
Jan 6, 2014, 1:39:57 PM1/6/14
to ne...@googlegroups.com
I tried downloading the attached attributes nbm file that supposedly fixed it -- are these the changes you were trying to push? Is there somewhere I can download the working source tree?
Reply all
Reply to author
Forward
0 new messages