Closed workergnome closed 7 years ago
The difference you're seeing is that when you include "linkeddata", it causes the result to be read by the Turtle reader instead of the N-Triples reader. It looks like the N-Triples reader is not handling the embedded double-quote correctly. There are tests, but it looks like they hide this problem and will need to be improved.
In the mean time, please continue to use the Turtle reader, either with the "linkeddata" gem, or by requiring "rdf/turtle".
Closing, as bug is in RDF.rb: ruby-rdf/rdf#340.
Thanks, @gkellogg, as always!
@workergnome It ends up that the problem was because UTF-8 data was sent with an ASCII encoding, and the code which attempts to correct this should not have been unending the string first, but simply forcing the encoding. I'm releasing RDF.rb 2.2.1 with the fix.
Thanks, and I'll let the people responsible for sending the data know, too.
tl;dr. summary:
Using the
sparql-client
gem, the results of queries with embedded quotes differ from when using thelinkeddata
gem.Expected Results:
Actual Results:
In depth:
When I run the following code:
I get the results I expect:
but when I comment out the
linkeddata
gem and instead use just thesparql-query
gem the results with embedded quotes no longer work, and my results look like:I'm using ruby 2.3.3p222 (2016-11-21 revision 56859) [x86_64-darwin16], and I'm using a gemfile that includes the line
gem "linkeddata", '~> 2.1.0'
, and the Gemfile.lock file says I'm using