TopQuadrant / shacl

SHACL API in Java based on Apache Jena
Apache License 2.0
217 stars 61 forks source link

output is not always valid ttl #157

Open majidaldo opened 10 months ago

majidaldo commented 10 months ago

The default logging goes to stdout. If warnings are produced in the process, then the output is not valid ttl.

Possible solutions:

afs commented 10 months ago

Default to have logging output go to stderr.

majidaldo commented 10 months ago

Default to have logging output go to stderr.

well, for (actual) errors from the log. warnings would be ok. but are there "info" log messages?

afs commented 10 months ago

Looks to me like INFO goes to the same logger.

HolgerKnublauch commented 10 months ago

FMI: Which parts of my code base actually produce logging messages?

afs commented 10 months ago

@majidaldo

but are there "info" log messages?

is that speculation or have you seen INFO messages?

afs commented 10 months ago

FMI: Which parts of my code base actually produce logging messages?

Searching for an import of org.slf4j.Logger should find the possible places.

majidaldo commented 10 months ago

@majidaldo

but are there "info" log messages?

is that speculation or have you seen INFO messages?

speculation.

majidaldo commented 10 months ago

regardless, the logging output should distinguish b/w errors (program must stop) and non-errors (warnings and info).

HolgerKnublauch commented 10 months ago

It would help if you could provide some details or even a PR. What is the problem specifically?

WouterLubbers commented 10 months ago

Example of a warning, produced by executing 'shaclinfer'. The SHACL API tries to read owl:imports objects in the input files, but cannot find them.

afbeelding

majidaldo commented 10 months ago

Example of a warning, produced by executing 'shaclinfer'. The SHACL API tries to read owl:imports objects in the input files, but cannot find them.

afbeelding

thanks.

in this case it shouldn't even be a warning. it should fail and the program should exit with a non-zero code. i get around this with my own program wrapper where i fail the program if there is any exception message in the output. not ideal.

rmfranken commented 10 months ago

I would disagree that the program should exit - as the error indicates - this is a "WARN". A warning should not cause a failure of the program in my opinion. Isn't it a bit nuclear to stop and fail the whole program because an external ontology could not be imported?

majidaldo commented 10 months ago

I would disagree that the program should exit - as the error indicates - this is a "WARN". A warning should not cause a failure of the program in my opinion. Isn't it a bit nuclear to stop and fail the whole program because an external ontology could not be imported?

I agree that warnings should not exit.

But Program output should be deterministic. Same output for same input. Here inferencing and validation depends on imported ontologies.

afs commented 10 months ago

OntDocumentManager.setReadFailureHandler allows for different failure handling choices.

HolgerKnublauch commented 10 months ago

Thanks, happy to take PRs from anyone...

majidaldo commented 9 months ago

here's another case where a warning is not acceptable due to malformed (?) uuid.

 WARN  riot       :: [line: 83874, col: 1 ] Bad IRI: Not a valid UUID string: urn:uuid:anon:7e429cf2-12e8-4456-bde5-e1a79004ef1b\n16:12:43