My apologies (to both my readers) about the somewhat duplicate post. I'm going to reboot this series of posts. I kept putting it off because it was too ambitious to start with. I'm going to try to make this just two posts. Originally I wanted to go in depth about each of the RDF options in Ruby, but--although I have done a good bit of research--I don't have the time or knowledge to actually do that. Instead I'm going going to give an overview of each RDF library, and in my second post I'll talk about where I think the Ruby community should go from here. What is RDF?The Resource Description Framework (RDF) is a framework for adding a layer of machine readable metadata to the Internet. The simplest example is declaring information about web pages such as the author, date of publication, etc. See the classic "semantic web" article in Scientific American for more information about the vision of the Semantic Web.RDF differs from other methods for declaring metadata in that it is made to be generic, and it is really the foundation for much richer information. RDF is designed to be one of the lower levels in the Semantic Web Layer Cake, and as a standard it is designed to enable the free interchange of knowledge. Scripting languages are well positioned--perhaps uniquely positioned--for handling RDF data, and Ruby is no exception. There are two presentations to view to get you excited about the prospects for a Ruby/RDF integration.
So, RDF is the future direction of the World Wide Web, and mature RDF support in Ruby is crucial to the future of Ruby as a language, if it is going to be used to process data from the Internet. What is the state of RDF support in Ruby? I'll provide a brief overview of the state of RDF support in Ruby. Based on my research there are six different libraries for processing RDF: Not all of the projects are active, but most of the code is out there for use.RubyRDF
Dan Brickley (author of RubyRDF) has also said that he would be happy to retire the name if someone else wanted to use it for an RDF based Ruby library, since it is a generic name. Rena
Rena does not have any RDocs, nor does it have much external documentation. There is an samples folder in the download with several example uses. Plus picking through the code it seems pretty straightforward to understand. Additionally, there is an old tutorial online. Semitar
It is sparse on documentation, and you basically have to browse through the code to understand everything. It has a lot of potential, but unfortunately it is inactive. RDF Redland
The code for this wrapper could use some cleanup. It could be rewritten to be more Rubyish, and there are some minor features of librdf that it doesn't support. It is basically a SWIG binding wrapped in some Ruby classes. In May of 2007, Dave posted to the redland-dev mailing list that he was going to have to discontinue directly supporting most of the language bindings for librdf because he (understandably) doesn't have the time or the expertise in all of the languages. At this point the Ruby bindings seem to be orphaned. I believe Dave is accepting patches for, but he is not actively developing, the Ruby bindings. Samizdat
However, (as of 0.6.0) it does not have support for data-typed literals nor does it honor language tags for literals. ActiveRDF
It does not have support for blank nodes, in fact it converts them into URI nodes when they are processed. It does support attaching a datatype to a literal node, but I don't believe it does anything more than that (such as validating the structure of an XMLLiteral). So in this sense it is not a fully compliant RDF implementation. ConclusionIf you want to work with RDF in Ruby you have three viable options: Samizdat, ActiveRDF, and RDF Redland. If you want to work with a fully compliant RDF implementation, you have one option RDF Redland. If you want to work with a fully compliant and actively developed implementation, then you are out-of-luck.This is a problem, and I'd like to talk about were we should go from here in my next post. Originally published on October 26, 2007 at 5:09 pm Comments
|