Import RDF (XML or Turtle) into Neo4j

前端 未结 3 1952
天涯浪人
天涯浪人 2020-12-15 14:27

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 wit

相关标签:
3条回答
  • 2020-12-15 15:01

    You can try the following in order to import database into neo4j.

    First convert your database into csv files and import it into Gephi - a graph visualization tool. Then by using the Gephi plugin for neo4j database support, you should be able to export your database (from Gephi) into neo4j format.

    Finally just copy the exported file into appropriate neo4j directory.

    For importing database into Gephi, you will need two csv files - one with all the nodes and other with all the relationships. Follow this tutorial : http://blog.neo4j.org/2013/01/fun-with-beer-and-graphs.html

    Get Gephi from here: https://gephi.org/

    Get the Plugin from here : https://marketplace.gephi.org/plugin/neo4j-graph-database-support/

    Hope this helps.

    0 讨论(0)
  • 2020-12-15 15:03

    If by importer you mean an executable to which you can pass an RDF file as a parameter, then no, as far as I know. You will have to write code, but probably not very much.

    Your best bet is probably to read the Neo4j Linked Data pages, specifically the blog posts by Michael Bach about importing Turtle Ontologies and Stefanie Wiegand about OWL in Neo4j.

    Since you mention Blueprints, you may want to look at using Sesame and Sail. You should be able to treat Neo4j as a triple store and achieve a convenient interface uniformity with your Freebase triple store. See dbpedia4neo for an example of how this is used for importing DBPedia dumps, your situation should be analogous.

    You indicate that you have trouble parsing the Freebase data, however. If your data is corrupt, you will have to handle that regardless of how you choose to interact with Neo4j. I've had good experiences with Jena's Models, both the default and ontology ones, for various projects, and I'm not sure why you think they shouldn't be used. Is it possible that what you need is to tweak the importer that you have already written, rather than a new approach altogether?

    0 讨论(0)
  • 2020-12-15 15:13

    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'.

    0 讨论(0)
提交回复
热议问题