Skip to content

Using riot with N-Quads input with named graphs and N-Triples/Turtle output silently drops part of the input #1873

@aucampia

Description

@aucampia

Version

4.8.0

What happened?

Given this N-Quads input (saved as test/data/variants/diverse_quads.nq) that contains triples with graphs labels [ref] (i.e. contains named graphs[ref]):

<http://example.com/subject> <http://example.com/predicate> "日本語の表記体系"@jpx <example:graph> .
<urn:example:subject> <example:predicate> <example:subject> <example:graph> .
<example:subject> <example:predicate> <example:object> <example:graph> .
<example:subject> <example:predicate> "12"^^<http://www.w3.org/2001/XMLSchema#integer> <example:graph> .
<example:subject> <example:predicate> <example:object> <urn:example:graph> .
<example:subject> <http://example.com/predicate> <http://example.com/object> <urn:example:graph> .
<example:subject> <http://example.com/predicate> "XSD string" <urn:example:graph> .
<example:subject> <example:predicate> <example:object> .
<http://example.com/subject> <http://example.com/predicate> "typeless" .
<urn:example:subject> <urn:example:predicate> <urn:example:object> .

When processing it with riot --syntax=nquads --formatted=ntriples, riot generates output and no error, but the output only contains the triples from the default graph.

$ jbang run --main riotcmd.riot --deps='org.slf4j:slf4j-simple:1.7+' 'org.apache.jena:jena-cmds:4.8.0' --syntax=nquads --formatted=ntriples test/data/variants/diverse_quads.nq; echo status=$?
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
<http://example.com/subject> <http://example.com/predicate> "typeless" .
<example:subject> <example:predicate> <example:object> .
<urn:example:subject> <urn:example:predicate> <urn:example:object> .
status=0

I would expect it to at least exit with an error status code, and also preferably print an error message.

Relevant output and stacktrace

No response

Are you interested in making a pull request?

Maybe

Metadata

Metadata

Assignees

No one assigned

    Labels

    CmdCommand line toolsenhancementIncrementally add new feature

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions