Skip to content
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

Define which members are mandatory vs. optional #135

Open
dravenk opened this issue Jun 28, 2019 · 6 comments
Open

Define which members are mandatory vs. optional #135

dravenk opened this issue Jun 28, 2019 · 6 comments
Labels

Comments

@dravenk
Copy link

dravenk commented Jun 28, 2019

I finished reading Web Thing API , but anyway, I've read WoT Capability Schemas, but did not find any RFC file definition of property resource.
I see this discussion Actions vs. Properties #4 and this answer.

Fair enough. You could represent that state with two booleans (as you have) or with an integer (0, 1, 2, 3) or a string "on", "of", "turningOn", "turningOff".

This would make it impossible for me to define exactly and use a property resource.

  • I want to know in WoT Capability Schemas what are the properties of definition?
  • Are there any RFC files that define Properties resource?
@benfrancis
Copy link
Member

The Web Thing API specification provides a definition for the Property object which describes a property in the Thing Descriptiona and the Property resource which is part of the REST API.

What exactly is it that you want to know?

@dravenk
Copy link
Author

dravenk commented Jun 30, 2019

I just want a definition of the Property of the RFC documents, such as https://tools.ietf.org/html/rfc5988 . Because it will use key words "MUST", "MUST NOT", "REQUIRED"... More accurately inform what implementations need to be done.
Property object not describing exactly what must be implemented. For example, an OnOffProperty does not require A minimum and maximum (numeric values), but LevelProperty does.

@benfrancis benfrancis changed the title [Question]Are there any RFC files that define Properties resource? Define which members are mandatory vs. optional Jul 1, 2019
@benfrancis
Copy link
Member

@dravenk I'm afraid the unofficial specification we maintain at https://iot.mozilla.org/wot does not yet have these kinds of formal definitions like an IETF RFC might have, although we should probably at least specify which members are mandatory (I've updated the title of this issue to reflect that).

The W3C maintain a more formal specification for a Thing Description at https://www.w3.org/TR/wot-thing-description/ although this does not exactly match what Mozilla WebThings implements as the specification is still evolving.

@dravenk
Copy link
Author

dravenk commented Jul 15, 2019

@benfrancis
Hi, I wonder whether the description of OnOffProperty definition is An OnOffProperty is like a BooleanProperty, but with the added semantics that true means "on" and false means "off"., is description right?
But, there is another description Whether the lamp is turned on of OnOffProperty.

I have some predefined Thing property, whether I should be in accordance with the predefined description, for instance: OnOffPropertyAn OnOffProperty is like a BooleanProperty, but with the added semantics that true means "on" and false means "off".?


{ "@context": "https://iot.mozilla.org/schemas/",
  "@type": ["Light", "OnOffSwitch"],
  "name":"My Lamp",
  "description": "A web connected lamp"
}

Are the @type is Capabilities in the example code?
Light contains OnOffProperty, while OnOffSwitch contains only OnOffProperty. Is the @type of example repeated?
Should I use Capabilities as the definition of the Thing bundle? If some Thing bundles are predefined in this way, they will not be both Light and OnOffSwitch. for example:

* Light // Capabilities as the bundle of Thing
    - Lamp A // The instance
    - Lamp B // The instance
* OnOffSwitch // Capabilities as the bundle of Thing
    - Switch A // The instance
    - Switch B // The instance

@benfrancis
Copy link
Member

@dravenk Sorry but I'm struggling to understand your questions, which don't seem related to the topic of this issue.

@type is an optional semantic annotation in a Thing Description to give a client more information about a device, using schemas like those defined in our schema repository. A property can have multiple @types if it conforms to multiple schemas (e.g. a door sensor may fit both the BinarySensor and DoorSensor capabilities). These are really just hints to help a client provide users with a meaningful user interface or for the purpose of automation.

OnOffProperty is a semantic annotation in our schema repository which can be provided as a @type in a Property object of a Thing Description to tell a client that a boolean property represents an on/off state where true is on and false is off.

The optional description field in a Property object can be set to any string by the author of the Thing Description and is specific to an individual device.

I'm not sure what you mean by Thing bundle.

@dravenk
Copy link
Author

dravenk commented Jul 18, 2019

@benfrancis Thank you. I did more research and found a good point to deal with the question of whether to pre-define the Thing bundle.
#56

We're also finding that defining web thing types at just the thing level is too inflexible. Through the W3C we are investigating standardising "capabilities"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants