Package org.semanticweb.owlapi.util
Class AnnotationValueShortFormProvider
java.lang.Object
org.semanticweb.owlapi.util.AnnotationValueShortFormProvider
- All Implemented Interfaces:
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 Summary
ConstructorsConstructorDescriptionAnnotationValueShortFormProvider
(List<OWLAnnotationProperty> annotationProperties, Map<OWLAnnotationProperty, List<String>> preferredLanguageMap, OWLOntologySetProvider ontologySetProvider) Constructs an annotation value short form provider.AnnotationValueShortFormProvider
(List<OWLAnnotationProperty> annotationProperties, Map<OWLAnnotationProperty, List<String>> preferredLanguageMap, OWLOntologySetProvider ontologySetProvider, ShortFormProvider alternateShortFormProvider) Constructs an annotation short form provider.AnnotationValueShortFormProvider
(OWLOntologySetProvider ontologySetProvider, ShortFormProvider alternateShortFormProvider, IRIShortFormProvider alternateIRIShortFormProvider, List<OWLAnnotationProperty> annotationProperties, Map<OWLAnnotationProperty, List<String>> preferredLanguageMap) -
Method Summary
Modifier and TypeMethodDescriptiongetShortForm
(OWLEntity entity) Gets the short form for the specified entity.void
setLiteralRenderer
(StringAnnotationVisitor literalRenderer) Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.semanticweb.owlapi.util.ShortFormProvider
dispose
-
Constructor Details
-
AnnotationValueShortFormProvider
public AnnotationValueShortFormProvider(List<OWLAnnotationProperty> annotationProperties, Map<OWLAnnotationProperty, List<String>> preferredLanguageMap, OWLOntologySetProvider ontologySetProvider) Constructs an annotation value short form provider. UsingSimpleShortFormProvider
as the alternate short form provider- Parameters:
annotationProperties
- AList
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 benull
.ontologySetProvider
- AnOWLOntologySetProvider
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
- AList
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 benull
.ontologySetProvider
- AnOWLOntologySetProvider
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 anOWLIndividual
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
- ontologiesalternateShortFormProvider
- short form provideralternateIRIShortFormProvider
- iri short form providerannotationProperties
- annotation propertiespreferredLanguageMap
- preferred language map
-
-
Method Details
-
getShortForm
Description copied from interface:ShortFormProvider
Gets the short form for the specified entity.- Specified by:
getShortForm
in interfaceShortFormProvider
- 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
- Returns:
- the annotation URIs that this short form provider uses.
-
getPreferredLanguageMap
- Returns:
- the preferred language map
-
setLiteralRenderer
- Parameters:
literalRenderer
- the literal renderer to set
-