Created
December 18, 2012 21:34
-
-
Save sandsfish/4332227 to your computer and use it in GitHub Desktop.
RDF.rb transaction delete failing with gems/rdf-0.3.11/lib/rdf/mixin/mutable.rb:124:in `delete': undefined method `query' for #<RDF::Transaction:0x1e2bde(graph: nil, deletes: 0, inserts: 0)> (NoMethodError)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/Users/sands/.rvm/rubies/ruby-1.8.7-p371-i386/bin/ruby | |
require 'rubygems' | |
require 'rdf' | |
require 'rdf/ntriples' | |
include RDF | |
repository = RDF::Repository.load("http://rdf.rubyforge.org/doap.nt") | |
# reports correct predicate URI... | |
# DOAP.name: http://usefulinc.com/ns/doap#name | |
puts "DOAP.name: #{DOAP.name}" | |
# reports triple present: | |
# <http://rubygems.org/gems/rdf> <http://usefulinc.com/ns/doap#name> "RDF.rb" . | |
puts RDF::Writer.for(:ntriples).dump(repository) | |
# Delete one statement and insert another, atomically: | |
repository.transaction do |tx| | |
subject2 = RDF::URI('http://rubygems.org/gems/rdf') | |
tx.delete [subject2, DOAP.documenter, nil] | |
tx.insert [subject2, DOAP.name, "RDF.rb 0.3.0"] | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Error detail:
/Users/sands/.rvm/gems/ruby-1.8.7-p371-i386@rdf/gems/rdf-0.3.11/lib/rdf/mixin/mutable.rb:124:in
delete': undefined method
query' for #<RDF::Transaction:0x1e2bde(graph: nil, deletes: 0, inserts: 0)> (NoMethodError)from /Users/sands/.rvm/gems/ruby-1.8.7-p371-i386@rdf/gems/rdf-0.3.11/lib/rdf/mixin/mutable.rb:116:in
map!' from /Users/sands/.rvm/gems/ruby-1.8.7-p371-i386@rdf/gems/rdf-0.3.11/lib/rdf/mixin/mutable.rb:116:in
delete'from ./try-tx.rb:21
from /Users/sands/.rvm/gems/ruby-1.8.7-p371-i386@rdf/gems/rdf-0.3.11/lib/rdf/repository.rb:154:in
call' from /Users/sands/.rvm/gems/ruby-1.8.7-p371-i386@rdf/gems/rdf-0.3.11/lib/rdf/repository.rb:154:in
transaction'from ./try-tx.rb:18