Created
March 31, 2010 03:11
-
-
Save bhuga/349889 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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