Common rules: idShort and semanticId#
- Every SubmodelElement inherits from Referable (idShort, displayName, description), HasSemantics (semanticId, supplementalSemanticIds), Qualifiable (qualifiers) and HasDataSpecification.
- idShort must be unique within its parent, case-sensitive (AASd-022), and is mandatory unless the element is a direct child of a SubmodelElementList (AASd-117).
- idShort format (AASd-002): since v3.1 ^[a-zA-Z][a-zA-Z0-9_-]*[a-zA-Z0-9_]+$ (starts with a letter, at least two characters, hyphen allowed except at the end). v3.0: ^[a-zA-Z][a-zA-Z0-9_]*$ (no hyphen, one character allowed). Maximum 128 characters.
- semanticId is not mandatory but recommended. The specification notes that an element needs a semantic definition to have a well-defined meaning.
The 14 types at a glance#
DataElement and EventElement are abstract and are not instantiated. A SelfManagedEntity (has its own AAS) needs a globalAssetId or specificAssetId (AASd-014); a CoManagedEntity has no AAS of its own.
| Type | Use it for | Key attributes (JSON names) |
|---|---|---|
| Property | A single value (number, string, date ...) | valueType (mandatory), value, valueId |
| MultiLanguageProperty | Text per language (product name, description) | value[{language, text}], valueId |
| Range (Experimental) | A min-max range | valueType (mandatory), min, max |
| Blob | Binary content stored inline | value (base64 in JSON), contentType |
| File | Location of a file (absolute or relative URI) | value (path), contentType |
| ReferenceElement | Pointing to another element or an external object | value (Reference) |
| RelationshipElement | A relationship between two elements | first, second |
| AnnotatedRelationshipElement | A relationship with extra data | first, second, annotations |
| Entity | Parts (assets) in a BOM and similar structures | entityType, globalAssetId, specificAssetIds, statements |
| Operation | A callable function | inputVariables, outputVariables, inoutputVariables |
| Capability | Implementation-independent description of an ability | No own attributes besides semanticId |
| BasicEventElement (Experimental) | Event definition | observed, direction, state (mandatory), messageTopic ... |
| SubmodelElementCollection | A struct of differently named elements | value |
| SubmodelElementList | A list of elements of the same type and meaning | typeValueListElement (mandatory), valueTypeListElement, semanticIdListElement, orderRelevant, value |
Property and valueType#
Property/valueType is one of the DataTypeDefXsd values: 30 XML Schema 1.0 types with an xs: prefix, such as xs:string, xs:boolean, xs:int, xs:double, xs:date, xs:dateTime and xs:anyURI.
In the normal JSON format, Property/value and Range/min/max are always JSON strings. The number 3000 is written as "3000" and the consumer converts it according to valueType. Native JSON types are used in the Value-Only format.
valueId points to the global ID of a coded value. If both value and valueId are present, value must equal the referenced coded value (AASd-007).
SubmodelElementCollection vs SubmodelElementList#
A SubmodelElementCollection is a struct: each element has its own idShort and order carries no meaning. A SubmodelElementList is a list numbered from 0. Following the specification's example, one document is a Collection and several documents are a List of Collections.
- typeValueListElement (mandatory): the type of the children. All children must have this type (AASd-108).
- valueTypeListElement: mandatory if the children are Property or Range, and must match every child's valueType (AASd-109).
- semanticIdListElement: the children's semanticId. A child that states a semanticId must use this value; a child without one is assumed to have it (AASd-107, 114, 115).
- orderRelevant: default true. false means the list is a set or a bag.
- idShort of children is optional (forbidden in v3.0, allowed since v3.1). References and API paths address children by index (for example BearingTemperatures[0]).
JSON example#
This submodel passes the v3.0, v3.1 and v3.2 JSON schemas. The semanticIds of SerialNumber and ManufacturerName are the IEC CDD values from the Digital Nameplate 3.0.3 template; the list's semanticId is an illustrative address.
Copy the code, or select it to copy manually.
{
"modelType": "Submodel",
"id": "https://example.com/ids/sm/pump-0001-demo",
"idShort": "DemoElements",
"kind": "Instance",
"submodelElements": [
{
"modelType": "Property",
"idShort": "SerialNumber",
"semanticId": { "type": "ExternalReference",
"keys": [ { "type": "GlobalReference", "value": "0112/2///61987#ABA951#009" } ] },
"valueType": "xs:string",
"value": "P-0001"
},
{
"modelType": "MultiLanguageProperty",
"idShort": "ManufacturerName",
"semanticId": { "type": "ExternalReference",
"keys": [ { "type": "GlobalReference", "value": "0112/2///61987#ABA565#009" } ] },
"value": [ { "language": "en", "text": "Example Pumps Ltd." },
{ "language": "de", "text": "Beispielpumpen GmbH" } ]
},
{
"modelType": "SubmodelElementList",
"idShort": "BearingTemperatures",
"orderRelevant": true,
"semanticIdListElement": { "type": "ExternalReference",
"keys": [ { "type": "GlobalReference", "value": "https://example.com/semantics/BearingTemperature" } ] },
"typeValueListElement": "Property",
"valueTypeListElement": "xs:double",
"value": [
{ "modelType": "Property", "valueType": "xs:double", "value": "41.5" },
{ "modelType": "Property", "valueType": "xs:double", "value": "43.0" }
]
}
]
}What changed between versions#
- v3.1: contentType of File and Blob, entityType of Entity and first/second of RelationshipElement became optional (mandatory in v3.0).
- v3.1: hyphens allowed in idShort, idShort allowed for SubmodelElementList children, BasicEventElement/lastUpdate changed to DateTimeUtc.
- v3.2: the rule that a missing Range min or max means infinity was removed. If you need infinity, use a type whose value space includes it, such as float.
- v3.2: a SubmodelElementList inside a template submodel or an OperationVariable must have exactly one element (AASd-138).
- Blob content is not stored as a supplementary file in an AASX package (Part 5). The Part 2 API leaves Blob values out of responses by default and includes them only with extent=withBlobValue.
Key points#
- There are 14 concrete types; JSON tells them apart with modelType.
- idShort rules differ between v3.0 and v3.1+ (hyphens, minimum two characters). Match your target version.
- SubmodelElementList requires typeValueListElement; children share type and semanticId and are addressed by index.
Questions and answers#
Should I use a Collection or a List?
Use a SubmodelElementCollection when each element has a different meaning and a SubmodelElementList when elements of the same meaning repeat. The specification itself suggests considering a List when several elements of a Collection share a semanticId.
Can a numeric Property value be a JSON number?
Not in the normal JSON serialization. The schema defines value as a string, interpreted through valueType. JSON numbers are used in the Value-Only format.
What is the difference between File and Blob?
File holds the path (URI) of a file; Blob holds the file content itself. Files inside a package should be referenced with a path relative to the package root; files that exist independently use an absolute path.
Can I use Range or BasicEventElement?
Yes, but they are marked <<Experimental>>, so later versions may change them incompatibly. v3.2 did exactly that with the interpretation of Range min and max.
