openhab / org.openhab.ui.habot

A chatbot for openHAB using machine-learning natural language processing from OpenNLP
Eclipse Public License 1.0
65 stars 31 forks source link

Transition to metadata & semantic tags understanding #16

Closed ghys closed 6 years ago

ghys commented 6 years ago

This introduces BREAKING CHANGES!

Following the discussion in https://github.com/eclipse/smarthome/issues/1093 the mechanism matching the entities extracted by OpenNLP from the natural language query to ESH items is being altered in this way:

  1. Tags are not the primary conduit for item identification: this change introduces the concept of "Named Attributes" which will be implicitely affixed to items by a new class/ OSGi component, the ItemNamedAttributesResolver

  2. Tags are now expected to conform to a semantic tag library: the current version is at https://github.com/eclipse/smarthome/wiki/Semantic-Tag-Library HABot has internal translations for the most useful semantic tags in the languages it understands and will derive named attributes for items from those tagattributes_{locale}.properties resource bundles

  3. In addition to tags, users may specify additional "monikers" for items by using metadata in the "habot" namespace:

Group FF_ChildsRoom { habot="Amy's room" [ type="location" ] }

Those monikers will also be added to items' named attributes set. The "type" configuration property is optional: if left unspecified, monikers will have the "object" type.

  1. Inheritance is still assumed for applied tags and monikers specified in metadata for Group items, EXCEPT if the inheritTags configuration property in the "habot" metadata namespace prevents it (for tags only, metadata monikers are always inherited), like so:

    Group Kitchen ["object:room"] { habot="Cuisine" [ inheritTags=false ] }
  2. "habot:" prefixed tags will move gradually to the "habot" item metadata namespace.

Signed-off-by: Yannick Schaus habpanel@schaus.net