apoc icon indicating copy to clipboard operation
apoc copied to clipboard

Failed import graphml due to 'nan' input string

Open MikeB2019x opened this issue 2 years ago • 3 comments

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:

  1. Import tabular data from postgres db
  2. Create a graph using pandas and networkx (incl. creating a proper 'labels' as a node attribute)
  3. From networkx export a .graphml
  4. Import .graphml in to neo4j with command indicated at beginning

Screenshots

image

Versions

  • OS: Mac Pro M1 w/ Ventrua 13.3.1 (a)
  • Neo4j: 4.4.o (community)
  • Neo4j-Apoc: 4.4.0.1

MikeB2019x avatar Jun 24 '23 02:06 MikeB2019x

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

gem-neo4j avatar Jun 27 '23 07:06 gem-neo4j

I'm showing my ignorance but what is 'maintenance mode'? Just curious.

MikeB2019x avatar Jun 27 '23 12:06 MikeB2019x

So we are focusing on only fixing bugs and security issues and not adding new functionality atm :)

gem-neo4j avatar Jun 28 '23 06:06 gem-neo4j

Cardified. Closing here.

hvub avatar Dec 17 '24 21:12 hvub