Open
Description
In lib/NQuads.js
, string literals are escaped. But IRIs are not.
RDF 1.1 N-Quads includes this production:
[10] IRIREF::='<' ([^#x00-#x20<>"{}|^`\] | UCHAR)* '>'
Here is a test showing a statement with a IRI that does not match the IRIREF production, which is parsed without error and serialized without escaping.
const assert = require('assert');
const canonize = require('.');
const NQuads = require('./lib/NQuads');
function assertIsCanonical(line) {
var stmt = NQuads.parse(line)[0]
var out = NQuads.serializeQuad(stmt);
assert.equal(line, out);
}
// this should fail, but it currently passes:
assertIsCanonical('<urn:ex:s"{}\t|^`\\> <urn:ex:016> "asdf" .\n')
I also opened an issue about this on the test suite:
w3c-ccg/rdf-dataset-canonicalization#15
Metadata
Metadata
Assignees
Labels
No labels