Swirrl / tripod

ActiveModel-style Ruby ORM for RDF Linked Data. Works with SPARQL 1.1 HTTP endpoints.
MIT License
58 stars 14 forks source link

NoMethodError: undefined method `rdf_type' for Person:Class #10

Closed pezholio closed 11 years ago

pezholio commented 11 years ago

Trying to follow the example in the Readme in a vanilla Rails project, and I get the above error when creating a new Person in the console. Am I being dim, or has something changed?

In /app/models/person.rb:

class Person
  include Tripod::Resource

  rdf_type 'http://example.com/person'
  graph_uri 'http://example.com/graph'

  field :name, 'http://example.com/name'
  field :father, 'http://example.com/father', :is_uri => true
  field :knows, 'http://example.com/knows', :multivalued => true, :is_uri => true
  field :aliases, 'http://exmample.com/alias', :multivalued => true
  field :age, 'http://example.com/age', :datatype => RDF::XSD.integer
  field :important_dates, 'http://example.com/importantdates', :datatype => RDF::XSD.date, :multivalued => true
end
ricroberts commented 11 years ago

Hi. Yeah - I think the readme's out of date. I'll get back to you tomorrow with an updated example. Too late right now! :)

ricroberts commented 11 years ago

Hi Stuart. This is actually correct. What is the exact code you're running? When do you get the error?

Is tripod in your Gemfile, and have you bundled?

pezholio commented 11 years ago

Ah, I had tripod locked to version 0.0.10 - works now - sorry!

I did need to add rdf to my gemfile, which might need making clearer though :thumbsup: