More Ruby Meets the Semantic Web

Doing a bit more research on Ruby and the Semantic Web, I found another blog entry from Obie titled Semantic Web, meet Ruby on Rails.

Here's one of his snippets:



class Person < ActiveOntology::Base

definition "http://xmlns.com/foaf/0.1/index.rdf"

def your_method_here
# methods are pretty much the only thing left to write
# because since you defined it as a foaf:Person, it already has
# all the properties described at http://xmlns.com/foaf/0.1/#term_Person
end

def network_msg
"#{firstName} #{surname} has #{knows.size} people in their network"
end

end

Post a Comment

Popular posts from this blog

Converting Array to List in Scala

I ported a JavaScript app to Dart. Here's what I learned.

Minification is not enough, you need tree shaking