一些公共方法像 count() 一样工作,一些我得到“冻结”错误
gem 'rdf', '=0.3.11.1' 需要'rdf' 需要'rdf/sesame' 需要'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
可能有人有提示,因为我不熟悉 ruby 编程。
部分错误消息:(我得到的另一个错误是 NoMethodError 我猜它来自错误使用受保护的方法)
/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'