Make it possible to serialise incomplete models #29

njh opened this Issue Dec 26, 2010 · 3 comments


None yet

2 participants

njh commented Dec 26, 2010

I am using Spira on 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 ''
  property :name, :predicate =>, :type => XSD.string
  has_many :age,  :predicate => FOAF.age, :type => XSD.integer

mozart = Artist.for(33163) = '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)

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 commented Dec 27, 2010

I started to have a look at fixing this last night, but encountered further problems. I realised that because 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.


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

@bendiken bendiken closed this Aug 27, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment