dgarijo / Widoco

Wizard for documenting ontologies. WIDOCO is a step by step generator of HTML templates with the documentation of your ontology. It uses the LODE environment to create part of the template.
Apache License 2.0
295 stars 89 forks source link

Allow loading local ontologies for imports #674

Closed vChavezB closed 7 months ago

vChavezB commented 10 months ago

This change allows to use local imports with the AutoIRIMapper from the owl api.

Motivation

I am working on a project that defines several ontologies. The pipeline generates the documentation for each of them in a single job and it imports online definitions. However, I have made local copies and this reduces the processing time from 5-6 minutes to 2 minutes.

Use cases

To enable this option use -import with a directory path. The option can be used multiple times in the same command line.

Feel free to add comments or feedback to improve this suggestion.

dgarijo commented 10 months ago

If you don't want to load the files from the web, why not changing the owl:imports with the local URL path?

This is currently not supported (see https://github.com/dgarijo/Widoco/issues/306), but having a local flag with the files to import is a bit of a hack, don't you think? The solution is quite similar to the one you proposed, but with the ability to load local files from the folder the ontology is declared.

vChavezB commented 10 months ago

I did not know about owl:import assertions to local URL paths. Nevertheless I consider this would add unecessary work to developers as each time before doing a merge to main they would need to change the paths.

Something similar that I do is use the catalog-v001.xml file in protege to point to local files while I develop the ontology. In the backend protege uses the SimpleIRIMapper. In this case I am using the AutoIRIMapper which can point to a directory and search recursively files of type RDF/XML, OWL/XML, Manchester OWL Syntax, Functional Syntax and OBO. In addition it supports pointing to zip and jar files containing ontologies.

For the use case of loading local imports from the path of the ontology that widoco is documenting I think you would also need one of these mapper clases from the owlapi. So this could be used to inspire something that was discussed in #306

dgarijo commented 7 months ago

@vChavezB after another view, I am merging this PR. I think the functionality is a nice step towards #306, and it's better to have a temporary solution than have none. Thanks again for your contirbutions