Interface SemanticsService


@NonNullByDefault public interface SemanticsService
This interface defines a service, which offers functionality regarding semantic tags.
Author:
Kai Kreuzer - Initial contribution, Laurent Garnier - Few methods moved from class SemanticTags in order to use the semantic tag registry
  • Method Details

    • getItemsInLocation

      Set<Item> getItemsInLocation(Class<? extends Location> locationType)
      Retrieves all items that are located in a given location type and which are either classified as Points or Equipments.
      Parameters:
      locationType - the location type (tag) where items must be located.
      Returns:
      as set of items that are located in a given location type
    • getItemsInLocation

      Set<Item> getItemsInLocation(String labelOrSynonym, Locale locale)
      Retrieves all items that are located in a given location and which are either classified as Points or Equipments. The location is identified by its label or synonym and can reference either a type (e.g. "Bathroom") or a concrete instance (e.g. "Joe's Room").
      Parameters:
      labelOrSynonym - the label or synonym of the location
      locale - the locale used to look up the tag label
      Returns:
      as set of items that are located in the given location(s)
    • getByLabel

      @Nullable Class<? extends Tag> getByLabel(String tagLabel, Locale locale)
      Retrieves the first semantic tag having label matching the given parameter. Case is ignored.
      Parameters:
      tagLabel - the searched label
      locale - the locale to be considered
      Returns:
      the tag class of the first matching semantic tag or null if no matching found
    • getByLabelOrSynonym

      List<Class<? extends Tag>> getByLabelOrSynonym(String tagLabelOrSynonym, Locale locale)
      Retrieves all semantic tags having label or a synonym matching the given parameter. Case is ignored.
      Parameters:
      tagLabelOrSynonym - the searched label or synonym
      locale - the locale to be considered
      Returns:
      the List of tag classes of all matching semantic tags
    • getLabelAndSynonyms

      List<String> getLabelAndSynonyms(Class<? extends Tag> tagClass, Locale locale)
      Gets the label and all synonyms of a semantic tag using the given locale.
      Parameters:
      tagClass - the tag class
      locale - the locale to be considered
      Returns:
      the list containing the label and all synonyms of a semantic tag