Relationship or property? Which one is suggested to use for representing where a frequently moving object is?

Kent010341 231 Reputation points
2022-03-28T04:27:07.027+00:00

Assume that I have digital twins which are a person (e.g., dtid = Employee) and rooms like ConferenceRoom_1, ConferenceRoom_2, Bathroom.

If I want to represent which room this person is in, and this person may frequently change place, which one should I use?

  • relationship: create a relationship isLocationOf which source is the room and the target is this person. Whenever the person moves to the other room, remove the old one and create a new relationship.
  • property: this person has a property location. Whenever the person moves to the other room, update the property.

There are two possible cases that may affect which one (relationship or property) should I use:

  • I don't have to know this room contains who, and the information needed of the room is "how many people are in this room?".
  • The information of who this room contains is also required to know.

And for a huge project like a smart office or a smart building, which will contain a lot of rooms and people, I wonder if frequently update property will have a better performance than the frequent delete and create relationships, which may also affect the decision of choosing relationship or property.

Furthermore, is there any way that can help me assess which one (relationship or property) is better for a situation? This will be helpful if I have another different situation having the same question.

I'd like to know if anyone has some related experiences or suggestions.

Thanks.

Azure Digital Twins
Azure Digital Twins
An Azure platform that is used to create digital representations of real-world things, places, business processes, and people.
221 questions
{count} votes

1 answer

Sort by: Most helpful
  1. QuantumCache 20,031 Reputation points
    2022-03-28T23:57:37.763+00:00

    Hello @Kent010341

    Properties are expected to have backing storage, which means that you can read a property at any time and retrieve its value. If the property is writable, you can also store a value in the property.

    As a result, when designing a model in Azure Digital Twins, you'll probably use properties in most cases to model your twins. Doing so allows you to have the backing storage and the ability to read and query the data fields. Telemetry and properties often work together to handle data ingress from devices.

    Relationships let you represent how a digital twin can be involved with other digital twins.

    187721-image.png

    Please refer to the Elements of a model

    I hope you have already visit this page, Azure Digital Twins for smart buildings