Interface OWLHelper

    • 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 put
        ontId - 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 put
        ontology - 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.IOException
        Axiom 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 syntax
        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 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