How: List of performed steps
- Create minimal Aspect with one Property and one Operation
- Result: AspectWithOperation.ttl (attached)
- Create AAS SMT from AspectWithOperation with samm-cli 2.15.0
- Run (1)
samm aspect .\com.example\1.0.0\AspectWithOperation.ttl to aas --format json
- Run (2)
samm aspect .\com.example\1.0.0\AspectWithOperation.ttl to aas --format xml
- Validate generated JSON with aas-core3.0 (Python)
What: Actual result vs expected result
Actual result:
The semanticId of the generated Operation submodel element is emitted as a
ModelReference whose first (and only) key has type Operation:
{
"idShort": "toggle",
"modelType": "Operation",
"semanticId": {
"type": "ModelReference",
"keys": [
{
"type": "Operation",
"value": "urn:samm:com.example:1.0.0#toggle"
}
]
}
}
This violates two constraints of the AAS metamodel specification (IDTA-01001):
- AASd-121: For
References, the value of Key/type of the first key of
Reference/keys shall be one of GloballyIdentifiables — Operation is not.
- AASd-123: For model references, the value of
Key/type of the first key of
Reference/keys shall be one of AasIdentifiables (AssetAdministrationShell,
ConceptDescription, Identifiable, Submodel) — Operation is not. A
fragment key like Operation may only appear in subsequent keys of a model
reference (AASd-125/126/127).
Verified with aas-core3.0 (Python):
.submodels[0].submodel_elements[1].semantic_id
Constraint AASd-121: For References the value of type of the first key of keys shall be one of Globally Identifiables.
.submodels[0].submodel_elements[1].semantic_id
Constraint AASd-123: For model references the value of type of the first key of keys shall be one of AAS identifiables.
The XML output (run 2) contains the equivalent invalid reference.
Note the inconsistency with Property submodel elements in the same output,
which are generated correctly as external references:
{
"idShort": "status",
"modelType": "Property",
"semanticId": {
"type": "ExternalReference",
"keys": [
{
"type": "GlobalReference",
"value": "urn:samm:com.example:1.0.0#status"
}
]
}
}
Expected result:
The Operation's semanticId should — like all other submodel elements generated
from SAMM model elements — be an ExternalReference with a single key of type
GlobalReference carrying the Aspect Model URN:
"semanticId": {
"type": "ExternalReference",
"keys": [
{
"type": "GlobalReference",
"value": "urn:samm:com.example:1.0.0#toggle"
}
]
}
Presumed cause:
AspectModelAasVisitor#buildReferenceToOperation hard-codes
KeyTypes.OPERATION together with ReferenceTypes.MODEL_REFERENCE:
final Key key = new DefaultKey.Builder()
.type( KeyTypes.OPERATION )
.value( DEFAULT_MAPPER.determineIdentifierFor( operation ) )
.build();
return new DefaultReference.Builder().type( ReferenceTypes.MODEL_REFERENCE ).keys( key ).build();
Where: (e.g. component, version, url, your system info)
Input (files/screenshots)
AspectWithOperation.ttl.txt
Output (files/screenshots)
AspectWithOperation.json
Additional context (e.g. references)
How: List of performed steps
samm aspect .\com.example\1.0.0\AspectWithOperation.ttl to aas --format jsonsamm aspect .\com.example\1.0.0\AspectWithOperation.ttl to aas --format xmlWhat: Actual result vs expected result
Actual result:
The
semanticIdof the generatedOperationsubmodel element is emitted as aModelReferencewhose first (and only) key has typeOperation:{ "idShort": "toggle", "modelType": "Operation", "semanticId": { "type": "ModelReference", "keys": [ { "type": "Operation", "value": "urn:samm:com.example:1.0.0#toggle" } ] } }This violates two constraints of the AAS metamodel specification (IDTA-01001):
References, the value ofKey/typeof the first key ofReference/keysshall be one ofGloballyIdentifiables—Operationis not.Key/typeof the first key ofReference/keysshall be one ofAasIdentifiables(AssetAdministrationShell,ConceptDescription,Identifiable,Submodel) —Operationis not. Afragment key like
Operationmay only appear in subsequent keys of a modelreference (AASd-125/126/127).
Verified with aas-core3.0 (Python):
The XML output (run 2) contains the equivalent invalid reference.
Note the inconsistency with
Propertysubmodel elements in the same output,which are generated correctly as external references:
{ "idShort": "status", "modelType": "Property", "semanticId": { "type": "ExternalReference", "keys": [ { "type": "GlobalReference", "value": "urn:samm:com.example:1.0.0#status" } ] } }Expected result:
The Operation's
semanticIdshould — like all other submodel elements generatedfrom SAMM model elements — be an
ExternalReferencewith a single key of typeGlobalReferencecarrying the Aspect Model URN:Presumed cause:
AspectModelAasVisitor#buildReferenceToOperationhard-codesKeyTypes.OPERATIONtogether withReferenceTypes.MODEL_REFERENCE:Where: (e.g. component, version, url, your system info)
(otherwise much appreciated!) AAS generator fixes in 2.15.0 (Fix generated AAS metadata for validator compliance #957, Fix SML and SMC semantic identity handling in AAS conversion #963, Fix AAS generation for list children and SAMM references #995)
Input (files/screenshots)
AspectWithOperation.ttl.txt
Output (files/screenshots)
AspectWithOperation.json
Additional context (e.g. references)