Interface SWRLAPIOWLOntology


  • public interface SWRLAPIOWLOntology
    Wraps the OWLAPI's OWLOntology class with additional functionality used by the SWRLAPI. Primarily it provides methods for dealing with SWRL rules and SQWRL queries.

    The SWRLAPIRule class provides an equivalent wrapping of the OWLAPI's SWRLRule. The SWRLAPI also provides a range of types extending the OWLAPI's SWRLDArgument interface to define arguments to built-in atoms. This extension point is defined by the SWRLBuiltInArgument interface, which extends the OWLAPI's SWRLDArgument interface. A SWRLAPIOWLOntology will construct SWRLAPI rules from the SWRL rules in an OWLAPI-based ontology to contain these additional built-in argument types.

    The startEventFreezeMode(), finishEventFreezeMode(), hasOntologyChanged(), and resetOntologyChanged() methods can be used for optimization purposes. For example, in the Protege-OWL API the startEventFreezeMode() method turns off listener notification so that bulk transfer of OWL axioms can be performed more efficiently. The hasOntologyChanged() method can be used by rule engines to avoid unnecessary regeneration of knowledge.

    See Also:
    SWRLAPIRule, SQWRLQuery, OWLOntology
    • Method Detail

      • registerRuleEngineModel

        void registerRuleEngineModel​(SWRLRuleEngineModel swrlRuleEngineModel)
        Parameters:
        swrlRuleEngineModel - A SWRL rule engine model
      • unregisterRuleEngineModel

        void unregisterRuleEngineModel​(SWRLRuleEngineModel swrlRuleEngineModel)
        Parameters:
        swrlRuleEngineModel - A SWRL rule engine model
      • getSWRLRules

        @NonNull java.util.Set<@NonNull SWRLAPIRule> getSWRLRules()
      • createSWRLRule

        @NonNull SWRLAPIRule createSWRLRule​(@NonNull java.lang.String ruleName,
                                            @NonNull java.lang.String rule,
                                            @NonNull java.lang.String comment,
                                            boolean isActive)
                                     throws SWRLParseException,
                                            SWRLBuiltInException
        Parameters:
        ruleName - The name of the rule
        rule - Rule text
        comment - A comment associated with the rule
        isActive - Is the rule active
        Returns:
        The rule representation
        Throws:
        SWRLParseException - If an error occurs during parsing
        SWRLBuiltInException
      • replaceSWRLRule

        void replaceSWRLRule​(@NonNull java.lang.String originalRuleName,
                             @NonNull java.lang.String ruleName,
                             @NonNull java.lang.String rule,
                             @NonNull java.lang.String comment,
                             boolean isActive)
                      throws SWRLParseException,
                             SWRLBuiltInException
        Parameters:
        originalRuleName - The original name of the rule
        ruleName - The new name of the rule
        rule - The rule text
        comment - A comment associated with the rule
        isActive - Is the rule active
        Throws:
        SWRLParseException - If a parse error occurs
        SWRLBuiltInException
      • deleteSWRLRule

        void deleteSWRLRule​(@NonNull java.lang.String ruleName)
      • generateRuleAnnotations

        @NonNull java.util.Set<@NonNull org.semanticweb.owlapi.model.OWLAnnotation> generateRuleAnnotations​(@NonNull java.lang.String ruleName,
                                                                                                            @NonNull java.lang.String comment,
                                                                                                            boolean isRuleEnabled)
        Parameters:
        ruleName - The name of the rule
        comment - A comment for the rule
        isRuleEnabled - Is the rule enabled
        Returns:
        A set of rule annotations
      • isSWRLBuiltInIRI

        boolean isSWRLBuiltInIRI​(@NonNull org.semanticweb.owlapi.model.IRI iri)
      • isSWRLBuiltIn

        boolean isSWRLBuiltIn​(@NonNull java.lang.String prefixedName)
      • getSWRLBuiltInIRIs

        @NonNull java.util.Set<@NonNull org.semanticweb.owlapi.model.IRI> getSWRLBuiltInIRIs()
      • swrlBuiltInPrefixedName2IRI

        java.util.Optional<@NonNull org.semanticweb.owlapi.model.IRI> swrlBuiltInPrefixedName2IRI​(@NonNull java.lang.String prefixedName)
      • createSWRLParser

        @NonNull SWRLParser createSWRLParser()
      • getNextRuleName

        @NonNull java.util.Optional<java.lang.String> getNextRuleName()
        Returns:
        A rule name
      • getSQWRLQueryNames

        @NonNull java.util.Set<@NonNull java.lang.String> getSQWRLQueryNames()
      • getSQWRLQueries

        @NonNull java.util.Set<@NonNull SQWRLQuery> getSQWRLQueries()
      • reset

        void reset()
      • startEventFreezeMode

        void startEventFreezeMode()
      • finishEventFreezeMode

        void finishEventFreezeMode()
      • hasOntologyChanged

        boolean hasOntologyChanged()
      • resetOntologyChanged

        void resetOntologyChanged()
      • hasAssertedOWLAxiom

        boolean hasAssertedOWLAxiom​(org.semanticweb.owlapi.model.OWLAxiom axiom)
      • getOWLAxioms

        @NonNull java.util.Set<@NonNull org.semanticweb.owlapi.model.OWLAxiom> getOWLAxioms()
      • getNumberOfSWRLRules

        int getNumberOfSWRLRules()
      • getNumberOfOWLAxioms

        int getNumberOfOWLAxioms()
      • getNumberOfOWLClassDeclarationAxioms

        int getNumberOfOWLClassDeclarationAxioms()
      • getNumberOfOWLIndividualDeclarationAxioms

        int getNumberOfOWLIndividualDeclarationAxioms()
      • getNumberOfOWLObjectPropertyDeclarationAxioms

        int getNumberOfOWLObjectPropertyDeclarationAxioms()
      • getNumberOfOWLDataPropertyDeclarationAxioms

        int getNumberOfOWLDataPropertyDeclarationAxioms()
      • getIRIResolver

        @NonNull IRIResolver getIRIResolver()
      • getOWLOntologyManager

        @NonNull org.semanticweb.owlapi.model.OWLOntologyManager getOWLOntologyManager()
      • getOWLOntology

        @NonNull org.semanticweb.owlapi.model.OWLOntology getOWLOntology()
      • getOWLDataFactory

        @NonNull org.semanticweb.owlapi.model.OWLDataFactory getOWLDataFactory()