org.semanticweb.owlapi.util
Class AnnotationValueShortFormProvider

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

public class AnnotationValueShortFormProvider
extends java.lang.Object
implements ShortFormProvider

Author: Matthew Horridge
The University Of Manchester
Bio-Health Informatics Group
Date: 18-Apr-2007

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 URI and then by preferred language.


Constructor Summary
AnnotationValueShortFormProvider(java.util.List<OWLAnnotationProperty> annotationProperties, java.util.Map<OWLAnnotationProperty,java.util.List<java.lang.String>> preferredLanguageMap, OWLOntologySetProvider ontologySetProvider)
          Constructs an annotation value short form provider.
AnnotationValueShortFormProvider(java.util.List<OWLAnnotationProperty> annotationProperties, java.util.Map<OWLAnnotationProperty,java.util.List<java.lang.String>> preferredLanguageMap, OWLOntologySetProvider ontologySetProvider, ShortFormProvider alternateShortFormProvider)
          Constructs an annotation short form provider.
 
Method Summary
 void dispose()
          Disposes of the short form proivider.
 java.util.List<OWLAnnotationProperty> getAnnotationProperties()
          Gets the annotation URIs that this short form provider uses.
 java.util.Map<OWLAnnotationProperty,java.util.List<java.lang.String>> getPreferredLanguageMap()
           
 java.lang.String getShortForm(OWLEntity entity)
          Gets the short form for the specified entity.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AnnotationValueShortFormProvider

public AnnotationValueShortFormProvider(java.util.List<OWLAnnotationProperty> annotationProperties,
                                        java.util.Map<OWLAnnotationProperty,java.util.List<java.lang.String>> preferredLanguageMap,
                                        OWLOntologySetProvider ontologySetProvider)
Constructs an annotation value short form provider. Using SimpleShortFormProvider as the alternate short form provider (see other constructor for details).


AnnotationValueShortFormProvider

public AnnotationValueShortFormProvider(java.util.List<OWLAnnotationProperty> annotationProperties,
                                        java.util.Map<OWLAnnotationProperty,java.util.List<java.lang.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.
Method Detail

getShortForm

public java.lang.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 speicified entity.

getAnnotationProperties

public java.util.List<OWLAnnotationProperty> getAnnotationProperties()
Gets the annotation URIs that this short form provider uses.


getPreferredLanguageMap

public java.util.Map<OWLAnnotationProperty,java.util.List<java.lang.String>> getPreferredLanguageMap()

dispose

public void dispose()
Description copied from interface: ShortFormProvider
Disposes of the short form proivider. This frees any resources and clears any caches.

Specified by:
dispose in interface ShortFormProvider