2

Some public methods are working like count() and some I get "freeze" error

gem 'rdf', '=0.3.11.1' require 'rdf' require 'rdf/sesame' require 'rdf/ntriples'

url = RDF::URI("http://localhost:8080/openrdf-sesame")
conn = RDF::Sesame::Connection.open(url)

#server.each_repository do |repository|
#  puts repository.inspect
#end

    repo = RDF::Sesame::Repository.new("http://localhost:8080/openrdf-sesame/repositories/TEST")
   repo.clear_statements() # does not work
   puts repo.count() # gives the number of statements in the repository

May someone has a hint as I am not familiar with ruby programming.

Part of the error message: (the other error I get is the NoMethodError which comes from wrong usage of protected methods I guess)

/home/USER/.rvm/gems/ruby-2.1.2/gems/addressable-2.3.6/lib/addressable/uri.rb:1658:in `normalized_fragment': can't modify frozen Addressable::URI (RuntimeError)
    from /home/USER/.rvm/gems/ruby-2.1.2/gems/addressable-2.3.6/lib/addressable/uri.rb:823:in `freeze'
    from /home/USER/.rvm/gems/ruby-2.1.2/gems/rdf-0.3.11.1/lib/rdf/model/uri.rb:475:in `freeze'
mateuscb
  • 10,150
  • 3
  • 52
  • 76
rochbenritter
  • 171
  • 11
  • You are working with version 0.3.11.1 which is ancient. As a first step, you might consider upgrading to the latest stable release of the Ruby RDF gem (1.1.4.2). – Jeen Broekstra Jul 19 '14 at 07:40
  • Yes because it is specified like that, if I am using a newer version I get the following error: Unable to activate rdf-sesame-0.3.0, because rdf-1.1.4.2 conflicts with rdf (~> 0.3.0) (Gem::LoadError) – rochbenritter Jul 21 '14 at 12:18

1 Answers1

3

The problem is caused through a newer version of addressable!

When I add in the header:

gem 'addressable', '~> 2.2.6'
require 'addressable/uri'

I don't get the Error anymore! Version 2.2.6 or newer is required for rdf-sesame!

Gassa90
  • 80
  • 7