diff --git a/packages/td-tools/src/util/asset-interface-description.ts b/packages/td-tools/src/util/asset-interface-description.ts index 17194e949..616c23c20 100644 --- a/packages/td-tools/src/util/asset-interface-description.ts +++ b/packages/td-tools/src/util/asset-interface-description.ts @@ -178,7 +178,7 @@ export class AssetInterfaceDescriptionUtil { }, // created, modified, support ? this.createEndpointMetadata(td, protocol, aidID, submodelElementIdShort), // EndpointMetadata like base, security and securityDefinitions - this.createInterfaceMetadata(td, protocol), // InterfaceMetadata like properties, actions and events + this.createInteractionMetadata(td, protocol), // InteractionMetadata like properties, actions and events // Note: "ExternalDescriptor" should contain file values --> not applicable to TD /* { idShort: "ExternalDescriptor", @@ -532,7 +532,7 @@ export class AssetInterfaceDescriptionUtil { } private processSubmodelElement(smInformation: SubmodelInformation, submodelElement: Record): void { - // EndpointMetadata vs. InterfaceMetadata + // EndpointMetadata vs. InteractionMetadata if (submodelElement.value instanceof Array) { // Note: iterate twice over to collect first EndpointMetadata let endpointMetadata: Record = {}; @@ -543,7 +543,7 @@ export class AssetInterfaceDescriptionUtil { // e.g., idShort: base , contentType, securityDefinitions, alternativeEndpointDescriptor? endpointMetadata = smValue; smInformation.endpointMetadataArray.push(endpointMetadata); - } else if (smValue.idShort === "InterfaceMetadata") { + } else if (smValue.idShort === "InteractionMetadata") { // handled later } else if (smValue.idShort === "externalDescriptor") { // needed? @@ -552,11 +552,11 @@ export class AssetInterfaceDescriptionUtil { } } } - // the 2nd time look for InterfaceMetadata that *need* EndpointMetadata + // the 2nd time look for InteractionMetadata that *need* EndpointMetadata for (const smValue of submodelElement.value) { if (smValue instanceof Object) { - if (smValue.idShort === "InterfaceMetadata") { - logInfo("InterfaceMetadata"); + if (smValue.idShort === "InteractionMetadata") { + logInfo("InteractionMetadata"); if (smValue.value instanceof Array) { for (const interactionValue of smValue.value) { if (interactionValue.idShort === "properties") { @@ -929,7 +929,7 @@ export class AssetInterfaceDescriptionUtil { // scheme always values.push({ idShort: "scheme", - semanticId: this.createSemanticId("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"), + semanticId: this.createSemanticId("https://www.w3.org/2019/wot/security#SecurityScheme"), valueType: "xs:string", value: secValue.scheme, modelType: "Property", @@ -1122,9 +1122,9 @@ export class AssetInterfaceDescriptionUtil { } } } else if (protocol.startsWith("modbus")) { - // Modbus: href, modbus_function - // default for modbus:function depending on op, see https://w3c.github.io/wot-binding-templates/bindings/protocols/modbus/index.html#default-mappings - const mbKey = "modbus:function"; + // Modbus: href, modv_function + // default for modv:function depending on op, see https://w3c.github.io/wot-binding-templates/bindings/protocols/modbus/index.html#default-mappings + const mbKey = "modv:function"; if (form[mbKey] == null) { if (this.hasOp(form, "writeproperty") || this.hasOp(form, "invokeaction")) { form[mbKey] = "writeSingleCoil"; @@ -1161,7 +1161,7 @@ export class AssetInterfaceDescriptionUtil { } } - private createInterfaceMetadata(td: ThingDescription, protocol: string): Record { + private createInteractionMetadata(td: ThingDescription, protocol: string): Record { const properties: Array = []; const actions: Array = []; const events: Array = []; @@ -1372,18 +1372,22 @@ export class AssetInterfaceDescriptionUtil { semanticId = "https://www.w3.org/2011/http#fieldName"; } else if (formTerm === "htv:fieldValue") { semanticId = "https://www.w3.org/2011/http#fieldValue"; - } else if (formTerm === "modbus:function") { - semanticId = "https://www.w3.org/2019/wot/modbus#Function"; - } else if (formTerm === "modbus:entity") { - semanticId = "https://www.w3.org/2019/wot/modbus#Entity"; - } else if (formTerm === "modbus:zeroBasedAddressing") { + } else if (formTerm === "modv:function") { + semanticId = "https://www.w3.org/2019/wot/modbus#hasFunction"; + } else if (formTerm === "modv:entity") { + semanticId = "https://www.w3.org/2019/wot/modbus#hasEntity"; + } else if (formTerm === "modv:zeroBasedAddressing") { semanticId = "https://www.w3.org/2019/wot/modbus#hasZeroBasedAddressingFlag"; - } else if (formTerm === "modbus:timeout") { + } else if (formTerm === "modv:timeout") { semanticId = "https://www.w3.org/2019/wot/modbus#hasTimeout"; - } else if (formTerm === "modbus:pollingTime") { + } else if (formTerm === "modv:pollingTime") { semanticId = "https://www.w3.org/2019/wot/modbus#hasPollingTime"; - } else if (formTerm === "modbus:type") { - semanticId = "https://www.w3.org/2019/wot/modbus#type"; + } else if (formTerm === "modv:type") { + semanticId = "https://www.w3.org/2019/wot/modbus#hasPayloadDataType"; + } else if (formTerm === "modv:mostSignificantByte") { + semanticId = "https://www.w3.org/2019/wot/modbus#hasMostSignificantByte"; + } else if (formTerm === "modv:mostSignificantWord") { + semanticId = "https://www.w3.org/2019/wot/modbus#hasMostSignificantWord"; } else if (formTerm === "mqv:retain") { semanticId = "https://www.w3.org/2019/wot/mqtt#hasRetainFlag"; } else if (formTerm === "mqv:controlPacket") { @@ -1497,10 +1501,10 @@ export class AssetInterfaceDescriptionUtil { modelType: "SubmodelElementCollection", }); - const interfaceMetadata: Record = { - idShort: "InterfaceMetadata", + const interactionMetadata: Record = { + idShort: "InteractionMetadata", semanticId: this.createSemanticId( - "https://admin-shell.io/idta/AssetInterfacesDescription/1/0/InterfaceMetadata" + "https://admin-shell.io/idta/AssetInterfacesDescription/1/0/InteractionMetadata" ), supplementalSemanticIds: [this.createSemanticId("https://www.w3.org/2019/wot/td#InteractionAffordance")], // embeddedDataSpecifications ? @@ -1508,7 +1512,7 @@ export class AssetInterfaceDescriptionUtil { modelType: "SubmodelElementCollection", }; - return interfaceMetadata; + return interactionMetadata; } } diff --git a/packages/td-tools/test/AssetInterfaceDescriptionTest.ts b/packages/td-tools/test/AssetInterfaceDescriptionTest.ts index d96d91685..462ce9e78 100644 --- a/packages/td-tools/test/AssetInterfaceDescriptionTest.ts +++ b/packages/td-tools/test/AssetInterfaceDescriptionTest.ts @@ -233,10 +233,8 @@ class AssetInterfaceDescriptionUtilTest { expect(tdObj.properties.device_name.forms[0]) .to.have.property("href") .to.eql("modbus+tcp://192.168.178.146:502/1/40020?quantity=16"); - expect(tdObj.properties.device_name.forms[0]) - .to.have.property("modbus:function") - .to.eql("readHoldingRegisters"); - expect(tdObj.properties.device_name.forms[0]).to.have.property("modbus:type").to.eql("string"); + expect(tdObj.properties.device_name.forms[0]).to.have.property("modv:function").to.eql("readHoldingRegisters"); + expect(tdObj.properties.device_name.forms[0]).to.have.property("modv:type").to.eql("string"); expect(tdObj.properties.device_name.forms[0]) .to.have.property("contentType") .to.eql("application/octet-stream"); @@ -270,8 +268,8 @@ class AssetInterfaceDescriptionUtilTest { expect(tdObj.properties.soc.forms[0]) .to.have.property("href") .to.eql("modbus+tcp://192.168.178.146:502/40361?quantity=1"); - expect(tdObj.properties.soc.forms[0]).to.have.property("modbus:function").to.eql("readHoldingRegisters"); - expect(tdObj.properties.soc.forms[0]).to.have.property("modbus:type").to.eql("uint16be"); + expect(tdObj.properties.soc.forms[0]).to.have.property("modv:function").to.eql("readHoldingRegisters"); + expect(tdObj.properties.soc.forms[0]).to.have.property("modv:type").to.eql("uint16be"); expect(tdObj.properties.soc.forms[0]).to.have.property("contentType").to.eql("application/octet-stream"); expect(tdObj.properties.device_name.forms[0]).not.to.have.property("security"); } @@ -352,11 +350,11 @@ class AssetInterfaceDescriptionUtilTest { expect(hasThingTitle, "No thing title").to.equal(true); expect(hasEndpointMetadata, "No EndpointMetadata").to.equal(true); - // InterfaceMetadata with properties etc - let hasInterfaceMetadata = false; + // InteractionMetadata with properties etc + let hasInteractionMetadata = false; for (const smValue of smInterface.value) { - if (smValue.idShort === "InterfaceMetadata") { - hasInterfaceMetadata = true; + if (smValue.idShort === "InteractionMetadata") { + hasInteractionMetadata = true; expect(smValue).to.have.property("value").to.be.an("array").to.have.lengthOf.greaterThan(0); let hasProperties = false; for (const interactionValues of smValue.value) { @@ -410,12 +408,12 @@ class AssetInterfaceDescriptionUtilTest { } else if (formEntry.idShort === "contentType") { hasContentType = true; expect(formEntry.value).to.equal("application/octet-stream"); - } else if (formEntry.idShort === "modbus_function") { - // vs. "modbus:function" + } else if (formEntry.idShort === "modv_function") { + // vs. "modv:function" hasModbusFunction = true; expect(formEntry.value).to.equal("readHoldingRegisters"); - } else if (formEntry.idShort === "modbus_type") { - // vs. "modbus:type" + } else if (formEntry.idShort === "modv_type") { + // vs. "modv:type" hasModbusType = true; expect(formEntry.value).to.equal("string"); } @@ -476,12 +474,12 @@ class AssetInterfaceDescriptionUtilTest { } else if (formEntry.idShort === "contentType") { hasContentType = true; expect(formEntry.value).to.equal("application/octet-stream"); - } else if (formEntry.idShort === "modbus_function") { - // vs. "modbus:function" + } else if (formEntry.idShort === "modv_function") { + // vs. "modv:function" hasModbusFunction = true; expect(formEntry.value).to.equal("readHoldingRegisters"); - } else if (formEntry.idShort === "modbus_type") { - // vs. "modbus:type" + } else if (formEntry.idShort === "modv_type") { + // vs. "modv:type" hasModbusType = true; expect(formEntry.value).to.equal("uint16be"); } @@ -506,7 +504,7 @@ class AssetInterfaceDescriptionUtilTest { expect(hasProperties).to.equal(true); } } - expect(hasInterfaceMetadata, "No InterfaceMetadata").to.equal(true); + expect(hasInteractionMetadata, "No InteractionMetadata").to.equal(true); } td1Base = "https://www.example.com/"; @@ -671,11 +669,11 @@ class AssetInterfaceDescriptionUtilTest { expect(hasThingTitle, "No thing title").to.equal(true); expect(hasEndpointMetadata, "No EndpointMetadata").to.equal(true); - // InterfaceMetadata with properties etc - let hasInterfaceMetadata = false; + // InteractionMetadata with properties etc + let hasInteractionMetadata = false; for (const smValue of smInterface.value) { - if (smValue.idShort === "InterfaceMetadata") { - hasInterfaceMetadata = true; + if (smValue.idShort === "InteractionMetadata") { + hasInteractionMetadata = true; expect(smValue).to.have.property("value").to.be.an("array").to.have.lengthOf.greaterThan(0); let hasProperties = false; for (const interactionValues of smValue.value) { @@ -806,7 +804,7 @@ class AssetInterfaceDescriptionUtilTest { expect(hasProperties).to.equal(true); } } - expect(hasInterfaceMetadata, "No InterfaceMetadata").to.equal(true); + expect(hasInteractionMetadata, "No InteractionMetadata").to.equal(true); // Test to use all possible prefixes -> in this case it is only https // Note: id is autogenerated (if not present) -> needs to be exluded/removed/set in TD @@ -825,11 +823,11 @@ class AssetInterfaceDescriptionUtilTest { const smInterface = smObj.submodelElements[0]; expect(smInterface).to.have.property("value").to.be.an("array").to.have.lengthOf.greaterThan(0); - // InterfaceMetadata with *no* properties for this protocol - let hasInterfaceMetadata = false; + // InteractionMetadata with *no* properties for this protocol + let hasInteractionMetadata = false; for (const smValue of smInterface.value) { - if (smValue.idShort === "InterfaceMetadata") { - hasInterfaceMetadata = true; + if (smValue.idShort === "InteractionMetadata") { + hasInteractionMetadata = true; expect(smValue).to.have.property("value").to.be.an("array").to.have.lengthOf.greaterThan(0); for (const interactionValues of smValue.value) { if (interactionValues.idShort === "properties") { @@ -838,7 +836,7 @@ class AssetInterfaceDescriptionUtilTest { } } } - expect(hasInterfaceMetadata, "No InterfaceMetadata").to.equal(true); + expect(hasInteractionMetadata, "No InteractionMetadata").to.equal(true); } @test async "should correctly transform sample TD1 into JSON AAS"() { @@ -866,8 +864,8 @@ class AssetInterfaceDescriptionUtilTest { { href: "modbus+tcp://127.0.0.1:60000/1", op: "readproperty", - "modbus:function": "readCoil", - "modbus:pollingTime": 1, + "modv:function": "readCoil", + "modv:pollingTime": 1, }, ], }, @@ -941,11 +939,11 @@ class AssetInterfaceDescriptionUtilTest { expect(hasThingTitle, "No thing title").to.equal(true); expect(hasEndpointMetadata, "No EndpointMetadata").to.equal(true); - // InterfaceMetadata with properties etc - let hasInterfaceMetadata = false; + // InteractionMetadata with properties etc + let hasInteractionMetadata = false; for (const smValue of smInterface.value) { - if (smValue.idShort === "InterfaceMetadata") { - hasInterfaceMetadata = true; + if (smValue.idShort === "InteractionMetadata") { + hasInteractionMetadata = true; expect(smValue).to.have.property("value").to.be.an("array").to.have.lengthOf.greaterThan(0); let hasProperties = false; for (const interactionValues of smValue.value) { @@ -995,10 +993,10 @@ class AssetInterfaceDescriptionUtilTest { hasOp = true; // Note: AID does not know "op" // expect(formEntry.value).to.equal("readproperty"); - } else if (formEntry.idShort === "modbus_function") { + } else if (formEntry.idShort === "modv_function") { hasModbusFunction = true; expect(formEntry.value).to.equal("readCoil"); - } else if (formEntry.idShort === "modbus_pollingTime") { + } else if (formEntry.idShort === "modv_pollingTime") { hasModbusAddress = true; expect(formEntry.value).to.equal("1"); expect(formEntry.valueType).to.equal("xs:int"); @@ -1023,7 +1021,7 @@ class AssetInterfaceDescriptionUtilTest { expect(hasProperties).to.equal(true); } } - expect(hasInterfaceMetadata, "No InterfaceMetadata").to.equal(true); + expect(hasInteractionMetadata, "No InteractionMetadata").to.equal(true); } @test.skip async "should correctly transform counter TD into JSON AAS"() { diff --git a/packages/td-tools/test/util/AIDSchema.json b/packages/td-tools/test/util/AIDSchema.json index b72d1c6e2..b6352ff69 100644 --- a/packages/td-tools/test/util/AIDSchema.json +++ b/packages/td-tools/test/util/AIDSchema.json @@ -1031,7 +1031,7 @@ }, "value": { "title": "Interface HTTP submodelElement collection", - "description": "In this collection, EndpointMetadta and InterfaceMetadata should be mandatory and other elements should be optional", + "description": "In this collection, EndpointMetadta and InteractionMetadata should be mandatory and other elements should be optional", "type": "array", "uniqueItems": true, "unevaluatedItems": false, @@ -1044,7 +1044,7 @@ { "$ref": "#/definitions/supportElement" }, { "$ref": "#/definitions/ExternalDescriptorContainer" }, { "$ref": "#/definitions/HTTPEndpointMetadata" }, - { "$ref": "#/definitions/HTTPInterfaceMetadata" } + { "$ref": "#/definitions/HTTPInteractionMetadata" } ] }, "if": { @@ -1058,7 +1058,7 @@ "contains": { "anyOf": [ { "$ref": "#/definitions/HTTPEndpointMetadata" }, - { "$ref": "#/definitions/HTTPInterfaceMetadata" } + { "$ref": "#/definitions/HTTPInteractionMetadata" } ] }, "minContains": 2, @@ -1084,7 +1084,7 @@ }, "value": { "title": "Interface modbus submodelElement collection", - "description": "In this collection, EndpointMetadta and InterfaceMetadata should be mandatory and other elements should be optional", + "description": "In this collection, EndpointMetadta and InteractionMetadata should be mandatory and other elements should be optional", "type": "array", "uniqueItems": true, "unevaluatedItems": false, @@ -1097,7 +1097,7 @@ { "$ref": "#/definitions/supportElement" }, { "$ref": "#/definitions/ExternalDescriptorContainer" }, { "$ref": "#/definitions/MODBUSEndpointMetadata" }, - { "$ref": "#/definitions/MODBUSInterfaceMetadata" } + { "$ref": "#/definitions/MODBUSInteractionMetadata" } ] }, "if": { @@ -1111,7 +1111,7 @@ "contains": { "anyOf": [ { "$ref": "#/definitions/MODBUSEndpointMetadata" }, - { "$ref": "#/definitions/MODBUSInterfaceMetadata" } + { "$ref": "#/definitions/MODBUSInteractionMetadata" } ] }, "minContains": 2, @@ -1137,7 +1137,7 @@ }, "value": { "title": "Interface MQTT submodelElement collection", - "description": "In this collection, EndpointMetadta and InterfaceMetadata should be mandatory and other elements should be optional", + "description": "In this collection, EndpointMetadta and InteractionMetadata should be mandatory and other elements should be optional", "type": "array", "uniqueItems": true, "unevaluatedItems": false, @@ -1150,7 +1150,7 @@ { "$ref": "#/definitions/supportElement" }, { "$ref": "#/definitions/ExternalDescriptorContainer" }, { "$ref": "#/definitions/MQTTEndpointMetadata" }, - { "$ref": "#/definitions/MQTTInterfaceMetadata" } + { "$ref": "#/definitions/MQTTInteractionMetadata" } ] }, "if": { @@ -1164,7 +1164,7 @@ "contains": { "anyOf": [ { "$ref": "#/definitions/MQTTEndpointMetadata" }, - { "$ref": "#/definitions/MQTTInterfaceMetadata" } + { "$ref": "#/definitions/MQTTInteractionMetadata" } ] }, "minContains": 2, @@ -1353,14 +1353,16 @@ "value": { "uniqueItems": true, "unevaluatedItems": false, - "maxItems": 4, + "maxItems": 6, "type": "array", "items": { "anyOf": [ { "$ref": "#/definitions/securityDefinitionsElement" }, { "$ref": "#/definitions/contentTypeElement" }, { "$ref": "#/definitions/MODBUSbaseElement" }, - { "$ref": "#/definitions/securityElement" } + { "$ref": "#/definitions/securityElement" }, + { "$ref": "#/definitions/modbusMostSignificantByteElement" }, + { "$ref": "#/definitions/modbusMostSignificantWordElement" } ] }, "contains": { @@ -1421,7 +1423,7 @@ } ] }, - "HTTPInterfaceMetadata": { + "HTTPInteractionMetadata": { "allOf": [ { "$ref": "#/definitions/SubmodelElement" @@ -1430,7 +1432,7 @@ "properties": { "idShort": { "type": "string", - "enum": ["InterfaceMetadata"] + "enum": ["InteractionMetadata"] }, "value": { "type": "array", @@ -1440,10 +1442,10 @@ "items": { "anyOf": [ { - "$ref": "#/definitions/HTTPInterfaceMetadataPropertiesElement" + "$ref": "#/definitions/HTTPInteractionMetadataPropertiesElement" }, - { "$ref": "#/definitions/InterfaceMetadataActionsElement" }, - { "$ref": "#/definitions/InterfaceMetadataEventsElement" } + { "$ref": "#/definitions/InteractionMetadataActionsElement" }, + { "$ref": "#/definitions/InteractionMetadataEventsElement" } ] } }, @@ -1454,7 +1456,7 @@ } ] }, - "MODBUSInterfaceMetadata": { + "MODBUSInteractionMetadata": { "allOf": [ { "$ref": "#/definitions/SubmodelElement" @@ -1463,7 +1465,7 @@ "properties": { "idShort": { "type": "string", - "enum": ["InterfaceMetadata"] + "enum": ["InteractionMetadata"] }, "value": { "type": "array", @@ -1473,10 +1475,10 @@ "items": { "anyOf": [ { - "$ref": "#/definitions/ModbusInterfaceMetadataPropertiesElement" + "$ref": "#/definitions/ModbusInteractionMetadataPropertiesElement" }, - { "$ref": "#/definitions/InterfaceMetadataActionsElement" }, - { "$ref": "#/definitions/InterfaceMetadataEventsElement" } + { "$ref": "#/definitions/InteractionMetadataActionsElement" }, + { "$ref": "#/definitions/InteractionMetadataEventsElement" } ] } }, @@ -1487,7 +1489,7 @@ } ] }, - "MQTTInterfaceMetadata": { + "MQTTInteractionMetadata": { "allOf": [ { "$ref": "#/definitions/SubmodelElement" @@ -1496,7 +1498,7 @@ "properties": { "idShort": { "type": "string", - "enum": ["InterfaceMetadata"] + "enum": ["InteractionMetadata"] }, "value": { "type": "array", @@ -1506,10 +1508,10 @@ "items": { "anyOf": [ { - "$ref": "#/definitions/MQTTInterfaceMetadataPropertiesElement" + "$ref": "#/definitions/MQTTInteractionMetadataPropertiesElement" }, - { "$ref": "#/definitions/InterfaceMetadataActionsElement" }, - { "$ref": "#/definitions/InterfaceMetadataEventsElement" } + { "$ref": "#/definitions/InteractionMetadataActionsElement" }, + { "$ref": "#/definitions/InteractionMetadataEventsElement" } ] } }, @@ -1520,7 +1522,7 @@ } ] }, - "HTTPInterfaceMetadataPropertiesElement": { + "HTTPInteractionMetadataPropertiesElement": { "allOf": [ { "$ref": "#/definitions/SubmodelElement" @@ -1544,7 +1546,7 @@ } ] }, - "ModbusInterfaceMetadataPropertiesElement": { + "ModbusInteractionMetadataPropertiesElement": { "allOf": [ { "$ref": "#/definitions/SubmodelElement" @@ -1568,7 +1570,7 @@ } ] }, - "MQTTInterfaceMetadataPropertiesElement": { + "MQTTInteractionMetadataPropertiesElement": { "allOf": [ { "$ref": "#/definitions/SubmodelElement" @@ -1592,7 +1594,7 @@ } ] }, - "InterfaceMetadataActionsElement": { + "InteractionMetadataActionsElement": { "allOf": [ { "$ref": "#/definitions/SubmodelElement" @@ -1619,7 +1621,7 @@ } ] }, - "InterfaceMetadataEventsElement": { + "InteractionMetadataEventsElement": { "allOf": [ { "$ref": "#/definitions/SubmodelElement" @@ -3361,7 +3363,7 @@ "properties": { "idShort": { "type": "string", - "enum": ["modbus_function"] + "enum": ["modv_function"] }, "valueType": { @@ -3391,7 +3393,7 @@ "properties": { "idShort": { "type": "string", - "enum": ["modbus_function"] + "enum": ["modv_function"] }, "valueType": { @@ -3421,7 +3423,7 @@ "properties": { "idShort": { "type": "string", - "enum": ["modbus_entity"] + "enum": ["modv_entity"] }, "valueType": { @@ -3450,7 +3452,7 @@ "properties": { "idShort": { "type": "string", - "enum": ["modbus_zeroBasedAddressing"] + "enum": ["modv_zeroBasedAddressing"] }, "valueType": { @@ -3479,7 +3481,7 @@ "properties": { "idShort": { "type": "string", - "enum": ["modbus_pollingTime"] + "enum": ["modv_pollingTime"] }, "valueType": { @@ -3508,7 +3510,7 @@ "properties": { "idShort": { "type": "string", - "enum": ["modbus_timeout"] + "enum": ["modv_timeout"] }, "valueType": { @@ -3537,7 +3539,36 @@ "properties": { "idShort": { "type": "string", - "enum": ["modbus_type"] + "enum": ["modv_type"] + }, + + "valueType": { + "type": "string" + }, + "value": { + "type": "string" + }, + "valueId": { + "$ref": "#/definitions/Reference" + }, + "modelType": { + "const": "Property" + } + }, + "required": ["valueType"] + } + ] + }, + "modbusMostSignificantByteElement": { + "allOf": [ + { + "$ref": "#/definitions/DataElement" + }, + { + "properties": { + "idShort": { + "type": "string", + "enum": ["modv_mostSignificantByte"] }, "valueType": { @@ -3557,6 +3588,34 @@ } ] }, + "modbusMostSignificantWordElement": { + "allOf": [ + { + "$ref": "#/definitions/DataElement" + }, + { + "properties": { + "idShort": { + "type": "string", + "enum": ["modv_mostSignificantWord"] + }, + "valueType": { + "type": "string" + }, + "value": { + "type": "string" + }, + "valueId": { + "$ref": "#/definitions/Reference" + }, + "modelType": { + "const": "Property" + } + }, + "required": ["valueType"] + } + ] + }, "httpFormsElement": { "allOf": [ { @@ -3641,7 +3700,7 @@ "value": { "uniqueItems": true, "unevaluatedItems": false, - "maxItems": 9, + "maxItems": 11, "type": "array", "items": { "anyOf": [ @@ -3653,7 +3712,9 @@ { "$ref": "#/definitions/modbusPollingTimeElement" }, { "$ref": "#/definitions/modbusTypeElement" }, { "$ref": "#/definitions/modbusZeroBasedAddressingElement" }, - { "$ref": "#/definitions/modbustimeoutElement" } + { "$ref": "#/definitions/modbustimeoutElement" }, + { "$ref": "#/definitions/modbusMostSignificantByteElement" }, + { "$ref": "#/definitions/modbusMostSignificantWordElement" } ] }, "contains": { diff --git a/packages/td-tools/test/util/counterHTTP.json b/packages/td-tools/test/util/counterHTTP.json index a8239fd37..8748bef79 100644 --- a/packages/td-tools/test/util/counterHTTP.json +++ b/packages/td-tools/test/util/counterHTTP.json @@ -237,13 +237,13 @@ "modelType": "SubmodelElementCollection" }, { - "idShort": "InterfaceMetadata", + "idShort": "InteractionMetadata", "semanticId": { "type": "ExternalReference", "keys": [ { "type": "GlobalReference", - "value": "https://admin-shell.io/idta/AssetInterfacesDescription/1/0/InterfaceMetadata" + "value": "https://admin-shell.io/idta/AssetInterfacesDescription/1/0/InteractionMetadata" } ] }, diff --git a/packages/td-tools/test/util/inverterModbus.json b/packages/td-tools/test/util/inverterModbus.json index aab0d99c7..a1de562ec 100644 --- a/packages/td-tools/test/util/inverterModbus.json +++ b/packages/td-tools/test/util/inverterModbus.json @@ -105,7 +105,7 @@ "modelType": "SubmodelElementCollection" }, { - "idShort": "InterfaceMetadata", + "idShort": "InteractionMetadata", "value": [ { "idShort": "properties", @@ -135,13 +135,13 @@ "modelType": "Property" }, { - "idShort": "modbus_function", + "idShort": "modv_function", "valueType": "xs:string", "value": "readHoldingRegisters", "modelType": "Property" }, { - "idShort": "modbus_type", + "idShort": "modv_type", "valueType": "xs:string", "value": "string", "modelType": "Property" @@ -190,13 +190,13 @@ "modelType": "Property" }, { - "idShort": "modbus_function", + "idShort": "modv_function", "valueType": "xs:string", "value": "readHoldingRegisters", "modelType": "Property" }, { - "idShort": "modbus_type", + "idShort": "modv_type", "valueType": "xs:string", "value": "uint16be", "modelType": "Property"