13

我正在尝试解析 Project Gutenberg 的大型 RDF 文件。我团队的另一位成员在尝试过 Semweb 和 python 库后陷入困境。

由于对 rdf 有点天真,我尝试用 Ruby 编写一个普通的 ol' xml 解析脚本。我很快意识到它太复杂而无法真正工作。

我已经下载了 Intellidimension 的工具并正在考虑使用它。

我想我不明白如何使用 SPARQL。Java 中似乎有一个名为 Jena 的解析器。.NET 中有类似的东西吗?

很抱歉这个明显的问题......我只是不确定在哪里编写 SPARQL 查询。是否有一个库可以让我使用字符串构建查询,类似于 Data.SQlClient 然后对一些 Sparql 处理器执行?

你针对什么执行 Sparql?

4

4 回答 4

8

.Net 中的另一个选项是dotNetRDF(免责声明 - 我是该项目的主要开发人员)

It has the advantage over SemWeb that is is currently maintained and has active ongoing development plus it includes support for many of the newer Semantic Web technologies such as RDFa and SPARQL 1.1

Versus Intellidimension it has the advantage of being totally free (pick your own license from GPL, LGPL or MIT depending on your needs)

Re: SPARQL

Both SemWeb and dotNetRDF include SPARQL parsers and engines for executing queries. SemWeb's is based on an IKVM port of an old Java based SPARQL engine which has long since by superceded by the much superior ARQ engine in the Jena framework. dotNetRDF has the Leviathan engine which has close feature parity to ARQ (though not necessarily as performant for some kinds of queries).

Both ARQ (Jena) and Leviathan (dotNetRDF) support the majority of the emerging SPARQL 1.1 specification. If you have existing knowledge of SQL then you most likely want to use an engine which supports this as this adds many of the familiar features of SQL into the SPARQL language e.g. Aggregates (COUNT, MAX etc), GROUP BY, HAVING, Project Expressions (fn:concat(?x, ?y) AS ?z)

于 2010-12-06T11:14:38.190 回答
3

要走的路是使用SemWeb 库将 RDF 文件解析到内存中,然后解析到数据库中。您还可以导入相关的本体。

Semweb 有一个嵌入式 SPARQL 库,因此您可以在数据库上运行 SPARQL 查询。如果您不熟悉 SPARQL,可以使用LINQ

如果您是 Semantic Web Technologies 的新手,我建议您首先阅读Semantic Web Primer(以书籍和 PowerPoint 文件的形式提供)。Jena 网站上还有一个不错的SPARQL 教程

于 2010-12-05T03:00:04.210 回答
2

Yet another option is the dotSesame library. This is an IKVM port of the Java RDF framework Sesame. It includes RDF parsers, writers, a SPARQL query engine, and reasoners.

于 2010-12-06T12:25:38.007 回答
0

With RDFSharp (http://rdfsharp.codeplex.com/) you don't need to know SPARQL, because you create fluently your SPARQL queries and apply them to graphs and stores. All without writing a single line of SPARQL query.

于 2014-01-09T12:13:41.163 回答