Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Expand
titleExpand to see legends and methodology

Include Page
Legends and methodologyLegends and methodologyMethodology
Methodology

Go to page

Anchor
TmNamespace TmContent Macro grammar
TmNamespace TmContent Macro grammar
Gliffy
nameTmNamespace TmContent Macro grammar

Panel
borderStylesolid
titleTmNamespace TmContent Macro
Example
<Macro name="RetryQuery">
  <Argument>
    ...xml content <!-- XML Content -->
  </Argument>
  <Result>
    ... <!-- XML Content -->
  </Result>
</Macro>

 


Referenced by:


Namespace, TQL model content, Macro

  • TmContent.TmNamespace: nested namespace

...

Panel
borderStylesolid
titleTmDataContent (Data)
Example

<DataModel Name="Region">

            <Sid name="RegionID" />

            <String name<!-- List of TmDataAttribute -->

</DataModel>

<ThingModel Name="NameSensor" />

            <String              <Sid name="DescriptionSensorID" />

            <BoundingBox name="Area"/>

            <Person name="Manager"/>

            <Person name="Owner"/>

             <!-- List of TmThingAttribute and TmAction -->

</ThingModel>

<AppModel Name="PesticideCalculator">

             <!-- List of TmThingAttribute and TmAction -->

</DataModel>AppModel>


Referenced by:


TmDataContent

  • Inherits: Inheritance descriptor.
  • Combine:
  • TmDataAttribute: TQL data model attribute definition.
  • StandAloneConstraint: Stand-alone constraint definition.
  • TmUnique: Unique constraint definition.

...

Panel
borderStylesolid
titleTmThingContent (Thing)
Example
<ThingModel name="GPSModel" combines="GPSFacet">

            <Sid name="GPSID" />

</ThingModel>

<ThingFacet Name="GPSFacet">

    <String name="Payload" knownBy="SubscribeGPS" update="auto"/>

    <Double name="latitude" knownBy="SubscribeGPS"/>

    <Double name="longitude" knownBy="SubscribeGPS"/>

    <Number name="Direction" knownBy="SubscribeGPS" />

    <Number name="Speed" knownBy="SubscribeGPS" />

    <Boolean name="Simulated" />

    <String name="SensorURL" />

    <String name="SensorInterfaceIndex" />

    <String name="SensorInterfaceType" />

    <AA>[:#o#Output.ActionArgument:]</AA>

    <Action Name="SubscribeGPS"

            Documentation="Start the subscription to sensors data">

            ...      <!-- List of TmThingAttribute and TmAction -->

</ThingFacet>


Referenced by:


TmThingContent

  • Inherits: Inheritance descriptor.
  • Combine:
  • TmThingAttribute: TQL thing model attribute definition.
  • StandAloneConstraint: Stand-alone constraint definition.
  • TmUnique: Unique constraint definition.
  • TmAction: Thing action definition

...

Panel
borderStylesolid
titleTmAppContent (App)
Example

<AppModel Name="OptimumValueAlgorithmModel" combines="OptimumValueAlgorithm">

      <Sid Name="OptimumValueAlgorithmID" />

      <Integer name="currentTemp"/>

      <Integer name="currentHumidity"/>

</AppModel>

<AppFacet name="OptimumValueAlgorithm">
    <DateTime name="time" format="$SimpleDateFormat(yyyy-MM-dd'T'HH:mm:ss.SSS'Z')"  KnownBy="RunAlgorithm"/>
        
    <Action name="RunAlgorithm">
        <Workflow Limit="1" Live="1">
            <Task name="Main" while="true">
                <Event name="Argument" as="ActionArgument"/>
                
                <!-- <Log waitFor="Argument" Message="Got Arguments : [:Event.Argument:]"/> -->
                
                <Invoke Name="CreateCommand" waitFor="Argument">
                    <JavaScript>
                        var command = "java -jar [:RuntimeParams.LibDir:]OptimumFarmValueCalculator.jar";
                        
                        var currentTemp = String(Event.Argument.currentTemp.Value);
                        var currentHumidity = String(Event.Argument.currentHumidity.Value);
                        var outputFile = String("[:RuntimeParams.ConfigDir:]OptimumFarmValues.txt");
                        
                        //sffLog.info("Before calling jar file  : " + command);
                        
                        command = command.concat(" "+currentTemp + " "+currentHumidity);
                        command = command.concat(" \"" + outputFile + "\"");
                        
                        sffLog.info("Command to call Optimum value Algorithm : " + command);
                        command;
                    </JavaScript>
                </Invoke>
                
                <Invoke name="ExecuteCommand" execute="[:Invoke.CreateCommand:]"/>
                
                <!-- <Log Message="Check Command Status : [:Invoke.ExecuteCommand:]"/> -->
                
                <Output name="Result" as="ActionResult">
                    <Value>
                        <time>[:Event.Argument.time.Value:]</time>
                    </Value>
                </Output>
                
            </Task>
        </Workflow>
    </Action>
    <!-- List of TmThingAttribute and TmAction -->
</AppFacet>


Referenced by:


TmAppContent

  • Inherits: Inheritance descriptor.
  • Combine:
  • TmThingAttribute: TQL thing model attribute definition.
  • StandAloneConstraint: Stand-alone constraint definition.
  • TmUnique: Unique constraint definition.
  • TmAction: Thing action definition.

...

Panel
borderStylesolid
titleTmUnique
Example

<ThingFacet Name="PhidgetRFID">

    <Sid Name="RFIDId" />

    <String Name="ReadTag" Update="auto" KnownBy="PhidgetReadRFIDTagAc" />

    <String Name="WriteTag" KnownBy="PhidgetWriteRFIDTagAc" />     ...

    <String Name="RFIDURL" Default="phid://" />

    <String Name="InterfaceType" />

    <String Name="InterfaceIndex" />

    <Unique Name="RFIDIndex" Value="InterfaceIndex" />

    <DateTime Name="timestamp" Format="$SimpleDateFormat(yyyy-MM-dd'T'HH:mm:ss'Z')" />

    <AA>[:#o#Output.ActionArgument:]</AA>

    <Action Name="PhidgetReadRFIDTagAc" Documentation="Read the Tag Automatically in the vicinity">

...

    ...

</ThngFacet>

 


Referenced by:


Unique constraint definition

  • Name: Name is optional.
  • Value: List of attribute names.

...

Example

<DataModel name="Sensor">

            <Attribute name="sid" value="[:DevicePath:]sid"/>

            <Attribute name="geocoordinates" value="[:DevicePath:]geocoordinates"/>

            <Attribute name="deviceType" value="[:DevicePath:]deviceType" eq="lit.Sensor"/>

            <Attribute name="deviceState" value="[:DevicePath:]deviceState"/>

            <Attribute name="providerDetails" value="[:DevicePath:]providerDetails"/>

            <Attribute name="connectivityType" value="[:DevicePath:]connectivityType"/>

            <Attribute name="label" value="[:DevicePath:]label"/>

            <Attribute name="thirdPartyId" value="[:DevicePath:]thirdPartyId"/>

            <String name="sensorType"/>
Panel
borderStylesolid
titleTmDataAttribute


...

</DataModel>

Referenced by:


TmDataAttribute

  • Attribute: Cherry-picked attribute definition.

...

Panel
borderStylesolid
titleTmDataAtom
Example

<Def name<DataModel Name="Manager" inherits="EmployeeRegion"> 

            ...

            <String name="Employment.BusinnesRoleregionName" />

            ...

</Def>DataModel>



Referenced by:

...

Panel
borderStylesolid
titleTmDataComposite


Example

 

Referenced by:

...

Panel
borderStylesolid
titleTmDataAdHocComposite
Example

<DataModel name="SensorModel">

            <String name="SensorID" />

            <String name="SensorValue" />

            <String name="Unit" />     ...

            <DataModel name="Device">

                   <String name="Name" />

                   <String name="Type" />

            </DataModel>

            ...

</DataModel>

 

Referenced by:

Ad-hoc/untyped composite attribute

...

Example

<ThingFacet name="Actuator">

     <Attribute name="deviceState" value="[:DevicePath:]deviceState"/>
Panel
borderStylesolid
titleTmThingAttribute


</ThingFacet>

Referenced by:


TmThingAttribute

  • Attribute: Cherry-picked attribute definition.

...

Panel
borderStylesolid
titleTmThingAtom
Example

<ThingFacet name="Actuator">

    <Double Name="Speed" KnownBy="StartSubscriptionAction"/>

    <Double Name="FlowRate" KnownBy="StartSubscriptionAction"/>

    <String Name="DevicePort" />

    <Number Name="Frequency" />

    <String Name="Operation" />

    <String Name="Command"/>

    <String Name="StartSubscription"  KnownBy="StartSubscriptionAction" />

    <Action name="StartSubscriptionAction">

        <Workflow Limit="1" Live="1" Timeout="-1">

            <Task name="Main">

                <Event name="Argument" as="ActionArgument" />

...

     <String name="deviceState"  knownBy="deviceListener"/>

</ThingFacet>


Referenced by:


TmThingAtom

  • Update: Currently only 'auto' value is supported.
  • KnownBy: Associated action[s] name[s], comma-separated list.

...

Panel
borderStylesolid
titleTmThingComposite
Example

<ThingFacet Name<ThingModel name="PhidgetRFID">    <Sid NameMySensorModel" combines="RFIDIdSensorFacet" />

    <String             <SensorModel Name="ReadTag" Update="auto" KnownBy="PhidgetReadRFIDTagAc" />

    <String Name="WriteTag" KnownBy="PhidgetWriteRFIDTagAc" />

    <String Name="RFIDURL" Default="phid://" />

    <String Name="InterfaceType" />

    <String Name="InterfaceIndex" />

    <Unique Name="RFIDIndex" Value="InterfaceIndex" />

    <DateTime Name="timestamp" Format="$SimpleDateFormat(yyyy-MM-dd'T'HH:mm:ss'Z')" />

    <Action Name="PhidgetReadRFIDTagAc" Documentation="Read the Tag Automatically in the vicinity">

        <Workflow Limit="1" Live="1" Timeout="-1">

...

</ThingFacet>sensorModel"/>

</ThingModel>



Referenced by:


TmThingComposite

  • Update: Currently only 'auto' value is supported.
  • KnownBy: Associated action[s] name[s], comma-separated list.

...

Panel
borderStylesolid
titleTmThingAdHocComposite
Example

<ThingModel name="SensorModel" combines="SensorFacet">

            <String name="SensorID" />

            <String name="SensorValue" />

            <String name="Unit" />     ...

            <DataModel name="Device">

                   <String name="Name" />

                   <String name="Type" />

            </DataModel>

            ...

</ThingModel>


Referenced by:


Ad-hoc/untyped composite attribute

...

Panel
borderStylesolid
titleTmAction
Example

    <Action Name="PhidgetReadRFIDTagAc" Documentation="Read the Tag Automatically in the vicinity">

        <Workflow Limit="1" Live="1" Timeout="-1">

            <Task name="Main" while="true">

                <Event name="Argument" as="ActionArgument" />

                <Invoke name="ReadValue" waitFor="Argument"

                    get="[%:Event.Argument.RFIDURL.Value:%]" SerialNumber="[%:Event.Argument.InterfaceIndex.Value:%]"

                    DeviceType="[%:Event.Argument.InterfaceType.Value:%]" />

                <Output name="Result" as="ActionResult">

                    <Value>

                        <ReadTag>[%:[%:@Output:%]Invoke.ReadValue.Message.Value:%]

                        </ReadTag>

                    </Value>

                </Output>

                      ...

            </Task>

        </Workflow>

    </Action>


Referenced by:


TQL model action

...

Example

<Def name="Employment" inherits="DataFacet">

       <WorkPlace name="Organization" cardinality="1"/>

       <String name="BusinnesRole" cardinality="1"/>

</Def>

<Def name="Person" inherits="DataModel">

       <Sid name="SSN"/>

       <GivenName name="GivenName" cardinality="1..m"/>

       <PostalAddress name="Address" cardinality="0..m"/>

       <Integer name="Age" cardinality="1" default="-1"/>

       <String name="Sex" cardinality="1"/>

       <String name="Occupation"/>

       <String name="MaritalStatus"/>

       <Unique name="FullName" value="GivenName.First, GivenName.Middle, GivenName.Last"/>

       <Unique name="Identity" value="GivenName.First, GivenName.Middle, GivenName.Last, Sex, Age"/>

</Def>

<Def name="Employee" inherits="Person">

       <Employment name="Employment" cardinality="0..m"/>

       <Reference name="Manager" type="Manager" cardinality="1"/>

 </Def>

<Def name="Manager" inherits="Employee">

          <String name="Employment.BusinnesRole" default="manager" eq="manager" cardinality="1" modifiers="hidden,readonly"/>

 </Def>

<Def name="Janitor" inherits="Employee">

       <Constraint target="Employment.BusinnesRole" eq="janitor"/>

</Def>
Panel
borderStylesolid
titleCondition


Referenced by:

...