The available OntologyStorer implementations are currently all hardcoded into the OWLManager class available from the apibinding module. This means that the apibinding module needs to have fixed dependencies on all of the modules providing the OntologyStorer implementations, even if they do not use the module otherwise.
I wrote a patch up that removes the dependency by referring to OntologyStorer implementations using their OWLOntologyFormat's as indirect references. In order to decouple apibinding from the other modules at compile time, this requires that the formats be defined in a different module to the OntologyStorer implementation that they refer to. To fix this, I moved the OWLOntologyFormat instances to a new package inside of the api module. These formats are used as the keys to access factories for each OntologyStorer using a java.util.ServiceLoader (ie, Service Provider Interface/SPI) implementation. After this patch I was able to switch the maven scopes for each of the relevant dependencies to runtime so that they can be excluded as necessary without affecting the operation of the OWLManager class. In addition, alternative implementations of any of the OntologyStorers can now be substituted at runtime and used by the OWLManager class without having to recompile OWLAPI, as the formats are used at runtime to find available implementations.
If other formats are to be included in OWLManager they would need to be added to the api module but the implementation does not have to be available when the format is added, as the system ignores any cases where a format did not have any available OntologyStorerFactory instances available.
You can find a patch at:
Log in to post a comment.