ruby-rdf / rdf-turtle

Turtle reader/writer for Ruby
http://rubygems.org/gems/rdf-turtle
The Unlicense
31 stars 9 forks source link

reserved character escape sequences for local names #21

Closed masao closed 8 months ago

masao commented 8 months ago

The latest combination of the rdf and rdf-turtle packages does not correctly handle the reserved character escape sequences for local names. The combination of the past versions is fine, so some updates are causing the following problem.

gem "rdf", "3.3.1"
gem "rdf-turtle", "3.3.0"
require "rdf/turtle"
ttl = '@prefix p: <http://a.example/>. p:a\/a <http://a.example/p> <http://a.example/o> .'
rdf=RDF::Turtle::Reader.new(ttl) {|reader|
  p reader.statements
}

output:

[#<RDF::Statement:0x47964(<http://a.example/a\u005C/a> <http://a.example/p> <http://a.example/o> .)>]

The past versions (rdf 3.2.11, rdf-turtle 3.2.1):

gem "rdf", "3.2.11"
gem "rdf-turtle", "3.2.1"
require "rdf/turtle"
ttl = '@prefix p: <http://a.example/>. p:a\/a <http://a.example/p> <http://a.example/o> .'
rdf=RDF::Turtle::Reader.new(ttl) {|reader|
  p reader.statements
}

output:

[#<RDF::Statement:0x3f48(<http://a.example/a/a> <http://a.example/p> <http://a.example/o> .)>]
gkellogg commented 8 months ago

I had actually fixed thus bug in January, but hadn't released it. It's now released in version 3.3.1 of the rdf-turtle gem.