server icon indicating copy to clipboard operation
server copied to clipboard

ValueType is not correctly stored when using the PUT-SubmodelElement-Example

Open lenaxus opened this issue 4 years ago • 1 comments

I want to add a SubmodelElement to my AAS. I first tried your example to add the new Property RotationSpeedNEW:

PUT http://localhost:51310/aas/ExampleMotor/submodels/OperationalData/elements Payload:

{
    "value": "1234",
    "valueId": null,
    "semanticId": {
      "keys": [
        {
          "type": "ConceptDescription",
          "local": true,
          "value": "http://customer.com/cd//1/1/18EBD56F6B43D895",
          "index": 0,
          "idType": "IRI"
        }
      ]
    },
    "constraints": [],
    "hasDataSpecification": [],
    "idShort": "RotationSpeedNEW",
    "category": "VARIABLE",
    "modelType": {
      "name": "Property"
    },
    "valueType": {
      "dataObjectType": {
        "name": "integer"
      }
    }
}

This all worked fine and the Property was added to the AAS. But when looking in detail in the new entry it looks like the valueType is not correctly stored in the AAS because it is empty. This is my result of the

GET http://localhost:51310/aas/ExampleMotor/submodels/OperationalData/elements/RotationSpeedNEW

Result:

{
  "elem": {
    "value": "1234",
    "valueId": null,
    "semanticId": {
      "keys": [
        {
          "type": "ConceptDescription",
          "local": true,
          "value": "http://customer.com/cd//1/1/18EBD56F6B43D895",
          "index": 0,
          "idType": "IRI"
        }
      ]
    },
    "constraints": [],
    "hasDataSpecification": [],
    "idShort": "RotationSpeedNEW",
    "category": "VARIABLE",
    "modelType": {
      "name": "Property"
    },
    "valueType": {
      "dataObjectType": {
        "name": ""
      }
    },
    "kind": "Instance",
    "descriptions": null
  },

There you can see that valueType.dataObjectType.name is empty but in the payload of the PUT-Request it was defined as integer.

Can anyone please help me why this is happening?

lenaxus avatar Nov 22 '21 15:11 lenaxus

It seems that dataObjectType is unspecified and that key should not serialize as in your example. JSON de/serialization seems out of sync with spec and should be fixed.

br-iosb avatar Mar 07 '22 08:03 br-iosb

Hi @lenaxus,

The issue has been fixed in latest version of the server which supports AAS Meta-model V3.0.

juileetikekar avatar Feb 14 '24 10:02 juileetikekar