diff --git a/packages/td-tools/test/AssetInterfaceDescriptionTest.ts b/packages/td-tools/test/AssetInterfaceDescriptionTest.ts index 4a99f8cfc..b7a739437 100644 --- a/packages/td-tools/test/AssetInterfaceDescriptionTest.ts +++ b/packages/td-tools/test/AssetInterfaceDescriptionTest.ts @@ -24,213 +24,7 @@ import { ThingDescription } from "wot-typescript-definitions"; class AssetInterfaceDescriptionUtilTest { private assetInterfaceDescriptionUtil = new AssetInterfaceDescriptionUtil(); - @test.skip async "should correctly transform sample JSON AID_submodel HTTP v03 into a TD"() { - const modelFullString = await (await fs.readFile("test/util/AID_v03.json")).toString(); - const modelFull = JSON.parse(modelFullString); - const modelSub = modelFull.submodels[1]; - - // submodel only + HTTP only - const td = this.assetInterfaceDescriptionUtil.transformSM2TD( - JSON.stringify(modelSub), - `{"title": "myTitle", "id": "urn:uuid:3deca264-4f90-4321-a5ea-f197e6a1c7cf"}`, - "HTTP" - ); - const tdObj = JSON.parse(td); - // console.log(JSON.stringify(tdObj, null, 2)); - - // security - expect(tdObj).to.have.property("security").to.be.an("array").to.have.lengthOf(2); - expect(tdObj.securityDefinitions[tdObj.security[0]]).to.have.property("scheme").that.equals("basic"); - expect(tdObj.securityDefinitions[tdObj.security[1]]).to.have.property("scheme").that.equals("oauth2"); - // form entries limited to 1 - expect(tdObj).to.have.property("properties").to.have.property("voltage"); - expect(tdObj) - .to.have.property("properties") - .to.have.property("voltage") - .to.have.property("forms") - .to.be.an("array") - .to.have.lengthOf(1); - } - - @test.skip async "should correctly transform sample JSON AID_v03 into a TD"() { - const modelAID = (await fs.readFile("test/util/AID_v03.json")).toString(); - const td = this.assetInterfaceDescriptionUtil.transformAAS2TD( - modelAID, - `{"title": "myTitle", "id": "urn:uuid:3deca264-4f90-4321-a5ea-f197e6a1c7cf"}` - ); - - const tdObj = JSON.parse(td); - // console.log(JSON.stringify(tdObj, null, 2)); - // TODO proper TD validation based on playground and/or JSON schema? - expect(tdObj).to.have.property("@context").that.equals("https://www.w3.org/2022/wot/td/v1.1"); - expect(tdObj).to.have.property("title").that.equals("myTitle"); - expect(tdObj).to.have.property("id").that.equals("urn:uuid:3deca264-4f90-4321-a5ea-f197e6a1c7cf"); - - expect(tdObj).to.have.property("security").to.be.an("array").to.have.lengthOf(5); - // Security Modbus - expect(tdObj.securityDefinitions[tdObj.security[0]]).to.have.property("scheme").that.equals("nosec"); - // Security HTTP - expect(tdObj.securityDefinitions[tdObj.security[1]]).to.have.property("scheme").that.equals("basic"); - expect(tdObj.securityDefinitions[tdObj.security[1]]).to.have.property("in").that.equals("header"); - expect(tdObj.securityDefinitions[tdObj.security[2]]).to.have.property("scheme").that.equals("oauth2"); - expect(tdObj.securityDefinitions[tdObj.security[2]]).to.have.property("flow").that.equals("client"); - expect(tdObj.securityDefinitions[tdObj.security[2]]) - .to.have.property("token") - .that.equals("https://example.com/token"); - expect(tdObj.securityDefinitions[tdObj.security[2]]).to.have.property("scopes").that.equals("limited"); - // Security OPC - expect(tdObj.securityDefinitions[tdObj.security[3]]).to.have.property("scheme").that.equals("uasec"); - expect(tdObj.securityDefinitions[tdObj.security[3]]) - .to.have.property("mode") - .that.equals('["none", "Sign", "Sign & Encrypt"]'); - expect(tdObj.securityDefinitions[tdObj.security[3]]) - .to.have.property("policy") - .that.equals('["none", "Basic128RSA15", "Basic256", "Basic256SHA256"]'); - // Security MQTT - expect(tdObj.securityDefinitions[tdObj.security[4]]).to.have.property("scheme").that.equals("basic"); - expect(tdObj.securityDefinitions[tdObj.security[4]]).to.have.property("in").that.equals("header"); - - expect(tdObj).to.have.property("properties").to.have.property("voltage"); - - // form entries - expect(tdObj) - .to.have.property("properties") - .to.have.property("voltage") - .to.have.property("forms") - .to.be.an("array") - .to.have.lengthOf(4); - // Modbus - expect(tdObj.properties.voltage.forms[0]).to.have.property("href").to.eql("modbus+tcp://192.168.1.187:502"); - expect(tdObj.properties.voltage.forms[0]) - .to.have.property("contentType") - .to.eql("application/octet-stream;byteSeq=BIG_ENDIAN"); - expect(tdObj.properties.voltage.forms[0]).to.have.property("modbus:function").to.eql("readHoldingRegisters"); - expect(tdObj.properties.voltage.forms[0]).to.have.property("modbus:address").to.eql("40001"); - expect(tdObj.properties.voltage.forms[0]).to.have.property("modbus:quantity").to.eql("2"); // not a proper number in AID -> valueType *not* set - expect(tdObj.properties.voltage.forms[0]).to.have.property("security").to.deep.equal(["0_sc"]); - // HTTP - expect(tdObj.properties.voltage.forms[1]) - .to.have.property("href") - .to.eql("https://192.168.1.187" + "/properties/voltage"); - expect(tdObj.properties.voltage.forms[1]).to.have.property("htv:methodName").to.eql("GET"); - expect(tdObj.properties.voltage.forms[1]).to.have.property("contentType").to.eql("text/xml"); // Note: "application/json" overridden locally - expect(tdObj.properties.voltage.forms[1]).to.have.property("subprotocol").to.eql("longpoll"); - expect(tdObj.properties.voltage.forms[1]).to.have.property("security").to.deep.equal(["1_sc", "2_sc"]); - // OPC - expect(tdObj.properties.voltage.forms[2]) - .to.have.property("href") - .to.eql("opc.tcp://192.168.1.187:4840/UAserver"); - expect(tdObj.properties.voltage.forms[2]).to.have.property("contentType").to.eql("application/x.opcua.binary"); - expect(tdObj.properties.voltage.forms[2]).to.have.property("ua:nodeId").to.eql('"ns=3;i=29"'); - expect(tdObj.properties.voltage.forms[2]) - .to.have.property("ua:expandedNodeId") - .to.eql(' "nsu=http://example.com/OPCUAServer/energy;i=29"'); - expect(tdObj.properties.voltage.forms[2]).to.have.property("ua:method").to.eql("READ"); - expect(tdObj.properties.voltage.forms[2]).to.have.property("security").to.deep.equal(["3_sc"]); - // MQTT - expect(tdObj.properties.voltage.forms[3]).to.have.property("href").to.eql("mqtt://test.mosquitto:1884"); - expect(tdObj.properties.voltage.forms[3]).to.have.property("contentType").to.eql("application/json"); - expect(tdObj.properties.voltage.forms[3]) - .to.have.property("mqv:topic") - .to.eql("/devices/thing1/properties/voltage"); - expect(tdObj.properties.voltage.forms[3]).to.have.property("mqv:controlPacket").to.eql("mqv:subscribe"); - expect(tdObj.properties.voltage.forms[3]).to.have.property("mqv:retain").to.eql(true); // value is string but valueType states boolean - expect(tdObj.properties.voltage.forms[3]).to.have.property("security").to.deep.equal(["4_sc"]); - - // filter HTTP submodel only - const td2 = this.assetInterfaceDescriptionUtil.transformAAS2TD(modelAID, `{"title": "myTitle"}`, "HTTP"); - const td2Obj = JSON.parse(td2); - // security - expect(td2Obj).to.have.property("security").to.be.an("array").to.have.lengthOf(2); - expect(td2Obj.securityDefinitions[td2Obj.security[0]]).to.have.property("scheme").that.equals("basic"); - expect(td2Obj.securityDefinitions[td2Obj.security[1]]).to.have.property("scheme").that.equals("oauth2"); - // form entries limited to 1 - expect(td2Obj).to.have.property("properties").to.have.property("voltage"); - expect(td2Obj) - .to.have.property("properties") - .to.have.property("voltage") - .to.have.property("forms") - .to.be.an("array") - .to.have.lengthOf(1); - - // filter Modbus and HTTP and submodel only - const td3 = this.assetInterfaceDescriptionUtil.transformAAS2TD(modelAID, `{"title": "myTitle"}`, "Modbus|HTTP"); - const td3Obj = JSON.parse(td3); - // security - expect(td3Obj).to.have.property("security").to.be.an("array").to.have.lengthOf(3); - expect(td3Obj.securityDefinitions[td3Obj.security[0]]).to.have.property("scheme").that.equals("nosec"); - expect(td3Obj.securityDefinitions[td3Obj.security[1]]).to.have.property("scheme").that.equals("basic"); - expect(td3Obj.securityDefinitions[td3Obj.security[2]]).to.have.property("scheme").that.equals("oauth2"); - // form entries limited to 2 - expect(td3Obj).to.have.property("properties").to.have.property("voltage"); - expect(td3Obj) - .to.have.property("properties") - .to.have.property("voltage") - .to.have.property("forms") - .to.be.an("array") - .to.have.lengthOf(2); - } - - @test.skip async "should correctly transform sample JSON AID_v03 for counter into a TD"() { - const modelAID = (await fs.readFile("test/util/AID_v03_counter.json")).toString(); - const td = this.assetInterfaceDescriptionUtil.transformAAS2TD(modelAID, `{"title": "counter"}`); - - const tdObj = JSON.parse(td); - // console.log(JSON.stringify(tdObj, null, 2)); - // TODO proper TD validation based on playground and/or JSON schema? - expect(tdObj).to.have.property("@context").that.equals("https://www.w3.org/2022/wot/td/v1.1"); - expect(tdObj).to.have.property("title").that.equals("counter"); - - expect(tdObj).to.have.property("security").to.be.an("array").to.have.lengthOf(1); - expect(tdObj.securityDefinitions[tdObj.security[0]]).to.have.property("scheme").that.equals("nosec"); - - expect(tdObj).to.have.property("properties").to.have.property("count"); - // to check if count properties has type element that is equals the value defined in AID->integer - expect(tdObj) - .to.have.property("properties") - .to.have.property("count") - .to.have.property("type") - .that.equals("integer"); - - // form entries - expect(tdObj) - .to.have.property("properties") - .to.have.property("count") - .to.have.property("forms") - .to.be.an("array") - .to.have.lengthOf(1); - // HTTP - expect(tdObj.properties.count.forms[0]) - .to.have.property("href") - .to.eql("http://plugfest.thingweb.io:8083/counter" + "/properties/count"); - expect(tdObj.properties.count.forms[0]).to.have.property("htv:methodName").to.eql("GET"); - expect(tdObj.properties.count.forms[0]).to.have.property("contentType").to.eql("application/json"); - // security not needed at form level in this case - expect(tdObj.properties.count.forms[0]).not.to.have.property("security"); - - // TODO actions and events for counter thing - - // check RegEx capability with fully qualified submodel - const td2 = this.assetInterfaceDescriptionUtil.transformAAS2TD( - modelAID, - `{"title": "counter"}`, - "InterfaceHTTP" - ); - const td2Obj = JSON.parse(td2); - expect(tdObj).to.deep.equal(td2Obj); - - // check RegEx capability with search pattern for submodel - const td3 = this.assetInterfaceDescriptionUtil.transformAAS2TD(modelAID, `{"title": "counter"}`, "HTTP*"); - const td3Obj = JSON.parse(td3); - expect(tdObj).to.deep.equal(td3Obj); - - // check RegEx capability with fully unknown submodel - const td4 = this.assetInterfaceDescriptionUtil.transformAAS2TD(modelAID, `{"title": "counter"}`, "OPC*"); - const td4Obj = JSON.parse(td4); - expect(td4Obj).to.not.have.property("properties"); - } - - @test async "should correctly transform counterHTTP_minimal into a TD"() { + @test async "should correctly transform counterHTTP into a TD"() { const modelAID = (await fs.readFile("test/util/counterHTTP.json")).toString(); const td = this.assetInterfaceDescriptionUtil.transformAAS2TD(modelAID, `{"title": "counter"}`); diff --git a/packages/td-tools/test/util/AID_v03.aasx b/packages/td-tools/test/util/AID_v03.aasx deleted file mode 100644 index d0c3cc6da..000000000 Binary files a/packages/td-tools/test/util/AID_v03.aasx and /dev/null differ diff --git a/packages/td-tools/test/util/AID_v03.json b/packages/td-tools/test/util/AID_v03.json deleted file mode 100644 index efaa533c0..000000000 --- a/packages/td-tools/test/util/AID_v03.json +++ /dev/null @@ -1,1629 +0,0 @@ -{ - "assetAdministrationShells": [ - { - "hasDataSpecification": [], - "asset": { - "keys": [] - }, - "submodels": [ - { - "keys": [ - { - "type": "Submodel", - "local": true, - "value": "https://example.com/ids/sm/4333_9041_7022_4184", - "index": 0, - "idType": "IRI" - } - ] - } - ], - "conceptDictionaries": [], - "identification": { - "idType": "IRI", - "id": "https://example.com/ids/aas/7474_9002_6022_1115" - }, - "idShort": "SampleAAS", - "modelType": { - "name": "AssetAdministrationShell" - } - } - ], - "assets": [], - "submodels": [ - { - "semanticId": { - "keys": [] - }, - "qualifiers": [], - "hasDataSpecification": [], - "identification": { - "idType": "IRI", - "id": "https://example.com/ids/sm/8574_9002_6022_5297" - }, - "idShort": "AssetInterfaceDescription", - "modelType": { - "name": "Submodel" - }, - "kind": "Instance", - "submodelElements": [ - { - "ordered": false, - "allowDuplicates": false, - "semanticId": { - "keys": [] - }, - "constraints": [], - "hasDataSpecification": [], - "idShort": "EndpointMetadata", - "modelType": { - "name": "SubmodelElementCollection" - }, - "value": [ - { - "value": "modbus+tcp://192.168.1.187:502", - "semanticId": { - "keys": [] - }, - "constraints": [], - "hasDataSpecification": [], - "idShort": "base", - "modelType": { - "name": "Property" - }, - "valueType": { - "dataObjectType": { - "name": "" - } - }, - "kind": "Instance" - }, - { - "value": "application/octet-stream;byteSeq=BIG_ENDIAN", - "semanticId": { - "keys": [] - }, - "constraints": [], - "hasDataSpecification": [], - "idShort": "contentType", - "modelType": { - "name": "Property" - }, - "valueType": { - "dataObjectType": { - "name": "" - } - }, - "kind": "Instance" - } - ], - "kind": "Instance" - }, - { - "ordered": false, - "allowDuplicates": false, - "semanticId": { - "keys": [] - }, - "constraints": [], - "hasDataSpecification": [], - "idShort": "InterfaceMetadata", - "modelType": { - "name": "SubmodelElementCollection" - }, - "value": [ - { - "ordered": false, - "allowDuplicates": false, - "semanticId": { - "keys": [] - }, - "constraints": [], - "hasDataSpecification": [], - "idShort": "Properties", - "modelType": { - "name": "SubmodelElementCollection" - }, - "value": [ - { - "value": "", - "semanticId": { - "keys": [] - }, - "constraints": [ - { - "semanticId": { - "keys": [] - }, - "type": "modbus:function", - "valueType": "", - "valueId": { - "keys": [] - }, - "value": "readHoldingRegisters", - "modelType": { - "name": "Qualifier" - } - }, - { - "type": "modbus:address", - "valueType": "", - "value": "40001", - "modelType": { - "name": "Qualifier" - } - }, - { - "type": "modbus:quantity", - "valueType": "", - "value": "2", - "modelType": { - "name": "Qualifier" - } - } - ], - "hasDataSpecification": [], - "idShort": "voltage", - "modelType": { - "name": "Property" - }, - "valueType": { - "dataObjectType": { - "name": "double" - } - }, - "kind": "Instance" - }, - { - "ordered": false, - "allowDuplicates": false, - "semanticId": { - "keys": [] - }, - "constraints": [ - { - "type": "valueType", - "valueType": "", - "value": "double", - "modelType": { - "name": "Qualifier" - } - } - ], - "hasDataSpecification": [], - "idShort": "voltage", - "modelType": { - "name": "SubmodelElementCollection" - }, - "value": [ - { - "value": "readHoldingRegisters", - "semanticId": { - "keys": [] - }, - "constraints": [], - "hasDataSpecification": [], - "idShort": "modbus:function", - "modelType": { - "name": "Property" - }, - "valueType": { - "dataObjectType": { - "name": "" - } - }, - "kind": "Instance" - }, - { - "value": "40001", - "semanticId": { - "keys": [] - }, - "constraints": [], - "hasDataSpecification": [], - "idShort": "modbus:address", - "modelType": { - "name": "Property" - }, - "valueType": { - "dataObjectType": { - "name": "" - } - }, - "kind": "Instance" - }, - { - "value": "2", - "semanticId": { - "keys": [] - }, - "constraints": [], - "hasDataSpecification": [], - "idShort": "modbus:quantity", - "modelType": { - "name": "Property" - }, - "valueType": { - "dataObjectType": { - "name": "" - } - }, - "kind": "Instance" - } - ], - "kind": "Instance" - } - ], - "kind": "Instance" - }, - { - "ordered": false, - "allowDuplicates": false, - "semanticId": { - "keys": [] - }, - "constraints": [], - "hasDataSpecification": [], - "idShort": "Operations", - "modelType": { - "name": "SubmodelElementCollection" - }, - "value": [], - "kind": "Instance" - }, - { - "ordered": false, - "allowDuplicates": false, - "semanticId": { - "keys": [] - }, - "constraints": [], - "hasDataSpecification": [], - "idShort": "Events", - "modelType": { - "name": "SubmodelElementCollection" - }, - "value": [], - "kind": "Instance" - } - ], - "kind": "Instance" - } - ] - }, - { - "semanticId": { - "keys": [] - }, - "qualifiers": [], - "hasDataSpecification": [], - "identification": { - "idType": "IRI", - "id": "https://example.com/ids/sm/4333_9041_7022_4184" - }, - "idShort": "AssetInterfaceDescription", - "modelType": { - "name": "Submodel" - }, - "kind": "Instance", - "submodelElements": [ - { - "ordered": false, - "allowDuplicates": false, - "semanticId": { - "keys": [] - }, - "constraints": [], - "hasDataSpecification": [], - "idShort": "Interface1 (Modbus; s. slides from 21.6.2022)", - "modelType": { - "name": "SubmodelElementCollection" - }, - "value": [ - { - "ordered": false, - "allowDuplicates": false, - "semanticId": { - "keys": [] - }, - "constraints": [], - "hasDataSpecification": [], - "idShort": "EndpointMetadata", - "modelType": { - "name": "SubmodelElementCollection" - }, - "value": [ - { - "value": "modbus+tcp://192.168.1.187:502", - "semanticId": { - "keys": [] - }, - "constraints": [], - "hasDataSpecification": [], - "idShort": "base", - "modelType": { - "name": "Property" - }, - "valueType": { - "dataObjectType": { - "name": "" - } - }, - "kind": "Instance" - }, - { - "value": "application/octet-stream;byteSeq=BIG_ENDIAN", - "semanticId": { - "keys": [] - }, - "constraints": [], - "hasDataSpecification": [], - "idShort": "contentType", - "modelType": { - "name": "Property" - }, - "valueType": { - "dataObjectType": { - "name": "" - } - }, - "kind": "Instance" - } - ], - "kind": "Instance" - }, - { - "ordered": false, - "allowDuplicates": false, - "semanticId": { - "keys": [] - }, - "constraints": [], - "hasDataSpecification": [], - "idShort": "InterfaceMetadata", - "modelType": { - "name": "SubmodelElementCollection" - }, - "value": [ - { - "ordered": false, - "allowDuplicates": false, - "semanticId": { - "keys": [] - }, - "constraints": [], - "hasDataSpecification": [], - "idShort": "Properties", - "modelType": { - "name": "SubmodelElementCollection" - }, - "value": [ - { - "ordered": false, - "allowDuplicates": false, - "semanticId": { - "keys": [] - }, - "constraints": [ - { - "type": "valueType", - "valueType": "", - "value": "double", - "modelType": { - "name": "Qualifier" - } - } - ], - "hasDataSpecification": [], - "idShort": "voltage", - "modelType": { - "name": "SubmodelElementCollection" - }, - "value": [ - { - "value": "readHoldingRegisters", - "semanticId": { - "keys": [] - }, - "constraints": [], - "hasDataSpecification": [], - "idShort": "modbus:function", - "modelType": { - "name": "Property" - }, - "valueType": { - "dataObjectType": { - "name": "" - } - }, - "kind": "Instance" - }, - { - "value": "40001", - "semanticId": { - "keys": [] - }, - "constraints": [], - "hasDataSpecification": [], - "idShort": "modbus:address", - "modelType": { - "name": "Property" - }, - "valueType": { - "dataObjectType": { - "name": "" - } - }, - "kind": "Instance" - }, - { - "value": "2", - "semanticId": { - "keys": [] - }, - "constraints": [], - "hasDataSpecification": [], - "idShort": "modbus:quantity", - "modelType": { - "name": "Property" - }, - "valueType": { - "dataObjectType": { - "name": "" - } - }, - "kind": "Instance" - }, - { - "ordered": false, - "allowDuplicates": false, - "semanticId": { - "keys": [] - }, - "constraints": [], - "hasDataSpecification": [], - "idShort": "dataMapping", - "modelType": { - "name": "SubmodelElementCollection" - }, - "value": [], - "kind": "Instance" - } - ], - "kind": "Instance" - } - ], - "kind": "Instance" - }, - { - "ordered": false, - "allowDuplicates": false, - "semanticId": { - "keys": [] - }, - "constraints": [], - "hasDataSpecification": [], - "idShort": "Operations", - "modelType": { - "name": "SubmodelElementCollection" - }, - "value": [], - "kind": "Instance" - }, - { - "ordered": false, - "allowDuplicates": false, - "semanticId": { - "keys": [] - }, - "constraints": [], - "hasDataSpecification": [], - "idShort": "Events", - "modelType": { - "name": "SubmodelElementCollection" - }, - "value": [], - "kind": "Instance" - } - ], - "kind": "Instance" - } - ], - "kind": "Instance" - }, - { - "ordered": false, - "allowDuplicates": false, - "semanticId": { - "keys": [] - }, - "constraints": [], - "hasDataSpecification": [], - "idShort": "Interface2 (HTTP; s. slides from 19.7.2022)", - "modelType": { - "name": "SubmodelElementCollection" - }, - "value": [ - { - "ordered": false, - "allowDuplicates": false, - "semanticId": { - "keys": [] - }, - "constraints": [], - "hasDataSpecification": [], - "idShort": "EndpointMetadata", - "modelType": { - "name": "SubmodelElementCollection" - }, - "value": [ - { - "value": "https://192.168.1.187", - "semanticId": { - "keys": [] - }, - "constraints": [], - "hasDataSpecification": [], - "idShort": "base", - "modelType": { - "name": "Property" - }, - "valueType": { - "dataObjectType": { - "name": "" - } - }, - "kind": "Instance" - }, - { - "value": "application/json", - "semanticId": { - "keys": [] - }, - "constraints": [], - "hasDataSpecification": [], - "idShort": "contentType", - "modelType": { - "name": "Property" - }, - "valueType": { - "dataObjectType": { - "name": "" - } - }, - "kind": "Instance" - }, - { - "ordered": false, - "allowDuplicates": false, - "semanticId": { - "keys": [] - }, - "constraints": [], - "hasDataSpecification": [], - "idShort": "securityDefinitions", - "modelType": { - "name": "SubmodelElementCollection" - }, - "value": [ - { - "ordered": false, - "allowDuplicates": false, - "semanticId": { - "keys": [] - }, - "constraints": [], - "hasDataSpecification": [], - "idShort": "basic", - "modelType": { - "name": "SubmodelElementCollection" - }, - "value": [ - { - "value": "header", - "semanticId": { - "keys": [] - }, - "constraints": [], - "hasDataSpecification": [], - "idShort": "in", - "modelType": { - "name": "Property" - }, - "valueType": { - "dataObjectType": { - "name": "" - } - }, - "kind": "Instance" - } - ], - "kind": "Instance" - }, - { - "ordered": false, - "allowDuplicates": false, - "semanticId": { - "keys": [] - }, - "constraints": [], - "hasDataSpecification": [], - "idShort": "oauth2", - "modelType": { - "name": "SubmodelElementCollection" - }, - "value": [ - { - "value": "client", - "semanticId": { - "keys": [] - }, - "constraints": [], - "hasDataSpecification": [], - "idShort": "flow", - "modelType": { - "name": "Property" - }, - "valueType": { - "dataObjectType": { - "name": "" - } - }, - "kind": "Instance" - }, - { - "value": "https://example.com/token", - "semanticId": { - "keys": [] - }, - "constraints": [], - "hasDataSpecification": [], - "idShort": "token", - "modelType": { - "name": "Property" - }, - "valueType": { - "dataObjectType": { - "name": "" - } - }, - "kind": "Instance" - }, - { - "value": "limited", - "semanticId": { - "keys": [] - }, - "constraints": [], - "hasDataSpecification": [], - "idShort": "scopes", - "modelType": { - "name": "Property" - }, - "valueType": { - "dataObjectType": { - "name": "" - } - }, - "kind": "Instance" - } - ], - "kind": "Instance" - } - ], - "kind": "Instance" - }, - { - "ordered": false, - "allowDuplicates": false, - "semanticId": { - "keys": [] - }, - "constraints": [], - "hasDataSpecification": [], - "idShort": "alternativeEndpointDescriptor", - "modelType": { - "name": "SubmodelElementCollection" - }, - "value": [ - { - "mimeType": "application/yaml", - "value": "Device.OpenAPI.yaml", - "semanticId": { - "keys": [] - }, - "constraints": [], - "hasDataSpecification": [], - "idShort": "OpenAPI", - "modelType": { - "name": "File" - }, - "kind": "Instance" - }, - { - "mimeType": "application/td+json", - "value": "Device.td.jsonld", - "semanticId": { - "keys": [] - }, - "constraints": [], - "hasDataSpecification": [], - "idShort": "ThingDescription", - "modelType": { - "name": "File" - }, - "kind": "Instance" - } - ], - "kind": "Instance" - } - ], - "kind": "Instance" - }, - { - "ordered": false, - "allowDuplicates": false, - "semanticId": { - "keys": [] - }, - "constraints": [], - "hasDataSpecification": [], - "idShort": "InterfaceMetadata", - "modelType": { - "name": "SubmodelElementCollection" - }, - "value": [ - { - "ordered": false, - "allowDuplicates": false, - "semanticId": { - "keys": [] - }, - "constraints": [], - "hasDataSpecification": [], - "idShort": "Properties", - "modelType": { - "name": "SubmodelElementCollection" - }, - "value": [ - { - "ordered": false, - "allowDuplicates": false, - "semanticId": { - "keys": [] - }, - "constraints": [ - { - "type": "valueType", - "valueType": "", - "value": "double", - "modelType": { - "name": "Qualifier" - } - } - ], - "hasDataSpecification": [], - "idShort": "voltage", - "modelType": { - "name": "SubmodelElementCollection" - }, - "value": [ - { - "value": "/properties/voltage", - "semanticId": { - "keys": [] - }, - "constraints": [], - "hasDataSpecification": [], - "idShort": "href", - "modelType": { - "name": "Property" - }, - "valueType": { - "dataObjectType": { - "name": "anyURI" - } - }, - "kind": "Instance" - }, - { - "value": "GET", - "semanticId": { - "keys": [] - }, - "constraints": [], - "hasDataSpecification": [], - "idShort": "htv:methodName", - "modelType": { - "name": "Property" - }, - "valueType": { - "dataObjectType": { - "name": "" - } - }, - "kind": "Instance" - }, - { - "value": "text/xml", - "semanticId": { - "keys": [] - }, - "constraints": [], - "hasDataSpecification": [], - "idShort": "contentType", - "modelType": { - "name": "Property" - }, - "valueType": { - "dataObjectType": { - "name": "" - } - }, - "kind": "Instance", - "descriptions": [ - { - "language": "", - "text": "overwrites the globale definition (from endpoint metadata)" - } - ] - }, - { - "value": "longpoll", - "semanticId": { - "keys": [] - }, - "constraints": [], - "hasDataSpecification": [], - "idShort": "subprotocol", - "modelType": { - "name": "Property" - }, - "valueType": { - "dataObjectType": { - "name": "" - } - }, - "kind": "Instance" - }, - { - "ordered": false, - "allowDuplicates": false, - "semanticId": { - "keys": [] - }, - "constraints": [], - "hasDataSpecification": [], - "idShort": "dataMapping", - "modelType": { - "name": "SubmodelElementCollection" - }, - "value": [], - "kind": "Instance" - } - ], - "kind": "Instance" - } - ], - "kind": "Instance" - }, - { - "ordered": false, - "allowDuplicates": false, - "semanticId": { - "keys": [] - }, - "constraints": [], - "hasDataSpecification": [], - "idShort": "Operations", - "modelType": { - "name": "SubmodelElementCollection" - }, - "value": [], - "kind": "Instance" - }, - { - "ordered": false, - "allowDuplicates": false, - "semanticId": { - "keys": [] - }, - "constraints": [], - "hasDataSpecification": [], - "idShort": "Events", - "modelType": { - "name": "SubmodelElementCollection" - }, - "value": [], - "kind": "Instance" - } - ], - "kind": "Instance" - } - ], - "kind": "Instance" - }, - { - "ordered": false, - "allowDuplicates": false, - "semanticId": { - "keys": [] - }, - "constraints": [], - "hasDataSpecification": [], - "idShort": "Interface3 (OPC UA; s. slides from 2.8.2022)", - "modelType": { - "name": "SubmodelElementCollection" - }, - "value": [ - { - "ordered": false, - "allowDuplicates": false, - "semanticId": { - "keys": [] - }, - "constraints": [], - "hasDataSpecification": [], - "idShort": "EndpointMetadata", - "modelType": { - "name": "SubmodelElementCollection" - }, - "value": [ - { - "value": "opc.tcp://192.168.1.187:4840/UAserver", - "semanticId": { - "keys": [] - }, - "constraints": [], - "hasDataSpecification": [], - "idShort": "base", - "modelType": { - "name": "Property" - }, - "valueType": { - "dataObjectType": { - "name": "" - } - }, - "kind": "Instance" - }, - { - "value": "application/x.opcua.binary", - "semanticId": { - "keys": [] - }, - "constraints": [], - "hasDataSpecification": [], - "idShort": "contentType", - "modelType": { - "name": "Property" - }, - "valueType": { - "dataObjectType": { - "name": "" - } - }, - "kind": "Instance" - }, - { - "ordered": false, - "allowDuplicates": false, - "semanticId": { - "keys": [] - }, - "constraints": [], - "hasDataSpecification": [], - "idShort": "securityDefinitions", - "modelType": { - "name": "SubmodelElementCollection" - }, - "value": [ - { - "ordered": false, - "allowDuplicates": false, - "semanticId": { - "keys": [] - }, - "constraints": [], - "hasDataSpecification": [], - "idShort": "uasec", - "modelType": { - "name": "SubmodelElementCollection" - }, - "value": [ - { - "value": "[\"none\", \"Sign\", \"Sign & Encrypt\"]", - "semanticId": { - "keys": [] - }, - "constraints": [], - "hasDataSpecification": [], - "idShort": "mode", - "modelType": { - "name": "Property" - }, - "valueType": { - "dataObjectType": { - "name": "" - } - }, - "kind": "Instance" - }, - { - "value": "[\"none\", \"Basic128RSA15\", \"Basic256\", \"Basic256SHA256\"]", - "semanticId": { - "keys": [] - }, - "constraints": [], - "hasDataSpecification": [], - "idShort": "policy", - "modelType": { - "name": "Property" - }, - "valueType": { - "dataObjectType": { - "name": "" - } - }, - "kind": "Instance" - } - ], - "kind": "Instance" - } - ], - "kind": "Instance" - }, - { - "ordered": false, - "allowDuplicates": false, - "semanticId": { - "keys": [] - }, - "constraints": [], - "hasDataSpecification": [], - "idShort": "alternativeEndpointDescriptor", - "modelType": { - "name": "SubmodelElementCollection" - }, - "value": [ - { - "value": { - "keys": [] - }, - "semanticId": { - "keys": [] - }, - "constraints": [], - "hasDataSpecification": [], - "idShort": "OPC UA Data Sheet SM", - "modelType": { - "name": "ReferenceElement" - }, - "kind": "Instance" - }, - { - "mimeType": "text/xml", - "value": "ua.nodeset.xml", - "semanticId": { - "keys": [] - }, - "constraints": [], - "hasDataSpecification": [], - "idShort": "Nodeset", - "modelType": { - "name": "File" - }, - "kind": "Instance" - } - ], - "kind": "Instance" - } - ], - "kind": "Instance" - }, - { - "ordered": false, - "allowDuplicates": false, - "semanticId": { - "keys": [] - }, - "constraints": [], - "hasDataSpecification": [], - "idShort": "InterfaceMetadata", - "modelType": { - "name": "SubmodelElementCollection" - }, - "value": [ - { - "ordered": false, - "allowDuplicates": false, - "semanticId": { - "keys": [] - }, - "constraints": [], - "hasDataSpecification": [], - "idShort": "Properties", - "modelType": { - "name": "SubmodelElementCollection" - }, - "value": [ - { - "ordered": false, - "allowDuplicates": false, - "semanticId": { - "keys": [] - }, - "constraints": [ - { - "type": "valueType", - "valueType": "", - "value": "double", - "modelType": { - "name": "Qualifier" - } - } - ], - "hasDataSpecification": [], - "idShort": "voltage", - "modelType": { - "name": "SubmodelElementCollection" - }, - "value": [ - { - "value": "\"ns=3;i=29\"", - "semanticId": { - "keys": [] - }, - "constraints": [], - "hasDataSpecification": [], - "idShort": "ua:nodeId", - "modelType": { - "name": "Property" - }, - "valueType": { - "dataObjectType": { - "name": "" - } - }, - "kind": "Instance" - }, - { - "value": " \"nsu=http://example.com/OPCUAServer/energy;i=29\"", - "semanticId": { - "keys": [] - }, - "constraints": [], - "hasDataSpecification": [], - "idShort": "ua:expandedNodeId", - "modelType": { - "name": "Property" - }, - "valueType": { - "dataObjectType": { - "name": "string" - } - }, - "kind": "Instance", - "descriptions": [ - { - "language": "", - "text": "alternative to nodeId" - } - ] - }, - { - "value": "READ", - "semanticId": { - "keys": [] - }, - "constraints": [], - "hasDataSpecification": [], - "idShort": "ua:method", - "modelType": { - "name": "Property" - }, - "valueType": { - "dataObjectType": { - "name": "" - } - }, - "kind": "Instance" - }, - { - "ordered": false, - "allowDuplicates": false, - "semanticId": { - "keys": [] - }, - "constraints": [], - "hasDataSpecification": [], - "idShort": "dataMapping", - "modelType": { - "name": "SubmodelElementCollection" - }, - "value": [], - "kind": "Instance" - } - ], - "kind": "Instance" - } - ], - "kind": "Instance" - }, - { - "ordered": false, - "allowDuplicates": false, - "semanticId": { - "keys": [] - }, - "constraints": [], - "hasDataSpecification": [], - "idShort": "Operations", - "modelType": { - "name": "SubmodelElementCollection" - }, - "value": [], - "kind": "Instance" - }, - { - "ordered": false, - "allowDuplicates": false, - "semanticId": { - "keys": [] - }, - "constraints": [], - "hasDataSpecification": [], - "idShort": "Events", - "modelType": { - "name": "SubmodelElementCollection" - }, - "value": [], - "kind": "Instance" - } - ], - "kind": "Instance" - } - ], - "kind": "Instance" - }, - { - "ordered": false, - "allowDuplicates": false, - "semanticId": { - "keys": [] - }, - "constraints": [], - "hasDataSpecification": [], - "idShort": "Interface4 (MQTT; s. slides from 16.8.2022)", - "modelType": { - "name": "SubmodelElementCollection" - }, - "value": [ - { - "ordered": false, - "allowDuplicates": false, - "semanticId": { - "keys": [] - }, - "constraints": [], - "hasDataSpecification": [], - "idShort": "EndpointMetadata", - "modelType": { - "name": "SubmodelElementCollection" - }, - "value": [ - { - "value": "mqtt://test.mosquitto:1884", - "semanticId": { - "keys": [] - }, - "constraints": [], - "hasDataSpecification": [], - "idShort": "base", - "modelType": { - "name": "Property" - }, - "valueType": { - "dataObjectType": { - "name": "" - } - }, - "kind": "Instance" - }, - { - "value": "3.1.1", - "semanticId": { - "keys": [] - }, - "constraints": [], - "hasDataSpecification": [], - "idShort": "mqv:version", - "modelType": { - "name": "Property" - }, - "valueType": { - "dataObjectType": { - "name": "string" - } - }, - "kind": "Instance" - }, - { - "value": "application/json", - "semanticId": { - "keys": [] - }, - "constraints": [], - "hasDataSpecification": [], - "idShort": "contentType", - "modelType": { - "name": "Property" - }, - "valueType": { - "dataObjectType": { - "name": "" - } - }, - "kind": "Instance" - }, - { - "ordered": false, - "allowDuplicates": false, - "semanticId": { - "keys": [] - }, - "constraints": [], - "hasDataSpecification": [], - "idShort": "securityDefinitions", - "modelType": { - "name": "SubmodelElementCollection" - }, - "value": [ - { - "ordered": false, - "allowDuplicates": false, - "semanticId": { - "keys": [] - }, - "constraints": [], - "hasDataSpecification": [], - "idShort": "basic", - "modelType": { - "name": "SubmodelElementCollection" - }, - "value": [ - { - "value": "header", - "semanticId": { - "keys": [] - }, - "constraints": [], - "hasDataSpecification": [], - "idShort": "in", - "modelType": { - "name": "Property" - }, - "valueType": { - "dataObjectType": { - "name": "" - } - }, - "kind": "Instance" - } - ], - "kind": "Instance" - } - ], - "kind": "Instance" - }, - { - "ordered": false, - "allowDuplicates": false, - "semanticId": { - "keys": [] - }, - "constraints": [], - "hasDataSpecification": [], - "idShort": "alternativeEndpointDescriptor", - "modelType": { - "name": "SubmodelElementCollection" - }, - "value": [ - { - "mimeType": "text/xml", - "value": "", - "semanticId": { - "keys": [] - }, - "constraints": [], - "hasDataSpecification": [], - "idShort": "OPC UA P/S MQTT Configuration File", - "modelType": { - "name": "File" - }, - "kind": "Instance" - }, - { - "mimeType": "application/td+json", - "value": "Device.td.jsonld", - "semanticId": { - "keys": [] - }, - "constraints": [], - "hasDataSpecification": [], - "idShort": "ThingDescription", - "modelType": { - "name": "File" - }, - "kind": "Instance" - } - ], - "kind": "Instance" - } - ], - "kind": "Instance" - }, - { - "ordered": false, - "allowDuplicates": false, - "semanticId": { - "keys": [] - }, - "constraints": [], - "hasDataSpecification": [], - "idShort": "InterfaceMetadata", - "modelType": { - "name": "SubmodelElementCollection" - }, - "value": [ - { - "ordered": false, - "allowDuplicates": false, - "semanticId": { - "keys": [] - }, - "constraints": [], - "hasDataSpecification": [], - "idShort": "Properties", - "modelType": { - "name": "SubmodelElementCollection" - }, - "value": [ - { - "ordered": false, - "allowDuplicates": false, - "semanticId": { - "keys": [] - }, - "constraints": [ - { - "type": "valueType", - "valueType": "", - "value": "double", - "modelType": { - "name": "Qualifier" - } - } - ], - "hasDataSpecification": [], - "idShort": "voltage", - "modelType": { - "name": "SubmodelElementCollection" - }, - "value": [ - { - "value": "/devices/thing1/properties/voltage", - "semanticId": { - "keys": [] - }, - "constraints": [], - "hasDataSpecification": [], - "idShort": "mqv:topic", - "modelType": { - "name": "Property" - }, - "valueType": { - "dataObjectType": { - "name": "" - } - }, - "kind": "Instance" - }, - { - "value": "mqv:subscribe", - "semanticId": { - "keys": [] - }, - "constraints": [], - "hasDataSpecification": [], - "idShort": "mqv:controlPacket", - "modelType": { - "name": "Property" - }, - "valueType": { - "dataObjectType": { - "name": "" - } - }, - "kind": "Instance" - }, - { - "value": "true", - "semanticId": { - "keys": [] - }, - "constraints": [], - "hasDataSpecification": [], - "idShort": "mqv:retain", - "modelType": { - "name": "Property" - }, - "valueType": { - "dataObjectType": { - "name": "boolean" - } - }, - "kind": "Instance" - }, - { - "ordered": false, - "allowDuplicates": false, - "semanticId": { - "keys": [] - }, - "constraints": [], - "hasDataSpecification": [], - "idShort": "dataMapping", - "modelType": { - "name": "SubmodelElementCollection" - }, - "value": [], - "kind": "Instance" - } - ], - "kind": "Instance" - } - ], - "kind": "Instance" - }, - { - "ordered": false, - "allowDuplicates": false, - "semanticId": { - "keys": [] - }, - "constraints": [], - "hasDataSpecification": [], - "idShort": "Operations", - "modelType": { - "name": "SubmodelElementCollection" - }, - "value": [], - "kind": "Instance" - }, - { - "ordered": false, - "allowDuplicates": false, - "semanticId": { - "keys": [] - }, - "constraints": [], - "hasDataSpecification": [], - "idShort": "Events", - "modelType": { - "name": "SubmodelElementCollection" - }, - "value": [], - "kind": "Instance" - } - ], - "kind": "Instance" - } - ], - "kind": "Instance" - } - ] - } - ], - "conceptDescriptions": [] -} diff --git a/packages/td-tools/test/util/AID_v03_counter.aasx b/packages/td-tools/test/util/AID_v03_counter.aasx deleted file mode 100644 index 1ac10693f..000000000 Binary files a/packages/td-tools/test/util/AID_v03_counter.aasx and /dev/null differ diff --git a/packages/td-tools/test/util/AID_v03_counter.json b/packages/td-tools/test/util/AID_v03_counter.json deleted file mode 100644 index 18dd7cb55..000000000 --- a/packages/td-tools/test/util/AID_v03_counter.json +++ /dev/null @@ -1,276 +0,0 @@ -{ - "assetAdministrationShells": [ - { - "hasDataSpecification": [], - "asset": { - "keys": [] - }, - "submodels": [ - { - "keys": [ - { - "type": "Submodel", - "local": true, - "value": "https://example.com/ids/sm/8153_8071_1122_3509", - "index": 0, - "idType": "IRI" - } - ] - } - ], - "conceptDictionaries": [], - "identification": { - "idType": "IRI", - "id": "https://example.com/ids/aas/7474_9002_6022_1115" - }, - "idShort": "SampleAAS", - "modelType": { - "name": "AssetAdministrationShell" - } - } - ], - "assets": [], - "submodels": [ - { - "semanticId": { - "keys": [] - }, - "qualifiers": [], - "hasDataSpecification": [], - "identification": { - "idType": "IRI", - "id": "https://example.com/ids/sm/8153_8071_1122_3509" - }, - "idShort": "AssetInterfaceDescription", - "modelType": { - "name": "Submodel" - }, - "kind": "Instance", - "submodelElements": [ - { - "ordered": false, - "allowDuplicates": false, - "semanticId": { - "keys": [] - }, - "constraints": [], - "hasDataSpecification": [], - "idShort": "InterfaceHTTP", - "modelType": { - "name": "SubmodelElementCollection" - }, - "value": [ - { - "ordered": false, - "allowDuplicates": false, - "semanticId": { - "keys": [] - }, - "constraints": [], - "hasDataSpecification": [], - "idShort": "EndpointMetadata", - "modelType": { - "name": "SubmodelElementCollection" - }, - "value": [ - { - "value": "http://plugfest.thingweb.io:8083/counter", - "semanticId": { - "keys": [] - }, - "constraints": [], - "hasDataSpecification": [], - "idShort": "base", - "modelType": { - "name": "Property" - }, - "valueType": { - "dataObjectType": { - "name": "" - } - }, - "kind": "Instance" - }, - { - "value": "application/json", - "semanticId": { - "keys": [] - }, - "constraints": [], - "hasDataSpecification": [], - "idShort": "contentType", - "modelType": { - "name": "Property" - }, - "valueType": { - "dataObjectType": { - "name": "" - } - }, - "kind": "Instance" - }, - { - "ordered": false, - "allowDuplicates": false, - "semanticId": { - "keys": [] - }, - "constraints": [], - "hasDataSpecification": [], - "idShort": "securityDefinitions", - "modelType": { - "name": "SubmodelElementCollection" - }, - "value": [ - { - "ordered": false, - "allowDuplicates": false, - "semanticId": { - "keys": [] - }, - "constraints": [], - "hasDataSpecification": [], - "idShort": "nosec", - "modelType": { - "name": "SubmodelElementCollection" - }, - "value": [], - "kind": "Instance" - } - ], - "kind": "Instance" - } - ], - "kind": "Instance" - }, - { - "ordered": false, - "allowDuplicates": false, - "semanticId": { - "keys": [] - }, - "constraints": [], - "hasDataSpecification": [], - "idShort": "InterfaceMetadata", - "modelType": { - "name": "SubmodelElementCollection" - }, - "value": [ - { - "ordered": false, - "allowDuplicates": false, - "semanticId": { - "keys": [] - }, - "constraints": [], - "hasDataSpecification": [], - "idShort": "Properties", - "modelType": { - "name": "SubmodelElementCollection" - }, - "value": [ - { - "ordered": false, - "allowDuplicates": false, - "semanticId": { - "keys": [] - }, - "constraints": [ - { - "type": "valueType", - "valueType": "", - "value": "integer", - "modelType": { - "name": "Qualifier" - } - } - ], - "hasDataSpecification": [], - "idShort": "count", - "modelType": { - "name": "SubmodelElementCollection" - }, - "value": [ - { - "value": "/properties/count", - "semanticId": { - "keys": [] - }, - "constraints": [], - "hasDataSpecification": [], - "idShort": "href", - "modelType": { - "name": "Property" - }, - "valueType": { - "dataObjectType": { - "name": "anyURI" - } - }, - "kind": "Instance" - }, - { - "value": "GET", - "semanticId": { - "keys": [] - }, - "constraints": [], - "hasDataSpecification": [], - "idShort": "htv:methodName", - "modelType": { - "name": "Property" - }, - "valueType": { - "dataObjectType": { - "name": "" - } - }, - "kind": "Instance" - } - ], - "kind": "Instance" - } - ], - "kind": "Instance" - }, - { - "ordered": false, - "allowDuplicates": false, - "semanticId": { - "keys": [] - }, - "constraints": [], - "hasDataSpecification": [], - "idShort": "Operations", - "modelType": { - "name": "SubmodelElementCollection" - }, - "value": [], - "kind": "Instance" - }, - { - "ordered": false, - "allowDuplicates": false, - "semanticId": { - "keys": [] - }, - "constraints": [], - "hasDataSpecification": [], - "idShort": "Events", - "modelType": { - "name": "SubmodelElementCollection" - }, - "value": [], - "kind": "Instance" - } - ], - "kind": "Instance" - } - ], - "kind": "Instance" - } - ] - } - ], - "conceptDescriptions": [] -}