Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow loading local ontologies for imports #674

Merged
merged 1 commit into from
Apr 1, 2024

Conversation

vChavezB
Copy link
Contributor

@vChavezB vChavezB commented Jan 11, 2024

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

  • load imports locally for optimization of loading time instead of downloading.
  • Use local ontologies that are in development instead of pulling the current online version. Example Ontology A imports ontology B. Ontology B is also part of the main git repo of the developer. If Ontology B has changes that ontology A needs and are not online then there will be missing definitions.

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.

This change allows to use local imports with the
AutoIRIMapper from the owl api. The main use case
is to load imports locally for optimization of
loading time.

To enable this option use "-import" with a directory path.
The option can be used multiple times in the same command line.
@vChavezB vChavezB changed the base branch from master to develop January 11, 2024 19:05
@dgarijo
Copy link
Owner

dgarijo commented Jan 12, 2024

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 #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
Copy link
Contributor Author

vChavezB commented Jan 13, 2024

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
Copy link
Owner

dgarijo commented Apr 1, 2024

@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

@dgarijo dgarijo merged commit 286c13f into dgarijo:develop Apr 1, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants