Skip to main content
15-Moonstone
December 10, 2018
Solved

Information on Data Modelling

  • December 10, 2018
  • 3 replies
  • 2629 views

1. I have a asset A1 with property A1P1 and A1P2(Lets say i create a template A)
2. I have a sensor S1 with property S1P1 and S1P2(Lets say i create a ThingShape S)
If i have scenario with 1 sensor(S) and 1 asset(A), I can create a thing which implements ThingTemplate A and ThingShape S.
But how should i model on thingworx where if i have asset(A) with two sensors(S), here the sensors are same but attached to asset(A) at two different ends.
1. Here How will i create a Thing and what should be my model to achieve it .
2. If i want to show properties of two sensors(S) on the same mashup with the asset(A) properties, how will i get to know what properties thing it should pull??
3. Do we have a provision to capture additional info(apart from what we have currently in property info) for the property of a thing, like having a custom string or infotable associated to a property.
It may happen that i may have multiple sensors( of same type S) on the asset(A) but i need to show all the properties of the asset and sensor on the same mashup, so what should be my approach towards this case.

Best answer by zyuan1

Having problem posting pictures.

 

1. Create Datashape: TempSensor

    Contain property: SeriesNum (String), P1, P2 (Num)

    This is the Sensor you need, the SeriesNum could be S1, S2 and etc.

2. Create ThingShape: TempSensors

    Contain property: SensorNum(Num), SensorData (infotable: TempSensor shape)

    This represents the sensors attached to the same device, Sensor = 3 means you have 3 Temperature Sensor       attached, and you will have 3 rows of infotable data in your Device Thing.

3 replies

5-Regular Member
December 11, 2018

Hi,

 

In your case, the sensors are sharing the same datashape, so when you have several sensors attaching to the same device, you can't attach several ThingShapes to the same Thing since the properties will be duplicate.

 

There's a way to fix the problem if your sensors are in exact same datashape. Add a infotable property to represent the sensors attaching to the asset, each row of infotable stores data from a sensor, and the number of rows represents the number of sensors connected. And you can also have a Numeric property in the Thing to show the number of sensors.  

 

i.e.  For each type of Sensor, you can create a ThingShape, and it holds a numeric property to show the number of sensors used, and an infotable property to hold the data. And you can inherit different ThingShapes in your Thing entity to represent several types of sensors/devices attached to your Asset.

 

 

sbt15-MoonstoneAuthor
15-Moonstone
December 11, 2018

Hello Zyuan1,

Is it possible to post an example snippet for reference.

 

Thanks

 

5-Regular Member
December 12, 2018

 ThingShape, SensorNum=3

 

zyuan15-Regular MemberAnswer
5-Regular Member
December 12, 2018

Having problem posting pictures.

 

1. Create Datashape: TempSensor

    Contain property: SeriesNum (String), P1, P2 (Num)

    This is the Sensor you need, the SeriesNum could be S1, S2 and etc.

2. Create ThingShape: TempSensors

    Contain property: SensorNum(Num), SensorData (infotable: TempSensor shape)

    This represents the sensors attached to the same device, Sensor = 3 means you have 3 Temperature Sensor       attached, and you will have 3 rows of infotable data in your Device Thing.

Support
December 14, 2018

Hi @sbt.

 

If one of the responses provided by @zyuan1 answered your questions, please mark the appropriate one as the Accepted Solution for the benefit of others with the same questions.

 

Regards.

 

--Sharon

1-Visitor
December 20, 2018

Managing large quantities of structured and unstructured data is a primary function of information systems. Data models describe the structure, manipulation and integrity aspects of the data stored in data management systems such as relational databases mybkexperience.