Package org.openhab.core.semantics
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 Summary
Modifier and TypeMethodDescriptiongetByLabel(String tagLabel, Locale locale) Retrieves the first semantic tag having label matching the given parameter.getByLabelOrSynonym(String tagLabelOrSynonym, Locale locale) Retrieves all semantic tags having label or a synonym matching the given parameter.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.getItemsInLocation(String labelOrSynonym, Locale locale) Retrieves all items that are located in a given location and which are either classified as Points or Equipments.getLabelAndSynonyms(Class<? extends Tag> tagClass, Locale locale) Gets the label and all synonyms of a semantic tag using the given locale.
-
Method Details
-
getItemsInLocation
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
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 locationlocale- the locale used to look up the tag label- Returns:
- as set of items that are located in the given location(s)
-
getByLabel
Retrieves the first semantic tag having label matching the given parameter. Case is ignored.- Parameters:
tagLabel- the searched labellocale- the locale to be considered- Returns:
- the tag class of the first matching semantic tag or null if no matching found
-
getByLabelOrSynonym
Retrieves all semantic tags having label or a synonym matching the given parameter. Case is ignored.- Parameters:
tagLabelOrSynonym- the searched label or synonymlocale- the locale to be considered- Returns:
- the List of tag classes of all matching semantic tags
-
getLabelAndSynonyms
Gets the label and all synonyms of a semantic tag using the given locale.- Parameters:
tagClass- the tag classlocale- the locale to be considered- Returns:
- the list containing the label and all synonyms of a semantic tag
-