Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Requirement for rdf_type should be explicit/ validated/ documented #27

Open
Robsteranium opened this issue Feb 14, 2014 · 0 comments
Open

Comments

@Robsteranium
Copy link
Member

Tripod resources require an rdf_type. When this is missing you can't find them. I'm not sure if they are not persisted or persisted but not retrievable.

Ideally this should be part of the validation, if it is to be required at all.

This is what happens without:

class Thing
  include Tripod::Resource
  graph_uri RDF::URI("http://example.org/graph/things") 
end

thing = Thing.new(RDF::URI("http://example.org/id/things/one"))
thing.save!

Thing.find(RDF::URI("http://example.org/id/things/one")) #=> raises Tripod::Errors::ResourceNotFound

It works ok when rdf_type is specified.

class Thing
  include Tripod::Resource
  graph_uri RDF::URI("http://example.org/graph/things") 
  rdf_type RDF::URI("http://example.org/def/thing")
end

thing = Thing.new(RDF::URI("http://example.org/id/things/one"))
thing.save!

thing == Thing.find(RDF::URI("http://example.org/id/things/one")) #=> true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant