What Ruby library do you use for working with RDF? - Semantic Overflow most recent 30 from http://www.semanticoverflow.com 2010-07-31T08:20:27Z http://www.semanticoverflow.com/feeds/question/505 http://www.creativecommons.org/licenses/by-nc/2.5/rdf http://www.semanticoverflow.com/questions/505/what-ruby-library-do-you-use-for-working-with-rdf What Ruby library do you use for working with RDF? billroberts 2010-01-27T12:34:02Z 2010-07-05T12:00:18Z <p>There was some discussion of this question here: <a href="http://stackoverflow.com/questions/931548/the-state-of-rdf-in-ruby" rel="nofollow">http://stackoverflow.com/questions/931548/the-state-of-rdf-in-ruby</a> where Dave Beckett notes that the Ruby bindings for his Redland library have not been updated for a while (though probably still work). Can anyone comment on whether the Ruby Redland bindings work correctly in recent versions of Ruby?</p> <p>I've also been experimenting with RdfContext from Gregg Kellogg <a href="http://github.com/gkellogg/rdf_context" rel="nofollow">http://github.com/gkellogg/rdf_context</a></p> <p>What library do you use and what are its pros and cons?</p> http://www.semanticoverflow.com/questions/505/what-ruby-library-do-you-use-for-working-with-rdf/547#547 Answer by Gregg Kellogg for What Ruby library do you use for working with RDF? Gregg Kellogg 2010-02-08T16:31:37Z 2010-02-08T16:31:37Z <p>I started RdfContext due to frustrations with the Redland Ruby Bindings. The primary issues for me were installation problems across different platforms, which is a real problem when you're developing a gem as a utility for non-programmers to use. A buggy Rdfa parser (which has since been updated and is now state-of-the-spec). And garbage collection issues, which didn't affect operation, but left complaints all over the place.</p> <p>Redland's still the way to go for straight-out performance, but I felt that a pure-Ruby approach was necessary. The works not done; more stores could be added, and performance can be improved. I'm working on updating the N3 parser to take advantage of Quoted Graphs and be more compliant. I'd also like to add a SPARQL engine and work on better Rails integration.</p> http://www.semanticoverflow.com/questions/505/what-ruby-library-do-you-use-for-working-with-rdf/814#814 Answer by Arto Bendiken for What Ruby library do you use for working with RDF? Arto Bendiken 2010-04-25T23:17:39Z 2010-04-25T23:17:39Z <p>The active pure-Ruby projects at this moment are <a href="http://rdf.rubyforge.org/" rel="nofollow">RDF.rb</a>, <a href="http://github.com/gkellogg/rdf_context" rel="nofollow">RdfContext</a> and <a href="http://github.com/rsinger/RDFObjects" rel="nofollow">RDFObjects</a>, and the most convenient Redland binding for Ruby is <a href="http://deveiate.org/projects/Redleaf" rel="nofollow">Redleaf</a>.</p> <p>I'm the lead developer for RDF.rb, so that's what I use. In brief, RDF.rb's pros are:</p> <ul> <li>100% pure Ruby with minimal dependencies and no bloat.</li> <li>100% free and unencumbered <a href="http://unlicense.org/" rel="nofollow">public domain</a> software.</li> <li>Extremely <a href="https://www.ohloh.net/p/rdf" rel="nofollow">well-commented</a> source code.</li> <li>Compatible with Ruby 1.8.x, Ruby 1.9.x, and JRuby.</li> <li>Provides a clean RDF object model and related APIs.</li> <li>Fully modularized with a lean core, most non-core functionality available as add-on plugin gems.</li> <li>Supports parsing and serializing N-Triples, Turtle, RDF/XML, RDF/JSON, and TriX data.</li> <li>Supports accessing and storing RDF data in SQLite, PostgreSQL, MongoDB, Cassandra, Sesame, RedStore, and the Talis Platform.</li> </ul> <p>The cons are primarily the lack of a SPARQL engine at present (a <a href="http://sparql.rubyforge.org/client/" rel="nofollow">SPARQL client</a> already exists, however).</p> <p>If you wish to learn more, there are several in-depth tutorials available for RDF.rb:</p> <ul> <li><a href="http://blog.datagraph.org/2010/03/rdf-for-ruby" rel="nofollow">RDF.rb: A Public-Domain RDF Library for Ruby</a></li> <li><a href="http://blog.datagraph.org/2010/04/parsing-rdf-with-ruby" rel="nofollow">Parsing and Serializing RDF Data with Ruby</a></li> <li><a href="http://blog.datagraph.org/2010/04/rdf-repository-howto" rel="nofollow">How to Build an SQL Storage Adapter for RDF Data with Ruby</a></li> </ul> <p>The <a href="http://lists.w3.org/Archives/Public/public-rdf-ruby/" rel="nofollow">public-rdf-ruby@w3.org</a> mailing list has also undergone something of a revival in the last month, so I'd highly recommend that anyone who cares about RDF in Ruby subscribe to the list and participate in the ongoing discussions.</p> http://www.semanticoverflow.com/questions/505/what-ruby-library-do-you-use-for-working-with-rdf/818#818 Answer by Harshal for What Ruby library do you use for working with RDF? Harshal 2010-04-26T03:04:54Z 2010-04-26T03:04:54Z <p>As an alternative, you can explore <a href="http://activerdf.org" rel="nofollow">ActiveRDF</a>. A fork is being developed by enthusiasts on <a href="http://github.com/net7/ActiveRDF" rel="nofollow">GitHub</a>. I had used it a couple of years ago. Hope that helps.</p> http://www.semanticoverflow.com/questions/505/what-ruby-library-do-you-use-for-working-with-rdf/819#819 Answer by Ross Singer for What Ruby library do you use for working with RDF? Ross Singer 2010-04-26T12:27:22Z 2010-04-26T12:27:22Z <p>ActiveRDF pretty much requires that you have a persistence layer with a SPARQL endpoint, which, in my case, at least, isn't always a given when I'm just trying to parse and work with some RDF. It's also very Rails-centric. </p> <p>The major difference between RDFObjects (full disclosure, I am the main developer) and RDF.rb and RdfContext is that its intention is to abstract the graphs away into something more idiomatically Ruby-ish (aligning it more, API-wise, with ActiveRDF). The other two stick pretty closely to RDF for their interfaces. Like RdfContext, the only reason I started RDFObjects was a completely inability to get the Redland bindings working.</p> <p>I'm not sure I can subscribe to any of them being "pure-Ruby", per se, since RDFObjects and RdfContext require Nokogiri and RDF.rb requires raptor to work with anything but ntriples or JSON (basically), but these are certainly much lower barriers than the Redland bindings have presented.</p> <p>Anyway, it's nice to see an ecosystem building (finally) around RDF for Ruby.</p> http://www.semanticoverflow.com/questions/505/what-ruby-library-do-you-use-for-working-with-rdf/824#824 Answer by Ian for What Ruby library do you use for working with RDF? Ian 2010-04-27T10:15:49Z 2010-04-27T10:15:49Z <p>@Arto Bendiken I think your RDF.rb project is pretty interesting, but surely it's not "100% pure Ruby" since you rely on Redland to parse RDF/XML and Turtle?</p> <p>Ian</p> http://www.semanticoverflow.com/questions/505/what-ruby-library-do-you-use-for-working-with-rdf/1174#1174 Answer by davidseth for What Ruby library do you use for working with RDF? davidseth 2010-07-05T12:00:18Z 2010-07-05T12:00:18Z <p>Take a look at the excellent <a href="http://github.com/bhuga/spira" rel="nofollow">Spira Project</a>. "It's time to breathe life into your linked data."</p> <p>And a blog post with further info: <a href="http://blog.datagraph.org/2010/05/spira" rel="nofollow">http://blog.datagraph.org/2010/05/spira</a></p>