Class SimpleShortFormProvider

java.lang.Object
org.semanticweb.owlapi.util.SimpleShortFormProvider
All Implemented Interfaces:
Serializable, ShortFormProvider

public class SimpleShortFormProvider extends Object implements ShortFormProvider, Serializable
A very simple short form provider which is intended to provide human readable display names for entities. The following strategy is used: 1) If the entity URI has a fragment then that fragment is returned e.g. http://an.other.com#A would have a short form of "A". 2) If the entity URI does not have a fragment then the last segment of the URI path is used e.g. http://an.other.com/A/B would have a short form of "B". 3) If the entity URI does not have a path then the full URI is returned as a string.
Since:
2.0.0
Author:
Matthew Horridge, The University Of Manchester, Bio-Health Informatics Group
See Also:
  • Constructor Details

    • SimpleShortFormProvider

      public SimpleShortFormProvider()
  • 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.