Closed phlegx closed 12 years ago
You cannot have class names in Ruby in lower case. A class name in ruby must be a constant, starting with a capital letter. Doesn't your ruby interpreter issue errors for your code?
Here's your code, with my adjustments. Works for me.
class Foo < Spira::Base
property :has_area, :predicate => RDF::URI.new('http://example.com/foo#has_area'), :type => :Area end
class Area < Spira::Base
end
Very cool man! Thx.
In Rails, symbols has : at the beginning and all in lowercase. Why don't use symbols that are converted into regular class names with methods capitalize, humanize and/or classify?
http://api.rubyonrails.org/classes/ActiveSupport/Inflector.html
Spira wasn't initially a part of Rails ecosystem and it didn't have a dependency on ActiveSupport and the like. It has been using some home-brewn methods for many things that are available in ActiveSupport. It was the choice of the original author, not mine. I'm getting rid of the legacy code, but all in its good time.
I have my vocabulary http://example.com/foo. This vocabulary has a property http://example.com/foo#has_area. The object of foo#has_area is an instance of class http://example.com/foo#area in my vocabulary.
How can I code it in spira?
Spira return the error: "Could not find relation class area (referenced as area by #Foo:0x00000004b11008)"