将RDF(XML或Turtle)导入Neo4j [英] Import RDF (XML or Turtle) into Neo4j

查看:517
本文介绍了将RDF(XML或Turtle)导入Neo4j的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我下载了Freebase的数据库转储.格式 该文件的是rdf turtle.我需要获取所有数据 进入neo4j数据库.

我已经在tinkerpop.blueprints的帮助下写了一个进口商. 首先,它似乎可以正常工作,但是在导入30分钟后 发生异常,因为rdf文件包含字符 在不允许他们进入的位置.一点点 后来(经过一番调查),我发现耶拿 我使用的解析器(RDFReader)已弃用,不应使用.

我现在需要知道的:

是否可以将rdf文件导入neo4j? 耶拿能够将数据转换为七个不同的数据 文件格式:.ttl,.rdf,.ne,.jsonld,.owl,.trig,.nq.

这些文件格式中的一种(或多种)是否有进口商?

解决方案

如果是进口商,您的意思是一个可执行文件,您可以将RDF文件作为参数传递给该可执行文件,据我所知,否.您将不得不编写代码,但可能不是很多.

您最好的选择是阅读 Neo4j链接数据页,特别是迈克尔·巴赫(Michael Bach)关于导入Turtle本体和Stefanie Wiegand关于 Neo4j中的OWL .

由于您提到了蓝图,因此您可能希望使用芝麻与帆船.您应该能够将Neo4j视为三重存储,并与Freebase三重存储实现便利的接口统一性.有关如何将其用于导入DBPedia转储的示例,请参见 dbpedia4neo ,您的情况应类似. >

但是,您表示您在解析Freebase数据时遇到麻烦.如果您的数据已损坏,则无论您选择如何与Neo4j进行交互,都将不得不对其进行处理.我在各种项目的默认和本体Jena的Model上都有很好的经验,我不确定为什么您认为不应该使用它们.您是否可能需要调整已经编写的导入程序,而不是完全采用新方法?

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?

解决方案

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?

这篇关于将RDF(XML或Turtle)导入Neo4j的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆