Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

ThingModel is one special kind of models (the other kinds are DataModels and AppModels). Therefore it has all the properties of Models (Lifecycle of modelsModel AttributesUnique and Constraints).

...

However, as a recommended practice, the Attributes and Actions related to the interactions with an external thing (sensors, actuators, machines) are often defined in a reusable structure called ThingFacet, and combined into a ThingModel. This relationship was explained in the concept of Models and Model Facets.

 

ThingModel is a complex type defined by Atomic Domain Language Thing Definition Language (TDL). ThingModel inherits ThingFacet and a DataModel.

Here is the complete definition of a ThingModel:

Code Block
languagexml
titleThingModel Definition
linenumberstrue
<Def name="ThingModel" inherits="ThingFacet,DataModel" documentation="A complete model of a device or other kind of thing"/>

 Application related information are often defined directly as attributes of the ThingModel.

Purpose of ThingModels:

  • ThingModels are normally defined by users when interacting with Physical Things. The behavior of Physical Things are modeled via ThingFacet.
  • ThingModels are driver for ThingFacets. ThingFacet (s) are reusable models and TQL CRUD operations can not be performed on ThingFacet. ThingFacet(s) are put to use only when combined within a ThingModel.
  • ThingModels can contain application related information that are related to things.

...

Code Block
languagexml
titlePhidgetServo Thing Model
linenumberstrue
<ThingModel Name="PhidgetServoModel">
  	<Sid Name="PhidServoId"/>
</ThingModel>
<ThingFacet Name="PhidgetServoFacet">
	<String Name="ServoProtocolURL" Default="phid://" />
	<String Name="DeviceInterfaceIndex" />
	<String Name="PhidgetDeviceType" />
	<Integer Name="ServoAngle" KnownBy="PhidgetServoAction" />
	<Action Name="PhidgetServoAction" Documentation="Control servo motor">
		...
	</Action>
</ThingFacet>

 

ThingsFacets are used within ThingModels using Combines modifier. Example of a PhidgetServoModel ThingModel combining a PhidgetServoFacet ThingFacet

...