Skip to content

N-Quads are written if N-Triples are requested and graph is supplied #165

@thombohlk

Description

@thombohlk

When using a Writer with format N-Triples and adding quads that include a graph, the writer will output in N-Quads format.

Code (using N3.js version 1.0.4):

var N3 = require('../N3');
const writer = new N3.Writer({ format:'N-Triples' });
writer.addQuad(
  N3.DataFactory.namedNode('http://example.org/cartoons#Tom'),
  N3.DataFactory.namedNode('http://www.w3.org/1999/02/22-rdf-syntax-ns#type'),
  N3.DataFactory.namedNode('http://example.org/cartoons#Cat'),
  N3.DataFactory.namedNode('http://example.org/cartoons#Graph')
);

writer.end((error, result) => console.log(result));

Output:

<http://example.org/cartoons#Tom> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.org/cartoons#Cat> <http://example.org/cartoons#Graph> .

I would expect the writer to ignore the graph when I ask for the N-Triples format.

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions