S - the storage system actually used by this provider.public interface OntologyProvider<S>
| Modifier and Type | Interface and Description |
|---|---|
static class |
OntologyProvider.Status
The status of a stored ontology entry in the
OntologyProvider. |
| Modifier and Type | Field and Description |
|---|---|
static String |
GRAPH_PREFIX
The key used to configure the prefix to be used for addressing ontologies stored by this provider.
|
static String |
IMPORT_POLICY
The key used to configure the import management policy.
|
static String |
META_GRAPH_ID
The key used to configure the identifier of the meta-level graph
|
static String |
RESOLVE_IMPORTS
The key used to configure the default import resolution policy for this provider.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
addAlias(org.semanticweb.owlapi.model.OWLOntologyID primaryKey,
org.semanticweb.owlapi.model.OWLOntologyID alias) |
org.semanticweb.owlapi.model.OWLOntologyID |
createBlankOntologyEntry(org.semanticweb.owlapi.model.OWLOntologyID publicKey) |
ImportManagementPolicy |
getImportManagementPolicy()
Gets the policy adopted by this provider whenever an import statement is found in an ontology that
has already been loaded (e.g. when exporting it).
|
String |
getKey(org.semanticweb.owlapi.model.IRI ontologyIri)
Deprecated.
public keys are now of type
OWLOntologyID and should match ontologyIri, or
derivative versioned IDs, whenever possible. |
String |
getKey(org.semanticweb.owlapi.model.OWLOntologyID ontologyId)
Deprecated.
public keys are now of type
OWLOntologyID and should match ontologyId. To obtain
alternate public keys (aliases) or versioned public keys, see
listAliases(OWLOntologyID) and listVersions(IRI) respectively. |
<O extends org.apache.clerezza.rdf.core.TripleCollection> |
getMetaGraph(Class<O> returnType)
Returns the graph that stores all the information on stored ontologies.
|
org.semanticweb.owlapi.model.OWLOntologyID |
getOntologyId(String storageKey)
Deprecated.
|
OntologyNetworkConfiguration |
getOntologyNetworkConfiguration()
Deprecated.
|
Multiplexer |
getOntologyNetworkDescriptor()
XXX This method is temporary until
Multiplexer becomes an OSGi component. |
String |
getPublicKey(org.semanticweb.owlapi.model.OWLOntologyID ontologyId)
Deprecated.
public keys are now of type
OWLOntologyID and should match ontologyId. To obtain
alternate public keys (aliases) or versioned public keys, see
listAliases(OWLOntologyID) and listVersions(IRI) respectively. |
Set<org.semanticweb.owlapi.model.OWLOntologyID> |
getPublicKeys()
Deprecated.
Please use
listPrimaryKeys() instead. |
OntologyProvider.Status |
getStatus(org.semanticweb.owlapi.model.OWLOntologyID publicKey) |
S |
getStore()
Returns the storage system used by this ontology provider (e.g. a
TcProvider or an
OWLOntologyManager). |
<O> O |
getStoredOntology(org.semanticweb.owlapi.model.IRI reference,
Class<O> returnType)
Deprecated.
|
<O> O |
getStoredOntology(org.semanticweb.owlapi.model.IRI reference,
Class<O> returnType,
boolean merge)
Deprecated.
|
<O> O |
getStoredOntology(org.semanticweb.owlapi.model.OWLOntologyID reference,
Class<O> returnType) |
<O> O |
getStoredOntology(org.semanticweb.owlapi.model.OWLOntologyID reference,
Class<O> returnType,
boolean merge) |
<O> O |
getStoredOntology(String key,
Class<O> returnType)
Deprecated.
|
<O> O |
getStoredOntology(String key,
Class<O> returnType,
boolean forceMerge)
Deprecated.
|
Class<?>[] |
getSupportedReturnTypes()
Returns an array containing the most specific types for ontology objects that this provider can manage
and return on a call to
getStoredOntology(String, Class). |
boolean |
hasOntology(org.semanticweb.owlapi.model.IRI ontologyIri)
Deprecated.
|
boolean |
hasOntology(org.semanticweb.owlapi.model.OWLOntologyID publicKey)
Deprecated.
the notion of "having an ontology" has become ambiguous. Please use
getStatus(OWLOntologyID) and verify its value. |
Set<org.semanticweb.owlapi.model.OWLOntologyID> |
listAliases(org.semanticweb.owlapi.model.OWLOntologyID publicKey)
Returns all the alternate public keys of the ontology identified by the supplied public key.
|
Set<org.semanticweb.owlapi.model.OWLOntologyID> |
listAllRegisteredEntries() |
Set<org.semanticweb.owlapi.model.OWLOntologyID> |
listOrphans() |
Set<org.semanticweb.owlapi.model.OWLOntologyID> |
listPrimaryKeys()
Returns the public keys of all the ontologies stored by this provider.
|
Set<org.semanticweb.owlapi.model.OWLOntologyID> |
listVersions(org.semanticweb.owlapi.model.IRI ontologyIri)
Returns all the public keys of the ontologies whose ontology IRI matches the one supplied,a nd which
differ by version IRI.
|
org.semanticweb.owlapi.model.OWLOntologyID |
loadInStore(InputStream data,
String formatIdentifier,
boolean force,
Origin<?>... references)
Retrieves an ontology by reading its content from a data stream and stores it using the storage system
attached to this provider.
|
org.semanticweb.owlapi.model.OWLOntologyID |
loadInStore(org.semanticweb.owlapi.model.IRI location,
String formatIdentifier,
boolean force,
Origin<?>... references)
Retrieves an ontology physically located at
location (unless mapped otherwise by the
offline configuration) and stores it using the storage system attached to this provider. |
org.semanticweb.owlapi.model.OWLOntologyID |
loadInStore(Object ontology,
boolean force,
Origin<?>... references)
Stores an ontology that has already been loaded into an object.
|
boolean |
removeOntology(org.semanticweb.owlapi.model.OWLOntologyID publicKey)
Removes the ontology identified by the supplied public key.
|
void |
setImportManagementPolicy(ImportManagementPolicy policy)
Sets the policy adopted by this provider whenever an import statement is found in an ontology that
has already been loaded (e.g. when exporting it).
|
void |
setLocatorMapping(org.semanticweb.owlapi.model.IRI locator,
org.semanticweb.owlapi.model.OWLOntologyID publicKey)
Deprecated.
this is now done by setting aliases. See
addAlias(OWLOntologyID, OWLOntologyID). |
void |
setLocatorMapping(org.semanticweb.owlapi.model.IRI locator,
String key)
Deprecated.
this is now done by setting aliases. See
addAlias(OWLOntologyID, OWLOntologyID). |
static final String GRAPH_PREFIX
static final String IMPORT_POLICY
static final String META_GRAPH_ID
static final String RESOLVE_IMPORTS
boolean addAlias(org.semanticweb.owlapi.model.OWLOntologyID primaryKey,
org.semanticweb.owlapi.model.OWLOntologyID alias)
org.semanticweb.owlapi.model.OWLOntologyID createBlankOntologyEntry(org.semanticweb.owlapi.model.OWLOntologyID publicKey)
ImportManagementPolicy getImportManagementPolicy()
String getKey(org.semanticweb.owlapi.model.IRI ontologyIri)
OWLOntologyID and should match ontologyIri, or
derivative versioned IDs, whenever possible.ontologyIri - the logical identifier of the ontology.listVersions(IRI),
listAliases(OWLOntologyID)String getKey(org.semanticweb.owlapi.model.OWLOntologyID ontologyId)
OWLOntologyID and should match ontologyId. To obtain
alternate public keys (aliases) or versioned public keys, see
listAliases(OWLOntologyID) and listVersions(IRI) respectively.ontologyId - the logical identifier of the ontology.listVersions(IRI),
listAliases(OWLOntologyID)<O extends org.apache.clerezza.rdf.core.TripleCollection> O getMetaGraph(Class<O> returnType)
Graph or a MGraph depends on the provider's policy on allowing external
modifications to the meta-level graph or not.returnType - @Deprecated org.semanticweb.owlapi.model.OWLOntologyID getOntologyId(String storageKey)
@Deprecated OntologyNetworkConfiguration getOntologyNetworkConfiguration()
Multiplexer getOntologyNetworkDescriptor()
Multiplexer becomes an OSGi component.String getPublicKey(org.semanticweb.owlapi.model.OWLOntologyID ontologyId)
OWLOntologyID and should match ontologyId. To obtain
alternate public keys (aliases) or versioned public keys, see
listAliases(OWLOntologyID) and listVersions(IRI) respectively.ontologyId - listVersions(IRI),
listAliases(OWLOntologyID)Set<org.semanticweb.owlapi.model.OWLOntologyID> getPublicKeys()
listPrimaryKeys() instead.OntologyProvider.Status getStatus(org.semanticweb.owlapi.model.OWLOntologyID publicKey)
S getStore()
TcProvider or an
OWLOntologyManager).<O> O getStoredOntology(org.semanticweb.owlapi.model.IRI reference,
Class<O> returnType)
getStoredOntology(String, Class), but instead of the internal key it
uses an IRI that publicly identifies or references an ontology. This can be, ordered by
preference most relevant first:
reference - the IRI that references the ontology.returnType - the desired type that the method should return, if supported, otherwise an
UnsupportedOperationException is thrown. Can be null, in which case a default return
type is chosen.<O> O getStoredOntology(org.semanticweb.owlapi.model.IRI reference,
Class<O> returnType,
boolean merge)
getStoredOntology(String, Class, boolean), but instead of the internal
key it uses an IRI that publicly identifies or references an ontology. This can be, ordered by
preference most relevant first:reference - the IRI that references the ontology.returnType - The expected type for the returned ontology object. If null, the provider will arbitrarily
select a supported return type. If the supplied type is not supported (i.e. not assignable
to any type contained in the result of getSupportedReturnTypes()) an
UnsupportedOperationException should be thrown.forceMerge - if true, the ontology will be merged with all its imports, thus overriding the import
management policy set for this provider.<O> O getStoredOntology(org.semanticweb.owlapi.model.OWLOntologyID reference,
Class<O> returnType)
<O> O getStoredOntology(org.semanticweb.owlapi.model.OWLOntologyID reference,
Class<O> returnType,
boolean merge)
<O> O getStoredOntology(String key, Class<O> returnType)
key - the key used to identify the ontology in this provider. They can or cannot coincide with the
logical and/or physical IRI of the ontology.returnType - The expected type for the returned ontology object. If null, the provider will arbitrarily
select a supported return type. If the supplied type is not supported (i.e. not assignable
to any type contained in the result of getSupportedReturnTypes()) an
UnsupportedOperationException should be thrown.<O> O getStoredOntology(String key, Class<O> returnType, boolean forceMerge)
key - the key used to identify the ontology in this provider. They can or cannot coincide with the
logical and/or physical IRI of the ontology.returnType - The expected type for the returned ontology object. If null, the provider will arbitrarily
select a supported return type. If the supplied type is not supported (i.e. not assignable
to any type contained in the result of getSupportedReturnTypes()) an
UnsupportedOperationException should be thrown.forceMerge - if true, the ontology will be merged with all its imports, thus overriding the import
management policy set for this provider.Class<?>[] getSupportedReturnTypes()
getStoredOntology(String, Class).boolean hasOntology(org.semanticweb.owlapi.model.IRI ontologyIri)
getStoredOntology(IRI, Class) and null-checking
the result.ontologyIri - boolean hasOntology(org.semanticweb.owlapi.model.OWLOntologyID publicKey)
getStatus(OWLOntologyID) and verify its value.getStoredOntology(IRI, Class) and checking
if the returned value is not null.publicKey - the ontology id. If there is both an ontology IRI and a version IRI, both must match the
ontology provider's records in order to return true. Otherwise, it will return true iff
any match with the ontology IIR is found, no matter its version IRI.Set<org.semanticweb.owlapi.model.OWLOntologyID> listAliases(org.semanticweb.owlapi.model.OWLOntologyID publicKey)
publicKey - the public key of the ontology. It could be an alias itself.Set<org.semanticweb.owlapi.model.OWLOntologyID> listAllRegisteredEntries()
Set<org.semanticweb.owlapi.model.OWLOntologyID> listOrphans()
Set<org.semanticweb.owlapi.model.OWLOntologyID> listPrimaryKeys()
Set<org.semanticweb.owlapi.model.OWLOntologyID> listVersions(org.semanticweb.owlapi.model.IRI ontologyIri)
ontologyIri - the ontology IRI to matchorg.semanticweb.owlapi.model.OWLOntologyID loadInStore(InputStream data, String formatIdentifier, boolean force, Origin<?>... references) throws IOException, org.apache.clerezza.rdf.core.serializedform.UnsupportedFormatException
data - the ontology content.formatIdentifier - the MIME type of the expected serialization format of this ontology. If null, all supported
formats will be tried until all parsers fail or one succeeds. Whether the supplied format
will be the only one to be attempted, or simply the preferred one, is left to arbitration
and is implementation-dependent.force - if true, all mappings provided by the offline configuration will be ignored (both for the
root ontology and its recursive imports) and the provider will forcibly try to resolve the
location IRI. If some remote import is found, the import policy is aggressive and Stanbol is
set on offline mode, this method will fail.IOException - if all attempts to load the ontology failed.org.apache.clerezza.rdf.core.serializedform.UnsupportedFormatException - if no parsers are able to parse the supplied format (or the actual file format).org.semanticweb.owlapi.model.OWLOntologyID loadInStore(org.semanticweb.owlapi.model.IRI location,
String formatIdentifier,
boolean force,
Origin<?>... references)
throws IOException
location (unless mapped otherwise by the
offline configuration) and stores it using the storage system attached to this provider. A key that can
be used to identify the ontology in this provider is returned if successful.location - the physical IRI where the ontology is located.formatIdentifier - the MIME type of the expected serialization format of this ontology. If null, all supported
formats will be tried until all parsers fail or one succeeds. Whether the supplied format
will be the only one to be attempted, or simply the preferred one, is left to arbitration
and is implementation-dependent.force - if true, all mappings provided by the offline configuration will be ignored (both for the
root ontology and its recursive imports) and the provider will forcibly try to resolve the
location IRI. If the IRI is not local and Stanbol is set on offline mode, this method will
fail.IOException - if all attempts to load the ontology failed.org.apache.clerezza.rdf.core.serializedform.UnsupportedFormatException - if no parsers are able to parse the supplied format (or the actual file format).org.semanticweb.owlapi.model.OWLOntologyID loadInStore(Object ontology, boolean force, Origin<?>... references)
ontology - the ontology to be stored.force - if true, all mappings provided by the offline configuration will be ignored (both for the
root ontology and its recursive imports) and the provider will forcibly try to resolve the
location IRI. If some remote import is found, the import policy is aggressive and Stanbol is
set on offline mode, this method will fail.boolean removeOntology(org.semanticweb.owlapi.model.OWLOntologyID publicKey)
throws OntologyHandleException
publicKey - the public key for accessing the ontology.OntologyHandleExceptionvoid setImportManagementPolicy(ImportManagementPolicy policy)
policy - the import management policy.void setLocatorMapping(org.semanticweb.owlapi.model.IRI locator,
org.semanticweb.owlapi.model.OWLOntologyID publicKey)
addAlias(OWLOntologyID, OWLOntologyID).IllegalArgumentException
will be thrown.locator - a physical location for this ontology.publicKey - the public key of the stored ontology.void setLocatorMapping(org.semanticweb.owlapi.model.IRI locator,
String key)
addAlias(OWLOntologyID, OWLOntologyID).locator - key - Copyright © 2010-2014 The Apache Software Foundation. All Rights Reserved.