Regression in N-Triples ASCII output with RDF.rb 1.0.4 #111

Closed
bendiken opened this Issue Mar 29, 2013 · 1 comment

Comments

Projects
None yet
2 participants
Owner

bendiken commented Mar 29, 2013

Given the following simple test program:

RDF::NTriples::Writer.new($stdout, :encoding => Encoding::ASCII) do |writer|
  s = RDF::URI('http://rdf.freebase.com/ns/m.0106g9')
  p = RDF::URI('http://rdf.freebase.com/ns/common.topic.topic_equivalent_webpage')
  o = RDF::URI('http://sr.wikipedia.org/wiki/Девајн_(Тексас)')
  writer << RDF::Statement(s, p, o)
end

With RDF.rb 1.0.1, 1.0.2, and 1.0.3 the output was correct, plain ASCII:

<http://rdf.freebase.com/ns/m.0106g9> <http://rdf.freebase.com/ns/common.topic.topic_equivalent_webpage> <http://sr.wikipedia.org/wiki/\u0414\u0435\u0432\u0430\u0458\u043D_(\u0422\u0435\u043A\u0441\u0430\u0441)> .

With RDF.rb 1.0.4 the output has regressed to UTF-8, wholly ignoring the explicit :encoding option:

<http://rdf.freebase.com/ns/m.0106g9> <http://rdf.freebase.com/ns/common.topic.topic_equivalent_webpage> <http://sr.wikipedia.org/wiki/Девајн_(Тексас)> .

This means that the N-Triples/N-Quads output of RDF.rb 1.0.4 is now incompatible with at least the Raptor library (and its accompanying rapper command-line utility), and quite possibly other RDF parsing suites as well.

gkellogg was assigned Mar 29, 2013

Owner

gkellogg commented Mar 29, 2013

I guess we need some specs for that. I'll look at it this weekend, along with seeing if we can remove Addressable.

@gkellogg gkellogg added a commit that referenced this issue Mar 31, 2013

@gkellogg gkellogg In RDF::Writer.dump/buffer/open: Set external_encoding based on :enco…
…ding option if it is not otherwise set. Also, if no :encoding option is given, but the IO/StringIO file has an external_encoding, use that as the default for output encoding. This relates to issue #111
86ba44d

@gkellogg gkellogg added a commit that referenced this issue Apr 2, 2013

@gkellogg gkellogg In RDF::Writer.dump/buffer/open: Set external_encoding based on :enco…
…ding option if it is not otherwise set. Also, if no :encoding option is given, but the IO/StringIO file has an external_encoding, use that as the default for output encoding. This relates to issue #111
d3b1603

gkellogg closed this Apr 14, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment