Skip to content

[BUG] - Built-in ontology is somehow broken when used in submodules #60

@mprather

Description

@mprather

Description

Oml2Owl includes a list of default ontologies. link

In a scenario where you have a vocabulary A that utilizes the following statement

extends http://www.w3.org/2001/XMLSchema# as xsd

Everything works as expected when the project is run through the conversion stask.

However, if vocabulary A is used as a submodule in project B, then Oml2Task doesn't know what to do with xsd definition when project B is built.

The workaround: when A is included as a submodule, delete A's root catalog.xml file.

Steps to Reproduce

Steps to reproduce the behavior:

  • Create a simple vocabulary A. It should extend the XMLSchema namespace.
  • Verify A can be built as a standalone project.
  • Create a new project B that will use A.
  • Include A as a submodule
    • update B to use A's vocab file
    • update B's catalog.xml with the correct submodule path info
  • Build B

Result:

task ':downloadDependencies'
task ':omlToOwlModels'
  - [task ':downloadDependencies']
task ':owlReasonTestModels'
  - task ':omlToOwlModels'
task ':build'
  - task ':owlReasonTestModels'
> Task :omlToOwlModels FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':omlToOwlModels'.
>
  Diagnosis of Vocabulary http://namespaceA#
        Namespace <http://www.w3.org/2001/XMLSchema#> could not be resolved to a vocabulary

* Try:
Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Exception is:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':omlToOwlModels'.
        at io.opencaesar.oml2owl.Oml2OwlTask.run(Oml2OwlTask.java:215)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

Expected Behavior

Two general expectations:

  1. No failure. This is a built-in ontology that should always be available.
  2. No adjustments to the submodule's catalog.xml. The workaround requires the deletion of the file, which is artificially changes the state of the submodule.

Additional Context

Here's the general folder structures that have been tested to repro the problem.

As a folder in the root

Project B root
 |-- submodule A
 |-- <standard project folders>

As a folder in src/oml

Project B root
 |-- src
      | -- oml
            |-- submodule A
 |-- <standard project folders>

In both scenarios, once A's catalog file is removed everything works.

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions