Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Import RDF (XML or Turtle) into Neo4j

Tags:

rdf

neo4j

jena

i downloaded the Database dump of Freebase. The format of the file is rdf turtle. I need to get all the data into the neo4j database.

I already wrote an importer with help of tinkerpop.blueprints. First it seemed to work but after 30 minutes of importing an exception occured because the rdf file contained characters at positions where they are not allowed to be. A little bit later (after some investigation) i found out that the jena parser i used (RDFReader) is deprecated and shouldnt be used.

What i need to know now:

Is there any way to import that rdf file into neo4j? Jena is able to transform the data into seven different file formats: .ttl, .rdf, .ne, .jsonld, .owl, .trig, .nq.

Is there an importer for one (or more) of these file formats?

like image 456
Mulgard Avatar asked Dec 06 '22 04:12

Mulgard


1 Answers

There is a plugin that allows you to import RDF-Data into Neo4j. You simply put the semantics.liteOntoImport.jar-File into your plugin folder and in Neo4j command line you call:

CALL semantics.liteOntoImport('file:///filename.owl','RDF/XML')

Therefore your file should be in the import directory of Neo4j. If it is not you should enter the full path.

EDIT

Same procedure works for .xml and .ttl files, just change the type of the file in the command line (second argument) e.g. 'TURTLE'.

like image 167
Grapheneer Avatar answered Dec 30 '22 11:12

Grapheneer