cancel
Showing results for 
Search instead for 
Did you mean: 

Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.

Best practices for importing multiple xml files

Newbie here. I need to import multiple xml files into Neo4j. Each file represents an entity, let's call it a Thing. The outer element is Things, so each file looks approximately like

<Things>
  <Thing ....>
    ...
  </Thing>
</Things>

I can import one in the Neo4J browser using apoc.import.xml and get a reasonable looking graph.

Just not sure how to add a second (and subsequent) xml to the graph, nor how to do it in scala/java, which is where we want to get to.

Any help appreciated.

5 REPLIES 5

I am facing similar situation, were you able to solve import of multiple xml?

Hello Paritosh

I assume that you know the scema for your xml markup.Then it is a better idea to write your own parsing and loading procedures and install them as a library on your production installation.
This library should be tailored as per your project needs/requirements.

Many thanks
Mr G Sameer Sudhir

Thank you for response.
Currently, working on cypher using FOREACH and SET.
As suggested for library, I am tinkering to use Spring and OGN framework and handle through Java.
is this right approach?

Looks good.Please let me know once you are done with your modular proc.
Many thanks
Mr Sameer Sudhir Gijare

onlyrey
Node Link

Hi please let me know if you can share the code. I will be starting something similar soon. Is there some example of cycling through a directory full of files to import in the examples? My issue is that I have so many that if things break midway I'd like to restart where I left (parsing through the multiple XML files in a directory in my case).