Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Make it possible to serialise incomplete models #29

Closed
njh opened this Issue · 3 comments

2 participants

@njh

I am using Spira on dbpedialite.org to help me serialise models to RDF. However I am having to depend upon version 0.0.5 because version 0.0.6 added a problem to prevents you from serialising a model, if there is no repository configured.

require 'rubygems'
require 'spira'

class Artist
  include Spira::Resource
  base_uri 'http://example.org/artists'
  property :name, :predicate => FOAF.name, :type => XSD.string
  has_many :age,  :predicate => FOAF.age, :type => XSD.integer
end

mozart = Artist.for(33163)
mozart.name = 'Wolfgang Amadeus Mozart'
#mozart.age = 35

puts RDF::Writer.for(:ntriples).dump(mozart)

With the setting age line commented out, the following error is thrown:

Artist is configured to use :default as a repository, but it has not been set. (Spira::NoRepositoryError)
@bendiken
Owner

Nick, Ben is occupied on another front just now, but would be happy to merge a patch in case you figured out what the problem here is. More than that, he'd be happy to have you as a co-author of Spira if you wanted to take a more active role in pushing the project forward.

@njh

I started to have a look at fixing this last night, but encountered further problems. I realised that because dbpedialite.org is only using Spira to serialise RDF, it was actually easier to use RDF.rb directly to construct a Graph.

If I use Spira for another project I will certain take look at improving it.

@bendiken
Owner

This project has moved to ruby-rdf/spira. If this issue is still relevant, please resubmit it over there.

@bendiken bendiken closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.