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

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

问题描述

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

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

我现在需要知道的:

有什么办法可以将该 rdf 文件导入到 neo4j 中?Jena 能够将数据转换为七种不同的文件格式:.ttl、.rdf、.ne、.jsonld、.owl、.trig、.nq.

是否有一种(或多种)这些文件格式的导入器?

解决方案

如果导入器指的是可执行文件,您可以将 RDF 文件作为参数传递给它,那么不会,就我而言知道.您将不得不编写代码,但可能不会太多.

最好的办法可能是阅读 Neo4j Linked Data 页面,特别是由Michael Bach 关于导入海龟本体和Stefanie Wiegand 关于 Neo4j 中的 OWL.>

既然你提到了蓝图,你可能想看看使用 芝麻和帆.您应该能够将 Neo4j 视为三重存储,并与您的 Freebase 三重存储实现方便的界面统一.请参阅 dbpedia4neo 以了解如何使用它来导入 DBPedia 转储的示例,您的情况应该类似.>

然而,您表示您在解析 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天全站免登陆