Failed import graphml due to 'nan' input string
I have been using the following command to import .graphml files in to neo4j
CALL apoc.import.graphml("test.graphml", {readLabels: true, storeNodeIds:true})
Recently I began working with larger files (3GB) derived from larger data tables and started getting this error when trying to import.
Failed to invoke procedure `apoc.import.graphml`: Caused by: java.lang.NumberFormatException: For input string: "nan"
Yes there are <data key=xxx > nan</data> entries in the graphml b/c it was derived from a table with NaN values. Is there a workaround? Note that the import will work if I replace all the nan with no character i.e. <data></data> but that seems an unecessary hack.
I'm am working on creating a small data set but my workflow is:
- Import tabular data from postgres db
- Create a graph using
pandasandnetworkx(incl. creating a proper 'labels' as a node attribute) - From networkx export a
.graphml - Import
.graphmlin to neo4j with command indicated at beginning
Screenshots
Versions
- OS: Mac Pro M1 w/ Ventrua 13.3.1 (a)
- Neo4j: 4.4.o (community)
- Neo4j-Apoc: 4.4.0.1
Hi, thank you writing in :) I will ticket this, however, we currently have APOC under maintenance mode so cannot say when this would be possible for us to put in, feel free to make a PR yourself for us to review if you want it done faster! Thanks
I'm showing my ignorance but what is 'maintenance mode'? Just curious.
So we are focusing on only fixing bugs and security issues and not adding new functionality atm :)
Cardified. Closing here.