ruby-rdf / rdf-rdfxml

Ruby RDF/XML reader/writer for RDF.rb.
http://rubygems.org/gems/rdf-rdfxml
The Unlicense
17 stars 7 forks source link

0.3.5 + JRuby 1.6.5 + Nokogiri 1.5.0 Java fails #11

Closed cpence closed 12 years ago

cpence commented 12 years ago

Exporting an RDF document as XML on this combination fails with the following error:

Java::OrgW3cDom::DOMException: NAMESPACE_ERR: An attempt is made to create or change an object 
in a way which is incorrect with regard to namespaces.

The document is generated by the following code:

  graph = ::RDF::Graph.new
  doc = ::RDF::Node.new

  name = '...'
  graph << [doc, ::RDF::DC.creator, name]
  year = '...'
  graph << [doc, ::RDF::DC.issued, year]

  citation = '...'
  graph << [doc, ::RDF::DC.bibliographicCitation, citation]

  ourl = ::RDF::Literal.new("...", :datatype => ::RDF::URI.new("info:ofi/fmt:kev:mtx:ctx"))
  graph << [doc, ::RDF::DC.bibliographicCitation, ourl]

  journal = '...'
  graph << [doc, ::RDF::DC.relation, journal]
  title = '...'
  graph << [doc, ::RDF::DC.title, title]
  graph << [doc, ::RDF::DC.type, 'Journal Article']
  doi = '...'
  graph << [doc, ::RDF::DC.identifier, "info:doi/#{doi}"]

  ::RDF::Writer.for(:rdf).buffer do |writer|
    writer << graph
  end

(Sorry about the extra :: everywhere, this function is in my own RDF module.)

Can't figure out what's up here, other than some strangeness with the Pure Java version of Nokogiri. There's an open bug over at Nokogiri involving use of remove_namespace, but a cursory glance of the RDFXML code doesn't show it to be using that function.

Any idea what's up here? (Is my RDF actually secretly invalid somehow?) Thanks!

cpence commented 12 years ago

Bah, should have read the other issue here, didn't notice it! My mistake, let me close this and get out of your way.