Ruby 中的 RDF 状态

发布于 2024-07-21 13:12:24 字数 370 浏览 4 评论 0 原文

我想知道 Ruby 目前对语义 Web 技术的支持。 有好的 RDF 选择吗? 最近一次调查似乎是在 2007 年左右(http://paul-classic.stadig.name/2007/10/26/the-state-of-rdf-support-in-ruby-2007/ )。 Redland 的 RDF 包装器是获得 RDF 支持的最佳方式吗?那篇老化文章中提到的所有其他项目似乎都不受支持或被放弃。 如果要从事与语义网络相关的项目,Ruby 可能是一个糟糕的选择吗?

I'm wondering about the current support there is in Ruby for semantic web technologies. Is there good RDF options? It seems that the last surveys done were circa 2007 ( http://paul-classic.stadig.name/2007/10/26/the-state-of-rdf-support-in-ruby-2007/ ). Is Redland's RDF wrappers the best way to go for RDF support - all the other projects mentioned in that aging article seem to be unsupported or dropped. Is Ruby perhaps a bad choice if one which to pursue projects pertaining to the semantic web?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(7

段念尘 2024-07-28 13:12:24

嘿,Iaalto,我是你提到的调查文章的作者。 我一直在考虑做一项新的调查。

自从我进行最初的调查以来,情况发生了一些变化,但变化不大。 这里有一些需要考虑的事情:

  1. ActiveRDF 似乎已经走上了 JRuby 特定库的道路。 他们的一些适配器仅适用于 Java 库。 不一定是问题,但需要注意。
  2. Reddy 只有一个基于内存的图表。 同样,这不一定是问题。 我不会因此而低估 Reddy(过早的优化),但我也不会梦想存储数十亿个三元组。
  3. 我最近为 Redland 找到了一组新的 Ruby 绑定,名为 RedLeaf。 不确定它有多成熟,但看起来迈克尔已经为此工作了大约一年。 直到最近我才听说它,因为它是离网的(没有 RubyForge 或 GitHub 项目)。
  4. 我在 GitHub 上创建了一个名为 RubyRDF 的项目 (github.com/pjstadig/rubyrdf/tree/master)。 它没有大量的文档,但大部分都是实用的。 它有一个芝麻兼容适配器,支持事务。 我仍然对未来的方向有一些想法,并使其功能更加完整,但没有太多的动力去做这件事。 我欢迎任何贡献。

底线:如果 JRuby 对您来说不是问题,那么就选择 ActiveRDF,它是最完整、最成熟的。 如果基于内存的图不是问题,那么下一个最成熟的可能是 Reddy。

Hey, Iaalto, I'm the author of the survey article that you mentioned. I've been thinking about doing a new survey.

A little has changed since I did the original survey, but not much. Here are a couple of things to consider:

  1. ActiveRDF seems to have gone the route of being a JRuby specific library. Several of their adapters are for Java only libraries. Not necessarily a problem, but something to be aware of.
  2. Reddy only has a memory based graph. Again, not necessarily a problem. I wouldn't discount Reddy for that (premature optimization), but I also wouldn't dream of storing billions of triples.
  3. I recently found a new set of Ruby bindings for Redland called RedLeaf. Not sure how mature it is, but it looks like Michael has been working on it for about a year. I hadn't heard of it until recently because it is off-grid (no RubyForge or GitHub project).
  4. I created a project on GitHub called RubyRDF (github.com/pjstadig/rubyrdf/tree/master). It doesn't have a ton of documentation, but it is mostly functional. It has a Sesame compatible adapter with support for transactions. I still have some ideas for future direction, and making it more feature complete, but not a lot of impetus to work on it. I'd welcome any contributions.

Bottom line: If JRuby is not a problem for you, then go with ActiveRDF, it is the most complete and mature. If memory based graph is not a problem, then the next most mature is probably Reddy.

过度放纵 2024-07-28 13:12:24

就我个人而言,我选择了 RDF.rb 因为他们的网站有不错的文档,而且很容易开始使用博客教程。

ActiveRDF 似乎是一个更大的项目 - 但他们的 wiki 已关闭(实际上主页链接到 archive.com 上的 wiki 副本) - 并且所有示例都讨论了 SPARQL 查询。

这是一个简单的三重查找示例,对愚蠢的语法表示歉意,因为这是我的第一个 Ruby 脚本:

require 'rubygems'
require 'rdf'
require 'rdf/raptor'

scufl2 = RDF::Vocabulary.new("http://ns.taverna.org.uk/2010/scufl2/ontology/")
dc = RDF::Vocabulary.new("http://purl.org/dc/elements/1.1/")

graph = RDF::Graph.load("../resources/workflows/example.ttl")
graph.query([nil, scufl2.workflow, nil]) do |bundle,p,workflow|
  graph.query([workflow, scufl2.name, nil]) do |wf,p,workflow_name|
    # Should just be one
    print workflow_name
  end
end

不幸的是,像许多 Ruby 和 Python 依赖项一样,这也需要一些二进制文件才能读取 Turtle 或 RDF/XML。 不过,“aptitude install raptor-utils”解决了这个问题。

Personally I went for RDF.rb as their web site had OK documentation, and it was easy to get started with using the blog tutorials.

ActiveRDF seems like a larger project - but their wiki is down (actually the main page links to a copy of the wiki on archive.com) - and all the example talk about SPARQL queries.

Here's a simple triple lookup example, apologies for silly syntax as this was my first Ruby script:

require 'rubygems'
require 'rdf'
require 'rdf/raptor'

scufl2 = RDF::Vocabulary.new("http://ns.taverna.org.uk/2010/scufl2/ontology/")
dc = RDF::Vocabulary.new("http://purl.org/dc/elements/1.1/")

graph = RDF::Graph.load("../resources/workflows/example.ttl")
graph.query([nil, scufl2.workflow, nil]) do |bundle,p,workflow|
  graph.query([workflow, scufl2.name, nil]) do |wf,p,workflow_name|
    # Should just be one
    print workflow_name
  end
end

Unfortunately, like many Ruby and Python dependencies, this also needed some binaries to be able to read Turtle or RDF/XML. "aptitude install raptor-utils" took care of that, though.

在风中等你 2024-07-28 13:12:24

我刚刚写了一个 关于 Ruby 和 RDF 的新调查文章。 我的一些结论是:

  • 有大量围绕 RDF.rb 的活动,有超过二十个数据库适配器、序列化/反序列化插件以及与其他库的接口。 大多数最近的对象映射器也是构建在 RDF.rb 之上的。
  • 流行的 Redland RDF 库具有 Ruby 绑定,并且得到积极维护。
  • ActiveRDF 是 RDF 的首要对象映射器,但它似乎不再得到积极维护。
  • 目前唯一最新的、活跃的对象映射器似乎是 Spira
  • 目前还没有对象映射器利用 ActiveModel。 这确实非常巧妙,因为它将提供 RDF 和 Rails 之间更深入的集成。

RDF.rb 和 Spira 的作者也提出了一些有趣的后续评论。 尤其是 Ben Lavender,对于如何合理地将 RDF 映射到 Ruby 对象进行了很多思考。

I just wrote up a new survey article on Ruby and RDF. Some of my conclusions are:

  • There's a huge amount of activity surrounding RDF.rb, with over a score of database adapters, serialization/deserialization plugins, and interfaces to other libraries. Most of the recent object mappers have been built on top of RDF.rb, too.
  • The popular Redland RDF library has Ruby bindings, and it's actively maintained.
  • ActiveRDF was the premiere object mapper for RDF, but it no longer appears to be actively maintained.
  • The only recent, active object mapper at the moment appears to be Spira.
  • None of the object mappers are taking advantage of ActiveModel yet. This would be really slick, because it would provide much deeper integration between RDF and Rails.

There are also some interesting follow-up comments from the authors of RDF.rb and Spira. Ben Lavender, in particular, has thought a lot about how to sanely map RDF onto Ruby objects.

毁虫ゝ 2024-07-28 13:12:24

我是 Redland 的作者,但我自己不使用 Ruby。 ruby 绑定可能仍然有效(它们在上一个版本中通过了单元测试),但可能需要对任何新的 ruby​​ 语言更改进行一些喜爱。

我认为纯 Ruby 用户已经尝试过 Active RDF ,它比您建议的其他东西更新,但专注于 Rails 。

否则,我建议在语义 Web 兴趣组 IRC 频道上询问 - irc.freenode.net 上的 #swig

编辑: 还有 Reddy http://github.com/tommorris/reddy/tree/master 以及 github 上的其他 ruby​​ rdf 代码(如果你环顾四周的话)。

I'm the author of Redland but I don't use Ruby myself. The ruby bindings probably still work (they passed the unit tests at the last release) but probably need some love for any newer ruby language changes.

Pure Ruby users I think have tried Active RDF which is more recent than the other things you suggest but focused on Rails.

Otherwise I suggest asking on the Semantic Web Interest Group IRC channel - #swig on irc.freenode.net

Edit: There's also Reddy http://github.com/tommorris/reddy/tree/master and other ruby rdf code on github if you look around.

泛泛之交 2024-07-28 13:12:24

AllegroGraph (RDF DB) 有一个 Ruby 客户端 - https://github.com/phifty/agraph

AllegroGraph (RDF DB) has a Ruby Client - https://github.com/phifty/agraph

-黛色若梦 2024-07-28 13:12:24

有一个 Ruby Sesame 库: http://github.com/tillsc/ruby-sesame

Sesame 是两个最流行的 Java RDF 框架之一。 我们(Ontotext)开发了一个三重存储+内置推理引擎,称为OWLIM。 我们提供一个名为 SwiftOWLIM 的免费版本。

我们的一些用户通过上面的 Ruby Sesame 库将其与 Ruby 一起使用。

There is a Ruby Sesame library: http://github.com/tillsc/ruby-sesame

Sesame is one of the two most popular RDF frameworks for Java. We (Ontotext) develop a triple storage + built-in inference engine called OWLIM. We provide a free version called SwiftOWLIM.

Some of our users use it with Ruby through the above Ruby Sesame library.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文