Using Rena to Process RDF in Ruby
A quick follow-up to my previous post about Rena, the Ruby library modeled after Jena. Oliver Bolzer has published his introduction to Rena here.
A quick follow-up to my previous post about Rena, the Ruby library modeled after Jena. Oliver Bolzer has published his introduction to Rena here.
I remember checking out Dan Brickley‘s RubyRDF library awhile back and having trouble doing much with it. But of course that was a long time ago, so I thought I’d check back in to see if any progress had been made. After all, it’s that Dan Brickley, so you’ve at least got to see what’s there.
Unfortunately, the software was last updated in April 2003, and I suspect this means that it’s been abandoned. As noted in the documentation, RubyRDF is an experimental system and “not production-grade stuff.” Dan also notes later in the page, “I might not do any more work on this.” That’s fair, of course; it seems clear that Dan was pursuing this to scratch an itch, as is the case for a lot of open source projects on the web. But I decided to set this one aside again after a scan of the still-cluttered Wiki page. I guess I’ll check again this time next year, if none of the other RDF libraries for Ruby make it that far.
Rena is a new library for working with RDF that seems to be a Ruby port of the popular Jena semantic web framework for Java. As noted by the author, it’s still in the “experimental” stage but already shows some promise.
As with Jena, the basic object model parallels the RDF model. Rena has not yet adopted Jena 2.0′s factory-based approach to creating model instances, so you instead just instantiate the desired model class directly. For example, here’s how to create an in-memory model, add a resource and define some properties for it:
Here, we’re taking advantage of the built-in support for some of the Dublin Core elements. The output of that final call torequire 'rena' require 'rena/dc'docURI = “http://www.fxruby.org/doc” docTitle = “FXRuby User’s Guide” docDate = “2004-10-24″
Create an empty Model
model = Rena::MemModel.new
Create the resource
myDoc = model.create_resource(docURI)
Add some properties
myDoc.addproperty(Rena::DC::Title, Rena::PlainLiteral.new(docTitle)) myDoc.addproperty(Rena::DC::Date, Rena::PlainLiteral.new(docDate))
Dump
model.save(STDOUT, :content_type => ‘application/rdf+xml’)
MemModel#save is the RDF/XML serialization of this model:
I haven’t gotten around to trying out the parsing or querying support yet, but it looks like the author’s goal is to more or less emulate what’s being done with Jena. Hopefully this one will progess quickly.<?xml version='1.0'?> <rdf:RDF xmlns:ns0='http://purl.org/dc/elements/1.1/' xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#'><rdf:Description ns0:title='FXRuby User's Guide' ns0:date='2004-10-24' rdf:about='http://www.fxruby.org/doc'/> </rdf:RDF>
Also on my list of phrases that need to be retired: “chilling effect.” One of the latest specimens, from this San Francisco Chronicle article on an upcoming PBS show:
“With the excising of three not-so-little terms — “s — ,” “f — ” and “blow job,” — from a forthcoming drama on PBS, the Hollywood creative community and broadcasters are finding, not to their liking, that a chilling effect on content has already taken place.”Yes, it is a sad, sad day when I can’t hear the “F” word on PBS. Let me get my sweater.
Maybe “chilling effect” is the new “gravitas.” I seem to have heard that expression more in the last few years than I’ve heard it in my entire life. According to google.com, the phrase “chilling effect” now has its own web site. In case you’re keeping score, some of the things that have chilling effects on other things are:
Was watching “Hardball with Chris Matthews” last night, when he was interviewing Donna Brazile (Al Gore’s campaign manager for the 2000 U.S. Presidential Campaign). Somehow, she managed to work in the word gravitas to describe Senator John Edwards, the recently-announced running mate for John Kerry. I thought we had managed to bury this poor word after the 2000 campaign, but maybe Ms. Brazile is just frozen in time and can’t let go, bless her heart.
Every year, the Lake Superior State University’s Word Banishment Selection Committee publishes its “List of Words Banished from the Queen’s English for Mis-Use, Over-Use and General Uselessness”. This year’s list includes such gems as “metrosexual”, “bling-bling” and “shock and awe”, but a search of all the words banned to date didn’t turn up “gravitas”. I’ve now made my nomination; wish me luck.
Yahoo! News is reporting that the Department of Homeland Security’s U.S. Computer Emergency Readiness Team (US-CERT) has recommended using browsers other than Microsoft’s Internet Explorer, due to security concerns. There are a number of recommendations listed in the US-CERT vulnerability note, but the relevant one is this:
“There are a number of significant vulnerabilities in technologies relating to the IE domain/zone security model, the DHTML object model, MIME type determination, and ActiveX. It is possible to reduce exposure to these vulnerabilities by using a different web browser, especially when browsing untrusted sites. Such a decision may, however, reduce the functionality of sites that require IE-specific features such as DHTML, VBScript, and ActiveX. Note that using a different web browser will not remove IE from a Windows system, and other programs may invoke IE, the WebBrowser ActiveX control, or the HTML rendering engine (MSHTML).”I haven’t (intentionally) used IE for several years now, but it’s still jarring to see this lack of security in what is probably still the most widely used web browser for Windows. As noted elsewhere on the web, this has prompted a number of Windows users to finally investigate their alternatives, such as the Mozilla project’s Mozilla and Firefox browsers.