Package openllet.owlapi
Interface OWLHelper
-
- All Superinterfaces:
FacetFactoryOWL,FacetManagerOWL,FacetOntologyOWL,FacetReasonerOWL,openllet.shared.tools.Logging,OWLManagementObject
- All Known Implementing Classes:
OWLAPILoader,OWLGenericTools,OWLSelfTools,OWLTools
public interface OWLHelper extends openllet.shared.tools.Logging, OWLManagementObject
Functions that help management of OWL related matters. NB: This interface should replace every occurrence of OWLTools every where it is possible.- Since:
- 2.5.1
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String_caseSeparatorstatic boolean_debugstatic java.lang.String_deltastatic java.lang.String_entitySeparatorstatic java.lang.String_fileExtentionstatic java.lang.String_fileExtentionPartstatic org.semanticweb.owlapi.model.OWLDocumentFormat_formatstatic org.semanticweb.owlapi.util.OWLDocumentFormatFactoryImpl_formatFactorystatic java.lang.String_innerSeparatorstatic java.lang.String_localProtocolstatic java.lang.String_prefixSeparatorstatic java.lang.String_protocolstatic java.lang.String_secureProtocolstatic java.lang.String_webSeparator
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description static org.semanticweb.owlapi.model.IRIbuildVersion(org.semanticweb.owlapi.model.IRI ontologyIRI, double version)static OWLHelpercreateLightHelper(java.io.InputStream inputStream)When you have finish use this Helper, you must call {dispose() and eventually getGroup().close()}static OWLHelpercreateLightHelper(OpenlletReasoner reasoner)When you have finish use this Helper, you must call {dispose() and eventually getGroup().close()}static OWLHelpercreateLightHelper(org.semanticweb.owlapi.model.OWLOntology ontology)When you have finish use this Helper, you must call {dispose() and eventually getGroup().close()}default OWLHelperderivate()Same as derivate but with a version number based on EPOCH time.default OWLHelperderivate(double version)Clone into another ontology with the same axioms and same manager.default java.util.stream.Stream<org.semanticweb.owlapi.model.OWLAxiom>deserializeAxioms(java.lang.String input)default voiddeserializeAxiomsInto(java.lang.String input)Axiom are parsed from the stream then add into the ontology.voiddispose()Dispose the reasoner attached to this helper.default java.lang.StringgetFragment(org.semanticweb.owlapi.model.IRI iri)This function exist because the one in IRI is deprecated and will be remove : We want the memory of calling it 'fragment' preserved.default java.lang.String[]getNameSpace(java.lang.String identifier)default java.util.Optional<org.semanticweb.owlapi.formats.PrefixDocumentFormat>getNamespaces()default java.util.Optional<org.semanticweb.owlapi.model.OWLOntology>getOntology(org.semanticweb.owlapi.model.OWLOntologyID ontologyID)The standard 'getOntology' from the OWLManager don't really take care of versionning.default org.semanticweb.owlapi.model.IRIgetRootIri()default org.semanticweb.owlapi.reasoner.NodeSet<org.semanticweb.owlapi.model.OWLClass>getTypes(org.semanticweb.owlapi.model.OWLIndividual ind)Compute the types of an individual.default doublegetVersion()static org.semanticweb.owlapi.model.OWLOntologyIDgetVersion(org.semanticweb.owlapi.model.IRI ontologyIRI, double version)static java.lang.Stringiri2filename(org.semanticweb.owlapi.model.IRI iri)booleanisVolatile()default java.util.Optional<OWLHelper>look(org.semanticweb.owlapi.model.IRI ontology)default java.util.Optional<OWLHelper>look(org.semanticweb.owlapi.model.IRI ontology, double version)static java.lang.Stringontology2filename(java.io.File directory, org.semanticweb.owlapi.model.OWLOntology ontology)static java.lang.Stringontology2filename(java.io.File directory, org.semanticweb.owlapi.model.OWLOntologyID ontId)default java.lang.StringontologyToString(java.lang.String msg)default java.lang.StringBufferontologyToString(java.lang.StringBuffer buff, java.lang.String msg)default java.lang.Stringpath(java.lang.String[] parts)default java.lang.StringremoveFirstLast(java.lang.String quoteExpression)default java.lang.String[]resolvPrefix(java.lang.String identifier)default java.lang.StringserializeAxioms()static voidsetFormat(org.semanticweb.owlapi.model.OWLOntology ontology)Add the export format in the configuration of the provided ontology-
Methods inherited from interface openllet.owlapi.facet.FacetFactoryOWL
getFactory
-
Methods inherited from interface openllet.owlapi.facet.FacetManagerOWL
getGroup, getManager
-
Methods inherited from interface openllet.owlapi.facet.FacetOntologyOWL
getOntology
-
Methods inherited from interface openllet.owlapi.facet.FacetReasonerOWL
getReasoner
-
Methods inherited from interface openllet.owlapi.OWLManagementObject
addAxiom, addAxioms, addClass, addClass, addClassPropertyAxiom, addDataPropertyAxiom, addDataPropertyAxiom, addDataPropertyAxiom, addDataPropertyAxiom, addDataPropertyAxiom, addObject, addObject, addObjectPropertyAxiom, addValue, addValue, addValue, addValue, addValue, addValue, addValue, addValue, declareClass, declareClassOfIndividual, declareDataProperty, declareIndividual, declareIndividual, declareIndividual, declareIndividual, declareIndividual, declareObjectProperty, getObject, getObject, getObjects, getObjects, getValue, getValue, getValues, getValues, individualHaveFacet, isLiteralIncludeInRange, removeAxiom, removeAxioms, removeDataPropertyAxiom, removeDataPropertyAxiom, removeDataPropertyAxiom, removeObjectPropertyAxiom, removeObjectPropertyAxiom, removeObjectPropertyAxiom, toClass, toDataProperty, toIndividual, toObjectProperty, updateObject, updateObject, updateValue, updateValue, updateValue, updateValue, updateValue, updateValue, updateValue, updateValue
-
-
-
-
Field Detail
-
_debug
static final boolean _debug
- See Also:
- Constant Field Values
-
_protocol
static final java.lang.String _protocol
- See Also:
- Constant Field Values
-
_secureProtocol
static final java.lang.String _secureProtocol
- See Also:
- Constant Field Values
-
_localProtocol
static final java.lang.String _localProtocol
- See Also:
- Constant Field Values
-
_webSeparator
static final java.lang.String _webSeparator
- See Also:
- Constant Field Values
-
_prefixSeparator
static final java.lang.String _prefixSeparator
- See Also:
- Constant Field Values
-
_entitySeparator
static final java.lang.String _entitySeparator
- See Also:
- Constant Field Values
-
_innerSeparator
static final java.lang.String _innerSeparator
- See Also:
- Constant Field Values
-
_caseSeparator
static final java.lang.String _caseSeparator
- See Also:
- Constant Field Values
-
_fileExtention
static final java.lang.String _fileExtention
- See Also:
- Constant Field Values
-
_fileExtentionPart
static final java.lang.String _fileExtentionPart
- See Also:
- Constant Field Values
-
_delta
static final java.lang.String _delta
- See Also:
- Constant Field Values
-
_formatFactory
static final org.semanticweb.owlapi.util.OWLDocumentFormatFactoryImpl _formatFactory
-
_format
static final org.semanticweb.owlapi.model.OWLDocumentFormat _format
-
-
Method Detail
-
isVolatile
boolean isVolatile()
- Returns:
- true if this ontology isn't persistent.
- Since:
- 2.5.1
-
setFormat
static void setFormat(org.semanticweb.owlapi.model.OWLOntology ontology)
Add the export format in the configuration of the provided ontology- Parameters:
ontology- you consider.- Since:
- 2.6.1
-
buildVersion
static org.semanticweb.owlapi.model.IRI buildVersion(org.semanticweb.owlapi.model.IRI ontologyIRI, double version)- Parameters:
ontologyIRI- is the id of the ontology without version. The ontology name.version- is the short representation you want for this ontology.- Returns:
- the complete representation of the version for the given identifier of ontology.
- Since:
- 2.5.1
-
getVersion
static org.semanticweb.owlapi.model.OWLOntologyID getVersion(org.semanticweb.owlapi.model.IRI ontologyIRI, double version)- Parameters:
ontologyIRI- is the id of the ontology without version. The ontology name.version- is the short representation you want for this ontology.- Returns:
- the complete ontologyID
- Since:
- 2.6.0
-
iri2filename
static java.lang.String iri2filename(org.semanticweb.owlapi.model.IRI iri)
- Parameters:
iri- that should be use to generate a filename- Returns:
- a relative path filename that reflect the iri.
- Since:
- 2.5.1
-
ontology2filename
static java.lang.String ontology2filename(java.io.File directory, org.semanticweb.owlapi.model.OWLOntologyID ontId)- Parameters:
directory- where the ontology will be putontId- is the id the ontology to convert.- Returns:
- a full path filename that reflect the name of this ontology.
- Since:
- 2.5.1
-
ontology2filename
static java.lang.String ontology2filename(java.io.File directory, org.semanticweb.owlapi.model.OWLOntology ontology)- Parameters:
directory- where the ontology will be putontology- is the ontology from witch we want a name- Returns:
- a full path filename that reflect the name of this ontology.
- Since:
- 2.5.1
-
getNamespaces
default java.util.Optional<org.semanticweb.owlapi.formats.PrefixDocumentFormat> getNamespaces()
- Returns:
- the namespace utils that can resolve prefix.
- Since:
- 2.5.1
-
getRootIri
default org.semanticweb.owlapi.model.IRI getRootIri()
- Returns:
- the root of the default object insert in the ontology without namespace.
- Since:
- 2.5.1
-
getFragment
default java.lang.String getFragment(org.semanticweb.owlapi.model.IRI iri)
This function exist because the one in IRI is deprecated and will be remove : We want the memory of calling it 'fragment' preserved.- Returns:
- the NCNameSuffix
- Since:
- 2.5.1
-
getOntology
default java.util.Optional<org.semanticweb.owlapi.model.OWLOntology> getOntology(org.semanticweb.owlapi.model.OWLOntologyID ontologyID)
The standard 'getOntology' from the OWLManager don't really take care of versionning. This function is here to enforce the notion of version- Parameters:
ontologyID- with version information- Returns:
- the ontology if already load into the given manager.
- Since:
- 2.5.1
-
getVersion
default double getVersion()
- Returns:
- the shortest representation of the version of an ontology. Defaulting on 'zero' if no-version information.
- Since:
- 2.5.1
-
look
default java.util.Optional<OWLHelper> look(org.semanticweb.owlapi.model.IRI ontology, double version)
-
look
default java.util.Optional<OWLHelper> look(org.semanticweb.owlapi.model.IRI ontology)
-
derivate
default OWLHelper derivate(double version) throws org.semanticweb.owlapi.model.OWLOntologyCreationException
Clone into another ontology with the same axioms and same manager. NB : In a future version this function may return an ontology that share axiom with previous for memory saving.- Parameters:
version- that will have the new ontology.- Returns:
- a new ontology with the axioms of the given one.
- Throws:
org.semanticweb.owlapi.model.OWLOntologyCreationException- if we can't create the ontology.- Since:
- 2.5.1
-
derivate
default OWLHelper derivate() throws org.semanticweb.owlapi.model.OWLOntologyCreationException
Same as derivate but with a version number based on EPOCH time.- Returns:
- a new ontology with the axioms of the given one.
- Throws:
org.semanticweb.owlapi.model.OWLOntologyCreationException- if we can't create the ontology.- Since:
- 2.5.1
-
removeFirstLast
default java.lang.String removeFirstLast(java.lang.String quoteExpression)
- Parameters:
quoteExpression- an expression with " at begin and end.- Returns:
- the same expression without the first and last char.
- Since:
- 1.1
-
path
default java.lang.String path(java.lang.String[] parts)
- Parameters:
parts- of an uri- Returns:
- a join of all parts separated by an entitySeparator.
- Since:
- 2.5.1
-
resolvPrefix
default java.lang.String[] resolvPrefix(java.lang.String identifier)
- Parameters:
identifier- to resolve- Returns:
- parts of the identifiers using optionnaly prefix resolution.
- Since:
- 2.5.1
-
getNameSpace
default java.lang.String[] getNameSpace(java.lang.String identifier)
- Parameters:
identifier- of the data.- Returns:
- an array of size 2, with the first element that contain the namespace and the second that contain the fragment.
-
deserializeAxiomsInto
default void deserializeAxiomsInto(java.lang.String input) throws org.semanticweb.owlapi.model.OWLOntologyCreationException, java.io.IOExceptionAxiom are parsed from the stream then add into the ontology.- Parameters:
input- is a stream of axioms- Throws:
org.semanticweb.owlapi.model.OWLOntologyCreationException- if we can't load the ontology.java.io.IOException- if there is an problem when reading.- Since:
- 2.5.1
-
deserializeAxioms
default java.util.stream.Stream<org.semanticweb.owlapi.model.OWLAxiom> deserializeAxioms(java.lang.String input) throws org.semanticweb.owlapi.model.OWLOntologyCreationException, java.io.IOException- Parameters:
input- is a stream of axioms- Returns:
- the set of axiom contains in the input
- Throws:
org.semanticweb.owlapi.model.OWLOntologyCreationException- if we can't load the ontology.java.io.IOException- if there is an problem when reading.- Since:
- 2.5.1
-
serializeAxioms
default java.lang.String serializeAxioms() throws org.semanticweb.owlapi.model.OWLOntologyStorageException, java.io.IOException- Returns:
- the axioms as a single blob string.
- Throws:
org.semanticweb.owlapi.model.OWLOntologyStorageException- if we can't store the ontology.java.io.IOException- if there is an problem when reading. * @since 1.2- Since:
- 2.5.1
-
getTypes
default org.semanticweb.owlapi.reasoner.NodeSet<org.semanticweb.owlapi.model.OWLClass> getTypes(org.semanticweb.owlapi.model.OWLIndividual ind)
Compute the types of an individual. Use this function only if you mix Named and Anonymous individuals.- Parameters:
ind- the individual named _or_ anonymous- Returns:
- the classes of the individual.
- Since:
- 2.5.1
-
ontologyToString
default java.lang.StringBuffer ontologyToString(java.lang.StringBuffer buff, java.lang.String msg)- Parameters:
buff- is the target for the axioms rendered in DL syntaxmsg- is insert before and after the axioms to detach it from its background (use "" if you don't know what to do with that).- Returns:
- the given buffer
- Since:
- 2.5.1
-
ontologyToString
default java.lang.String ontologyToString(java.lang.String msg)
- Parameters:
msg- is insert before and after the axioms to detach it from its background (use "" if you don't know what to do with that).- Returns:
- the axioms rendered in DL syntax
- Since:
- 2.5.1
-
dispose
void dispose()
Dispose the reasoner attached to this helper. If the reasoner wasn't attached, it doesn't buildit.- Since:
- 2.6.3
-
createLightHelper
static OWLHelper createLightHelper(org.semanticweb.owlapi.model.OWLOntology ontology)
When you have finish use this Helper, you must call {dispose() and eventually getGroup().close()}- Parameters:
ontology- an already build ontology.- Returns:
- an helper
- Since:
- 2.6.3
-
createLightHelper
static OWLHelper createLightHelper(java.io.InputStream inputStream)
When you have finish use this Helper, you must call {dispose() and eventually getGroup().close()}- Parameters:
ontology- an already build ontology.- Returns:
- an helper
- Since:
- 2.6.3
-
createLightHelper
static OWLHelper createLightHelper(OpenlletReasoner reasoner)
When you have finish use this Helper, you must call {dispose() and eventually getGroup().close()}- Parameters:
ontology- an already build ontology.- Returns:
- an helper
- Since:
- 2.6.3
-
-