This post originated from an RSS feed registered with Ruby Buzz
by Red Handed.
Original Post: Web Ontologies on an Angel's Eyelash
Feed Title: RedHanded
Feed URL: http://redhanded.hobix.com/index.xml
Feed Description: sneaking Ruby through the system
Whoa, Obie Fernandez dropped a potent little bouillon cube on his blog:
require 'rexml/document'
include REXML
class OWL
def initialize(url)
XPath.match(Document.new(Net::HTTP.get(URI.parse(url))), "//owl:Class").
each do |e|
eval("#{e.attributes['rdf:ID']} = Class.new")
end
end
end
Scared you? Left you powerfully agape? Truthfully, Ruby is such a great gal, though. Anonymous classes on the house, whenever you please. Don’t miss the screenshot to go with it. Our neck of the woods is gonna get overrun by RDF hounds. (Thanks, Obie!)