opencaesar / owl-adapter

The OML adapter for OWL
Apache License 2.0
0 stars 2 forks source link

[BUG] - Oml2OwlTask fails silently if input files are missing. #35

Closed NicolasRouquette closed 3 years ago

NicolasRouquette commented 3 years ago

Description

A clear and concise description of what the bug is.

If an IRI cannot be resolved to a file, Oml2OwlTask should fail with an error about the unresolved IRI.

Steps to Reproduce

See this Travis-CI build log: https://travis-ci.org/github/opencaesar/jpl-vocabularies/builds/735884111

> Task :omlToOwl
Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.5/userguide/command_line_interface.html#sec:command_line_warnings
BUILD SUCCESSFUL in 2m 8s
2 actionable tasks: 2 executed
The command "./gradlew omlToOwl" exited with 0.
0.00s$ echo `pwd`
/home/travis/build/opencaesar/jpl-vocabularies
The command "echo `pwd`" exited with 0.
0.01s$ find . -name 'mission.*'
./src/oml/imce.jpl.nasa.gov/foundation/mission.oml
./build/owl/src/oml/imce.jpl.nasa.gov/foundation/mission.owl
The command "find . -name 'mission.*'" exited with 0.
0.01s$ find . -name '80000-6-kindsOfQuantities.*'
The command "find . -name '80000-6-kindsOfQuantities.*'" exited with 0.
0.01s$ find . -name 'bundle.*'
./src/oml/imce.jpl.nasa.gov/foundation/bundle.oml
The command "find . -name 'bundle.*'" exited with 0.
3.81s$ ./gradlew owlReason
...
> Task :owlReason FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':owlReason'.
> OWLOntologyCreationIOException: java.io.FileNotFoundException: /home/travis/build/opencaesar/jpl-vocabularies/build/owl/src/oml/imce.jpl.nasa.gov/foundation/bundle.owl (No such file or directory)

The source file, ./src/oml/imce.jpl.nasa.gov/foundation/bundle.oml, contained:

vocabulary bundle <http://imce.jpl.nasa.gov/foundation/bundle> with # as foundation-bundle {
    includes <http://imce.jpl.nasa.gov/foundation/project>
    includes <http://iso.org/80000-6-kindsOfQuantities>
}

Unfortunately, due to Travis' build cache, the dependency was not refreshed and consequently there was a missing file as evidenced by the find command above:

$ find . -name '80000-6-kindsOfQuantities.*'
The command "find . -name '80000-6-kindsOfQuantities.*'" exited with 0.

The Oml2OwlTask should have reported a failure, i.e., the IRI <http://iso.org/80000-6-kindsOfQuantities> failed to resolve to a file. Instead, it ignored the error and did not map the OML source, ./src/oml/imce.jpl.nasa.gov/foundation/bundle.oml to OWL.

Steps to reproduce the behavior:

Expected Behavior

A clear and concise description of what should be the expected behavior.

Additional Context

Enter any other details such as dependencies, environment, examples, etc.

Relevant screenshots

If applicable, add screenshots to help illustrate the issue.

melaasar commented 3 years ago

I think this problem would be caught now by the OmlValidator tool which is invoked internally by the Owl Adapter. Can you please retry this scenario and close if unreproducible?

NicolasRouquette commented 3 years ago

I agree that the oml validator will detect this problem.