Class LiteralAnnotationError

java.lang.Object
org.incenp.obofoundry.odk.fixreport.LiteralAnnotationError
All Implemented Interfaces:
IFixableError
Direct Known Subclasses:
LowercaseDefinitionError, MissingObsoleteLabelError

public abstract class LiteralAnnotationError extends Object implements IFixableError
Represents a fixable error that resides in a literal annotation.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected org.semanticweb.owlapi.model.IRI
     
    protected org.semanticweb.owlapi.model.IRI
     
    protected String
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    LiteralAnnotationError(org.semanticweb.owlapi.model.IRI property, org.semanticweb.owlapi.model.IRI subject, String value)
    Constructs a new instance.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    fixError(org.semanticweb.owlapi.model.OWLOntology ontology, boolean dubious)
    Fixes the reported error.
    protected abstract org.semanticweb.owlapi.model.OWLLiteral
    fixValue(org.semanticweb.owlapi.model.OWLLiteral oldValue, org.semanticweb.owlapi.model.OWLDataFactory factory, boolean dubious)
    Fixes the annotation value.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • property

      protected org.semanticweb.owlapi.model.IRI property
    • subject

      protected org.semanticweb.owlapi.model.IRI subject
    • value

      protected String value
  • Constructor Details

    • LiteralAnnotationError

      public LiteralAnnotationError(org.semanticweb.owlapi.model.IRI property, org.semanticweb.owlapi.model.IRI subject, String value)
      Constructs a new instance.
      Parameters:
      property - The property of the annotation to fix.
      subject - The entity carrying the annotation to fix.
      value - The value of the annotation. This is the value as reported by ROBOT’s report command, i.e. as a string of the form VALUE[@LANG].
  • Method Details

    • fixError

      public boolean fixError(org.semanticweb.owlapi.model.OWLOntology ontology, boolean dubious)
      Description copied from interface: IFixableError
      Fixes the reported error.
      Specified by:
      fixError in interface IFixableError
      Parameters:
      ontology - The ontology containing the error to fix.
      dubious - If true, fix the error even if we are not certain it is actually an error.
      Returns:
      true if the error has indeed been fixed.
    • fixValue

      protected abstract org.semanticweb.owlapi.model.OWLLiteral fixValue(org.semanticweb.owlapi.model.OWLLiteral oldValue, org.semanticweb.owlapi.model.OWLDataFactory factory, boolean dubious)
      Fixes the annotation value.
      Parameters:
      oldValue - The literal representing the invalid annotation value.
      factory - A factory that can be used to create the correct value.
      dubious - If true, fix the error even if we are not certain it is actually an error.
      Returns:
      The correct value to use to replace the original one, or null if correction could not be performed for any reason.