Interface SWRLRuleEngine

    • Method Detail

      • infer

        void infer()
            throws SWRLRuleEngineException
        Load rules and knowledge from OWL, send them to the rule engine, run the rule engine, and write any inferred knowledge back to OWL.
        Throws:
        SWRLRuleEngineException - If an error occurs during inference
      • importAssertedOWLAxioms

        void importAssertedOWLAxioms()
                              throws SWRLRuleEngineException
        Load asserted OWL axioms (which include SWRL rules) from a source OWL ontology.
        Throws:
        SWRLRuleEngineException - If an error occurs during inference
      • exportInferredOWLAxioms

        void exportInferredOWLAxioms()
                              throws SWRLRuleEngineException
        Write OWL axioms inferred by rule engine back to the source OWL ontology.
        Throws:
        SWRLRuleEngineException - If an error occurs during the export process
      • createSWRLRule

        @NonNull SWRLAPIRule createSWRLRule​(@NonNull java.lang.String ruleName,
                                            @NonNull java.lang.String rule,
                                            @NonNull java.lang.String comment,
                                            boolean isActive)
                                     throws SWRLParseException,
                                            SWRLBuiltInException
        Create a SWRL rule and associate a comment and active state with it.
        Parameters:
        ruleName - The name of the rule
        rule - The rule text
        comment - A comment associated with the rule
        isActive - Is the rule active
        Returns:
        A SWRL rule
        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 - If an error occurs during processing
      • getSWRLRules

        @NonNull java.util.Set<@NonNull SWRLAPIRule> getSWRLRules()
        Returns:
        A collection of SWRL rules
      • getSWRLRule

        java.util.Optional<@NonNull SWRLAPIRule> getSWRLRule​(@NonNull java.lang.String ruleName)
                                                      throws SWRLRuleException
        Parameters:
        ruleName - The name of the rule
        Returns:
        A SWRL rule
        Throws:
        SWRLRuleException - If an error occurs
      • deleteSWRLRule

        void deleteSWRLRule​(@NonNull java.lang.String ruleName)
        Parameters:
        ruleName - The name of a rule
      • isSWRLBuiltInIRI

        boolean isSWRLBuiltInIRI​(@NonNull org.semanticweb.owlapi.model.IRI iri)
        Parameters:
        iri - An IRI
        Returns:
        True if the IRI is a built-in
      • isSWRLBuiltIn

        boolean isSWRLBuiltIn​(@NonNull java.lang.String shortName)
        Parameters:
        shortName - An short name
        Returns:
        True if the short name is a built-in
      • getSWRLBuiltInIRIs

        @NonNull java.util.Set<@NonNull org.semanticweb.owlapi.model.IRI> getSWRLBuiltInIRIs()
        Returns:
        The IRIs of all SWRL built-ins
      • createSWRLParser

        @NonNull SWRLParser createSWRLParser()
        Returns:
        A SWRL parser
      • createSWRLAutoCompleter

        @NonNull SWRLAutoCompleter createSWRLAutoCompleter()
        Returns:
        A SWRL rule auto-completer
      • createSWRLRuleRenderer

        @NonNull SWRLRuleRenderer createSWRLRuleRenderer()
        Returns:
        A SWRL rule renderer
      • getRuleEngineName

        @NonNull java.lang.String getRuleEngineName()
        Get the name of this SWRL rule engine.
        Returns:
        A rule engine name
      • getRuleEngineVersion

        @NonNull java.lang.String getRuleEngineVersion()
        Get the version of the native rule engine implementing this SWRL rule engine
        Returns:
        A rule engine version
      • getOWLOntology

        @NonNull org.semanticweb.owlapi.model.OWLOntology getOWLOntology()
        Returns:
        The underlying OWL ontology
      • getOWL2RLEngine

        @NonNull OWL2RLEngine getOWL2RLEngine()
        Get the underlying OWL 2 RL reasoner used by the rule and query engine
        Returns:
        An OWL 2 RL engine
      • getOWLReasoner

        @NonNull org.semanticweb.owlapi.reasoner.OWLReasoner getOWLReasoner()
        A rule engine must also define an OWLReasoner.
        Returns:
        An OWL reasoner
      • loadExternalSWRLBuiltInLibraries

        void loadExternalSWRLBuiltInLibraries​(@NonNull java.io.File swrlBuiltInLibraryDirectory)
        Load user-defined SWRL built-in libraries See here for documentation on defining these libraries.
        Parameters:
        swrlBuiltInLibraryDirectory - The directory containing the libraries
      • getRuleEngineIcon

        @NonNull javax.swing.Icon getRuleEngineIcon()
        Returns:
        The rule engine's icon
      • getAssertedOWLAxioms

        @NonNull java.util.Set<@NonNull org.semanticweb.owlapi.model.OWLAxiom> getAssertedOWLAxioms()
        Returns:
        A collection of OWL axioms
      • getInferredOWLAxioms

        @NonNull java.util.Set<@NonNull org.semanticweb.owlapi.model.OWLAxiom> getInferredOWLAxioms()
        Returns:
        A collection of OWL axioms
      • getInjectedOWLAxioms

        @NonNull java.util.Set<@NonNull org.semanticweb.owlapi.model.OWLAxiom> getInjectedOWLAxioms()
        Returns:
        A collection of OWL axioms
      • getNumberOfImportedSWRLRules

        int getNumberOfImportedSWRLRules()
        Returns:
        The number of imported SWRL rules
      • getNumberOfAssertedOWLAxioms

        int getNumberOfAssertedOWLAxioms()
        Returns:
        The number of asserted OWL axioms
      • getNumberOfInferredOWLAxioms

        int getNumberOfInferredOWLAxioms()
        Returns:
        The number of inferred OWL axioms
      • getNumberOfInjectedOWLAxioms

        int getNumberOfInjectedOWLAxioms()
        Returns:
        The number of injected OWL axioms
      • getNumberOfAssertedOWLClassDeclarationAxioms

        int getNumberOfAssertedOWLClassDeclarationAxioms()
        Returns:
        The number of asserted OWL class declaration axioms
      • getNumberOfAssertedOWLIndividualDeclarationsAxioms

        int getNumberOfAssertedOWLIndividualDeclarationsAxioms()
        Returns:
        The number of asserted OWL individual declaration axioms
      • getNumberOfAssertedOWLObjectPropertyDeclarationAxioms

        int getNumberOfAssertedOWLObjectPropertyDeclarationAxioms()
        Returns:
        The number of asserted OWL object property declaration axioms
      • getNumberOfAssertedOWLDataPropertyDeclarationAxioms

        int getNumberOfAssertedOWLDataPropertyDeclarationAxioms()
        Returns:
        The number of asserted OWL data property declaration axioms
      • getSWRLAPIOWLOntology

        @NonNull SWRLAPIOWLOntology getSWRLAPIOWLOntology()
        Returns:
        The underlying OWL ontology