Skip to content

Not working #1

Closed
Closed
@bhuga

Description

@bhuga

This is not working for me with either REXML or Nokogiri:

repo1 = RDF::Repository.new
repo1 << RDF::Statement.new([example.a, example.prop, example.b])
RDF::Writer.open('./out.trix', :format => :trix) do | writer |
  repo1.each_statement do | statement | 
    writer << statement
  end
end

Gives:
ArgumentError: Node.replace requires a Node argument, and cannot accept a Document.
(You probably want to select a node from the Document with at() or search(), or create a new Node via Node.new().)

from /opt/local/lib/ruby/gems/1.8/gems/nokogiri-1.4.1/lib/nokogiri/xml/node.rb:724:in `verify_nodeishness'
from /opt/local/lib/ruby/gems/1.8/gems/nokogiri-1.4.1/lib/nokogiri/xml/node.rb:240:in `<<'
from /opt/local/lib/ruby/gems/1.8/gems/rdf-trix-0.0.3/lib/rdf/trix/writer.rb:174:in `format_triple'

And:
RDF::Writer.for(:trix).new(File.open('./out.trix','w'), :library => :rexml) do | writer |
repo1.each_statement do | statement |
writer << statement
end
end

Gives:

NoMethodError: undefined method `parent=' for nil:NilClass
from /opt/local/lib/ruby/1.8/rexml/parent.rb:19:in `<<'
from /opt/local/lib/ruby/gems/1.8/gems/rdf-trix-0.0.3/lib/rdf/trix/writer.rb:174:in `format_triple'
from /opt/local/lib/ruby/gems/1.8/gems/rdf-trix-0.0.3/lib/rdf/trix/writer/rexml.rb:88:in `call'
from /opt/local/lib/ruby/gems/1.8/gems/rdf-trix-0.0.3/lib/rdf/trix/writer/rexml.rb:88:in `create_element'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions