<DataModel Name="VendorInfo">
<Sid Name="vendorId"/>
<String Name="vendorName"/>
<String Name="vendorCity"/>
<Reference cardinality="1..1" name="thingCat" type="ThingCategory"/>
</DataModel>
<DataModel Name="ThingCategory">
<Sid Name="thingCatID"/>
<String Name="catList" cardinality="1..n"/>
</DataModel>
<!-- Let's Create few Thing Categories. -->
<Query>
<DeleteAll>
<ThingCategory>
<thingCatID ne=""/>
</ThingCategory>
</DeleteAll>
<Create>
<ThingCategory>
<catList>
Sensors
</catList>
</ThingCategory>
</Create>
<Create>
<ThingCategory>
<catList>
Actuators
</catList>
</ThingCategory>
</Create>
<Create>
<ThingCategory>
<catList>
Sensors
</catList>
<catList>
Actuators
</catList>
<catList>
Gateways
</catList>
</ThingCategory>
</Create>
</Query>
<!-- Now create VendorInfo with ThingCategory SID Value -->
<Query>
<Create>
<VendorInfo>
<vendorId>
vendorA
</vendorId>
<vendorName>
Phidget
</vendorName>
<vendorCity>
Calgary
</vendorCity>
<thingCat>
LOBF4FOGAAAX6AAAAGEWWHEH
</thingCat>
</VendorInfo>
</Create>
</Query>
<!-- Let's do a Find on VendorInfo with nested * -->
<Query>
<Find format="all" nested="*">
<VendorInfo>
<vendorId ne=""/>
</VendorInfo>
</Find>
</Query>
<!-- Response to the Find -->
<Find Status="Success" Format="all">
<Result>
<VendorInfo QName="Atomiton.Sensors.VendorInfo">
<vendorId>vendorA</vendorId>
<thingCat Known="LOBF4FOGAAAX6AAAAGEWWHEH" Version="1" Timestamp="1492540919704" DateTime="2017-04-18 11:41:59.704" QName="Atomiton.Sensors.VendorInfo.thingCat" FName="thingCat">
<Value QName="Atomiton.Sensors.ThingCategory">
<thingCatID>LOBF4FOGAAAX6AAAAGEWWHEH</thingCatID>
<catList Value="Sensors" Known="Sensors" Order="0x00" Version="1" Timestamp="1492540855750" DateTime="2017-04-18 11:40:55.75" QName="Atomiton.Sensors.ThingCategory.catList" FName="catList"/>
<catList Value="Actuators" Known="Actuators" Order="0x01" Version="1" Timestamp="1492540855751" DateTime="2017-04-18 11:40:55.751" QName="Atomiton.Sensors.ThingCategory.catList" FName="catList"/>
<catList Value="Gateways" Known="Gateways" Order="0x02" Version="1" Timestamp="1492540855751" DateTime="2017-04-18 11:40:55.751" QName="Atomiton.Sensors.ThingCategory.catList" FName="catList"/>
</Value>
</thingCat>
<vendorCity Value="Calgary" Known="Calgary" Version="1" Timestamp="1492540919704" DateTime="2017-04-18 11:41:59.704" QName="Atomiton.Sensors.VendorInfo.vendorCity" FName="vendorCity"/>
<vendorName Value="Phidget" Known="Phidget" Version="1" Timestamp="1492540919704" DateTime="2017-04-18 11:41:59.704" QName="Atomiton.Sensors.VendorInfo.vendorName" FName="vendorName"/>
</VendorInfo>
</Result>
</Find> |