Skip to content

riot returns a non-zero exit code when only printing warnings #3628

@balhoff

Description

@balhoff

Version

5.6.0

What happened?

Running riot --validate myfile.ttl should exit with a non-zero code in the case of errors, which it does. However, it also exits with 1 when only WARN messages are printed. I tested a different operation not focused on validation, and found the same result: riot --count myfile.ttl.

I think if these warnings are considered errors and will fail the command, then they should be logged as errors. Alternatively, if they are really warnings, then the command should not fail. The non-zero exit code disrupts workflows which depend on a zero return code to continue.

One of the warnings I'm seeing which is leading to a 1 exit code is:

11:55:29 WARN  riot            :: [line: 8, col: 21] Lexical form '2021-01-18T10:30:00' not valid for datatype XSD date

(I do understand that the message is correct)

Here is a test file:

@prefix prov: <http://www.w3.org/ns/prov#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix sosa: <http://www.w3.org/ns/sosa/> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix ex: <http://example.org/> .

ex:AAL210144001R.20210112.1763231 a ex:Observation ;
    sosa:resultTime "2021-01-18T10:30:00"^^xsd:date .

Relevant output and stacktrace

Are you interested in making a pull request?

Maybe

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions