Class AnnotationValueShortFormProvider

java.lang.Object
org.semanticweb.owlapi.util.AnnotationValueShortFormProvider
All Implemented Interfaces:
ShortFormProvider

public class AnnotationValueShortFormProvider extends Object implements ShortFormProvider
A short form provider that generates short forms based on entity annotation values. A list of preferred annotation URIs and preferred annotation languages is used to determine which annotation value to select if there are multiple annotations for the entity whose short form is being generated. If there are multiple annotations the these annotations are ranked by preferred IRI and then by preferred language.
Since:
2.0.0
Author:
Matthew Horridge, The University Of Manchester, Bio-Health Informatics Group
  • Constructor Details

    • AnnotationValueShortFormProvider

      public AnnotationValueShortFormProvider(List<OWLAnnotationProperty> annotationProperties, Map<OWLAnnotationProperty,List<String>> preferredLanguageMap, OWLOntologySetProvider ontologySetProvider)
      Constructs an annotation value short form provider. Using SimpleShortFormProvider as the alternate short form provider
      Parameters:
      annotationProperties - A List of preferred annotation properties. The list is searched from start to end, so that annotations that have a property at the start of the list have a higher priority and are selected over annotations with properties that appear towards or at the end of the list.
      preferredLanguageMap - A map which maps annotation properties to preferred languages. For any given annotation property there may be a list of preferred languages. Languages at the start of the list have a higher priority over languages at the end of the list. This parameter may be empty but it must not be null.
      ontologySetProvider - An OWLOntologySetProvider which provides a set of ontology from which candidate annotation axioms should be taken. For a given entity, all ontologies are examined.
    • AnnotationValueShortFormProvider

      public AnnotationValueShortFormProvider(List<OWLAnnotationProperty> annotationProperties, Map<OWLAnnotationProperty,List<String>> preferredLanguageMap, OWLOntologySetProvider ontologySetProvider, ShortFormProvider alternateShortFormProvider)
      Constructs an annotation short form provider.
      Parameters:
      annotationProperties - A List of preferred annotation properties. The list is searched from start to end, so that annotations that have a property at the start of the list have a higher priority and are selected over annotations with properties that appear towards or at the end of the list.
      preferredLanguageMap - A map which maps annotation properties to preferred languages. For any given annotation property there may be a list of preferred languages. Languages at the start of the list have a higher priority over languages at the end of the list. This parameter may be empty but it must not be null.
      ontologySetProvider - An OWLOntologySetProvider which provides a set of ontology from which candidate annotation axioms should be taken. For a given entity, all ontologies are examined.
      alternateShortFormProvider - A short form provider which will be used to generate the short form for an entity that does not have any annotations. This provider will also be used in the case where the value of an annotation is an OWLIndividual for providing the short form of the individual.
    • AnnotationValueShortFormProvider

      public AnnotationValueShortFormProvider(OWLOntologySetProvider ontologySetProvider, ShortFormProvider alternateShortFormProvider, IRIShortFormProvider alternateIRIShortFormProvider, List<OWLAnnotationProperty> annotationProperties, Map<OWLAnnotationProperty,List<String>> preferredLanguageMap)
      Parameters:
      ontologySetProvider - ontologies
      alternateShortFormProvider - short form provider
      alternateIRIShortFormProvider - iri short form provider
      annotationProperties - annotation properties
      preferredLanguageMap - preferred language map
  • Method Details

    • getShortForm

      public String getShortForm(OWLEntity entity)
      Description copied from interface: ShortFormProvider
      Gets the short form for the specified entity.
      Specified by:
      getShortForm in interface ShortFormProvider
      Parameters:
      entity - The entity.
      Returns:
      A string which represents a short rendering of the specified entity. The returned value will not be null but might be an empty string.
    • getAnnotationProperties

      public List<OWLAnnotationProperty> getAnnotationProperties()
      Returns:
      the annotation URIs that this short form provider uses.
    • getPreferredLanguageMap

      public Map<OWLAnnotationProperty,List<String>> getPreferredLanguageMap()
      Returns:
      the preferred language map
    • setLiteralRenderer

      public void setLiteralRenderer(StringAnnotationVisitor literalRenderer)
      Parameters:
      literalRenderer - the literal renderer to set