Note: this page is here for historical and sentimental reasons.
Find the updated documentation here.
Utility Classes
The OWL API contains various utility classes that are designed to make common tasks easy. Some of these utility classes are documented below.Short Form Providers
In OWL, entities such as classes, properties and individuals are named using URIs. Since URIs can be long and not particularly readable, "short forms" of these URIs are often used for presentation in tools such as editors and end user applications. The API makes the ShortFormProvider interface available to provide a common point for this task. Stock implementations of short form providers are provided with the API. These include:- SimpleShortFormProvider - Generates short forms directly from URIs. In general, if the fragment of a URI is available (the part of the URI following the #) then this will be used for the short form.
- QNameShortFormProvider - Generates short forms that look like QNames. For example, "owl:Thing", "pizza:MarghertiaPizza"
- AnnotationValueShortFormProvider - Generates short forms using the values of annotation properties. This short form provider also allows preferred languages to be set up.
- PropertyAssertionValueShortFormProvider - Similar to AnnotationValueShortFormProvider, but can also be used for arbitrary property values.
- OntologyURIShortFormProvider - Generates short forms for ontology URIs
- BidirectionalShortFormProviderAdapter - Can be used to set up a bidirectional mapping between entities and their short forms. This utility class uses a short form provider to generate the mappings.
Mapping Ontology URIs to Physical URIs
The following utility classes are provided to make it easy to set up Ontology to Physical URI mappings. Mappers can be registered on instances of OWLOntologyManager using the addURIMapper method.- SimpleURIMapper - Maps a specific ontolog URI to a specific physical URI
- CommonBaseURIMapper - Makes it relatively efficient to map Ontology URIs to Physical URIs where the physical URI have a common base/prefix
- AutoURIMapper - Automatically generates Ontology URI to Physical URI mappings for ontologies that are contained in a specific folder.
Structural Checking/Inspection
- AxiomSubjectProvider - Gets the "subject" of an axiom. This is a slightly loose notion, but the subject of an axiom is regarded as being the entity that the axioms "defines". For example, SubClassOf(A, B) could be said to define class A.
- DLExpressivityChecker - Performs a syntactic analysis to discover the DL expressivty that is used in an ontology.
- NamedConjunctChecker - Checks to see if a conjunction contains at least one named class.
- OWLEntityCollector - Can be used to "visit" any number of OWLObjects, and will "collect" all of the entities that these objects reference.
- OWLDescriptionComparator - Can be used to sort OWLDescriptions based on some predifined ordering. (Although it should be noted that OWLObject extends the comparable interface anyway).
- OWLEntityRemover - Can be used to generated the changes that are required to remove all axioms that reference a particular entity.
- OWLEntityURIConverter - Can be used to perform a bulk conversion of entity URIs into some format. This class uses a pluggable strategy that defined how the conversion should take place.
- OWLOntologyMerger - Provides a convenient method of merging two or more ontologies into one.