Skip to content

Serializing literal subjects returns invalid results #329

@joachimvh

Description

@joachimvh

Copy/pasting from CommunitySolidServer/CommunitySolidServer#1582 (comment)

  const n3 = `"1"^^<http://www.w3.org/2001/XMLSchema#boolean> <http://example.com/p> <https://example.com/s> .`;
  const parser = new Parser({ format: 'text/n3' });
  const store = new Store(parser.parse(n3));
  const writer = new Writer({ format: 'text/turtle' });
  writer.addQuads(store.getQuads(null, null, null, null));
  writer.end((error, result): void => console.log(result));

Outputs

"1"^^http://www.w3.org/2001/XMLSchema#boolean <http://example.com/p> <https://example.com/s>.

Which could perhaps be excused in that it is invalid turtle so behaviour is undefined. But the same result occurs when using text/n3 format for the writer, while this is valid N3.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions