Format "Path" (idShortPath Serialization) in JSON

To get only the idShortPaths of a submodel element hierarchy, the serialization format is specified in terms of an idShortPath notation to be returned in an JSON array. The notation differs depending on whether a SubmodelElementCollection or a SubmodelElementList is present. In the first case, the submodel element’s idShort is separated by "." (dot) from top level down to child level. In the second case, square brackets with an index "[<Index>]" are appended after the idShort of the containing SubmodelElementList. In any case, the first item of any idShortPath is the idShort of the requested element.

Note: Although idShort may be defined for elements within a SubmodelElementList, only the index shall be used within the idShortPath serialization.

Grammar:

<idShortPath> ::= <idShort> {[ "." <idShort> | "["<Index>"]" ]}*

<Index> ::= <Zero> | <PositiveNumber>

<PositiveNumber>  ::= <NonZeroDigit>{<Digit>}*
<Digit> ::= <Zero> | <NonZeroDigit>
<Zero>  ::= "0"
<NonZeroDigit>  ::= "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9"

In the following example, a request for idShort paths targeting a MySubmodelElementCollection with SerializationModifier level = deep, the list of idShort paths is returned as follows:

EXAMPLE Submodel

Submodel: MySubmodel

  • Property: MyTopLevelProperty

  • SMC: MySubmodelElementCollection

    • Property: MySubProperty1

    • Property: MySubProperty2

    • SMC: MySubSubmodelElementCollection

      • Property: MySubSubProperty1

      • Property: MySubSubProperty2

    • SML: MySubSubmodelElementList1

      • Property: "MySubTestValue1"

      • Property: "MySubTestValue2"

    • SML: MySubSubmodelElementList2

      • SML: MySubSubmodelElementList3

        • SMC: MySubmodelElementCollectionInSML3

          • Property: "MySubTestValue3"

idShortPaths for SMC MySubmodelElementCollection within the Submodel above:

[
  "MySubmodelElementCollection",
  "MySubmodelElementCollection.MySubProperty1",
  "MySubmodelElementCollection.MySubProperty2",
  "MySubmodelElementCollection.MySubmodelElementCollection",
  "MySubmodelElementCollection.MySubmodelElementCollection.MySubProperty1",
  "MySubmodelElementCollection.MySubmodelElementCollection.MySubProperty2",
  "MySubmodelElementCollection.MySubSubmodelElementList1",
  "MySubmodelElementCollection.MySubSubmodelElementList1[0]",
  "MySubmodelElementCollection.MySubSubmodelElementList1[1]",
  "MySubmodelElementCollection.MySubSubmodelElementList2",
  "MySubmodelElementCollection.MySubSubmodelElementList2[0]",
  "MySubmodelElementCollection.MySubSubmodelElementList2[0][0]",
  "MySubmodelElementCollection.MySubSubmodelElementList2[0][1]",
  "MySubmodelElementCollection.MySubSubmodelElementList2[0][0].MySubTestValue3"
  "MySubmodelElementCollection.MySubSubmodelElementList2[0][1].MySubTestValue3"
]

"MySubmodelElementCollection.MySubSubmodelElementList1" has exactly 2 values in this example and "MySubmodelElementCollection.MySubSubmodelElementList2" has 1 element in the first row and two in the second row.

Note: There is no idShortPath for Identifiables because idShort is optional for Identifiables.