Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the RDF-Trine CPAN distribution.

Report information
The Basics
Id: 77747
Status: resolved
Priority: 0/
Queue: RDF-Trine

People
Owner: Nobody in particular
Requestors: perl [...] toby.ink
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 0.140
Fixed in: (no value)



Subject: Turtle parser - escaping backslashes doesn't seem to work
As I read the Turtle spec (any version), the following should be parsed as a single character literal consisting of one backslash: "\\" However, it's currently parsed as a two character string consisting of two backslashes. Ditto the long string form: """\\""" I believe the following should work too, but it currently results in a parse error: '\\' And the following also seems to be permitted by the latest W3C draft, but was not allowed in the dajobe.com drafts of Turtle: '''\\''' The first two cases are covered by the attached test file. This is fairly important as it's blocking RDF-RDB2RDF from passing test R2RMLTC0010c from the R2RML test suite.
Subject: turtle-test.pl
use Test::More tests => 2; use RDF::Trine 0.140; my $model = RDF::Trine::Model->new; RDF::Trine::Parser->new('Turtle')->parse_file_into_model( 'http://example.com/base/', \*DATA, $model, ); $model->as_stream->each(sub { my $st = shift; is( $st->object->literal_value, '\\', $st->subject->uri, ); }); __DATA__ # http://www.w3.org/TR/turtle/#sec-strings <test1> <literal> "\\" . <test2> <literal> """\\""" .
If you have RDF::Redland, you may need to suppress it: BEGIN { $ENV{RDFTRINE_NO_REDLAND} = 1; }
fixed in 1.000