Skip to content

Instantly share code, notes, and snippets.

@bhuga
Created March 31, 2010 03:11
Show Gist options
  • Save bhuga/349889 to your computer and use it in GitHub Desktop.
Save bhuga/349889 to your computer and use it in GitHub Desktop.
require 'spira'
Spira.add_repository(:person, ::RDF::Repository)
class Person
include Spira::Resource
default_source :person
# the default base path to find Persons
default_base_uri "http://example.org/example/people/"
vocabulary_base "http://example.org/predicates/"
property :name # becomes http://example.org/predicates with String literal type
property :age, :predicate => FOAF.age, :type => Integer
end
class Employee
include Spira::Resource
default_source :person
property :name, # throws an error because no vocabulary_base configured
property :age, :predicate => FOAF.age, :type => Integer
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment