-
-
Notifications
You must be signed in to change notification settings - Fork 431
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
XSD Add semantic tag on things #4617
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Andrew Fiddian-Green <[email protected]>
This pull request has been mentioned on openHAB Community. There might be relevant details there: https://community.openhab.org/t/openhab-5-semantic-model-proposal/162526/96 |
Signed-off-by: Andrew Fiddian-Green <[email protected]>
Signed-off-by: Andrew Fiddian-Green <[email protected]>
Signed-off-by: Andrew Fiddian-Green <[email protected]>
Signed-off-by: Andrew Fiddian-Green <[email protected]>
Signed-off-by: Andrew Fiddian-Green <[email protected]>
@mherwege can I kindly ask you to be a sparring partner for this PR? My goal is to allow developers to set a (proposed) semantic (equipment) tag in their thing type xml, and have this permeated through the thing type instances to the actual thing instances so that the UI can use that semantic (equipment) tag (as a hint) in creating a semantic model. |
@andrewfg Sure. I like the idea as long as it does not then enforce anything on the item semantics. So I would think that it should be carried to the point of a having a tag on the thing, but then it should be up to the UI to pick this up as a suggested equipment semantic when creating the group item with its points (create model from thing). |
Indeed. The tags in the ChannelType xml are hints for semantic “point” and semantic “property” tags which are intended for functional Item creation. And the single tag in the ThingType xml would be a hint for the semantic “equipment” tag intended for semantic GroupItem creation. The remaining “location” semantic tag is entirely user dependent and would not come from the xml. PS we could even explicitly name it |
Signed-off-by: Andrew Fiddian-Green <[email protected]>
Signed-off-by: Andrew Fiddian-Green <[email protected]>
Signed-off-by: Andrew Fiddian-Green <[email protected]>
* @param semanticEquipmentTag a string with semantic (equipment) tag for this thing | ||
* @return the {@link ThingBuilder} itself | ||
*/ | ||
public ThingBuilder withSemanticEqipmentTag(@Nullable String semanticEquipmentTag) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo:
public ThingBuilder withSemanticEqipmentTag(@Nullable String semanticEquipmentTag) { | |
public ThingBuilder withSemanticEquipmentTag(@Nullable String semanticEquipmentTag) { |
* @param semanticEquipmentTag semantic (equipment) tag | ||
* @return the updated builder | ||
*/ | ||
public DiscoveryResultBuilder withSemanticEquipmentTag(@Nullable String semanticEquipmentTag) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm wondering if it would be better to stay consistent and generic like e.g. here:
Lines 54 to 68 in 6bf5960
/** | |
* Adds a tag to the ChannelType | |
* | |
* @param tag Tag to be added to the ChannelType | |
* @return this Builder | |
*/ | |
T withTag(String tag); | |
/** | |
* Sets the StateDescription for the ChannelType | |
* | |
* @param tags Collection of tags to be added to the ChannelType | |
* @return this Builder | |
*/ | |
T withTags(Collection<String> tags); |
so simply withTag
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See #4617 (comment) above.
The purpose of this PR is to add a semantic (equipment) tag to things so that the UI can use that tag for putting items that are bound to channels on such things in the semantic model.
Adds two things:
Signed-off-by: Andrew Fiddian-Green [email protected]