Class InvalidReferenceChecker


  • public class InvalidReferenceChecker
    extends Object
    Checks to determine if axioms contain invalid references: to dangling classes or deprecated classes.

    This is a structural check. To determine the *logical* validity of an axiom reference, robot uses OWL reasoning.

    See: https://github.com/ontodev/robot/issues/1

    Author:
    cjm
    • Constructor Detail

      • InvalidReferenceChecker

        public InvalidReferenceChecker()
    • Method Detail

      • isDangling

        public static boolean isDangling​(org.semanticweb.owlapi.model.OWLOntology ontology,
                                         org.semanticweb.owlapi.model.OWLEntity entity)
        Checks if entity is dangling.
        Parameters:
        ontology - the OWLOntology to check
        entity - the OWLEntity to check
        Returns:
        true if owlClass has no logical or non-logical axioms
      • isDeprecated

        public static boolean isDeprecated​(org.semanticweb.owlapi.model.OWLOntology ontology,
                                           org.semanticweb.owlapi.model.OWLEntity entity)
        Checks if entity is deprecated.
        Parameters:
        ontology - the OWLOntology to check
        entity - the OWLEntity to check
        Returns:
        true if entity is deprecated
      • getInvalidReferenceViolations

        public static Set<InvalidReferenceViolation> getInvalidReferenceViolations​(org.semanticweb.owlapi.model.OWLOntology ontology,
                                                                                   Set<org.semanticweb.owlapi.model.OWLAxiom> axioms,
                                                                                   boolean ignoreDangling)
        Finds axioms that reference a deprecated or dangling entity.

        Declaration axioms that reference a deprecated class do not count.

        Note that this does not count the value field of an annotation assertion, since these reference IRIs and not entities

        Parameters:
        ontology - the OWLOntology to check
        axioms - set of OWLAxioms to check
        ignoreDangling - if true, ignore dangling entities
        Returns:
        all violations
      • getInvalidReferenceViolations

        public static Set<InvalidReferenceViolation> getInvalidReferenceViolations​(org.semanticweb.owlapi.model.OWLOntology ontology,
                                                                                   boolean ignoreDangling)
        Parameters:
        ontology - the OWLOntology to check
        ignoreDangling - boolean to ignore dangling classes
        Returns:
        all violations in ontology
      • checkImportModule

        public static Set<InvalidReferenceViolation> checkImportModule​(org.semanticweb.owlapi.model.OWLOntology importModule,
                                                                       org.semanticweb.owlapi.model.OWLOntology baseOntology)
        Checks an import module. If the base ontology refers to deprecated entities in the import module this constitutes a violation
        Parameters:
        importModule - the OWLOntology import to check
        baseOntology - the base OWLOntology to check
        Returns:
        all deprecation-reference violations in baseOntology with respect to import module