diff --git a/packages/td-tools/src/util/asset-interface-description.ts b/packages/td-tools/src/util/asset-interface-description.ts index f172e08e4..af04337e4 100644 --- a/packages/td-tools/src/util/asset-interface-description.ts +++ b/packages/td-tools/src/util/asset-interface-description.ts @@ -22,6 +22,7 @@ import debug from "debug"; import { ThingDescription } from "wot-typescript-definitions"; import { FormElementBase, PropertyElement } from "wot-thing-model-types"; import isAbsoluteUrl = require("is-absolute-url"); +import URLToolkit = require("url-toolkit"); const namespace = "node-wot:td-tools:asset-interface-description-util"; const logDebug = debug(`${namespace}:debug`); const logInfo = debug(`${namespace}:info`); @@ -176,9 +177,10 @@ export class AssetInterfaceDescriptionUtil { semanticId: this.createSemanticId("https://www.w3.org/2019/wot/td#title"), }, // created, modified, support ? - this.createEndpointMetadata(td, aidID, submodelElementIdShort), // EndpointMetadata like base, security and securityDefinitions + this.createEndpointMetadata(td, protocol, aidID, submodelElementIdShort), // EndpointMetadata like base, security and securityDefinitions this.createInterfaceMetadata(td, protocol), // InterfaceMetadata like properties, actions and events - { + // Note: "ExternalDescriptor" should contain file values --> not applicable to TD + /* { idShort: "ExternalDescriptor", semanticId: this.createSemanticId( "https://admin-shell.io/idta/AssetInterfacesDescription/1/0/ExternalDescriptor" @@ -186,7 +188,7 @@ export class AssetInterfaceDescriptionUtil { // embeddedDataSpecifications ? value: [], modelType: "SubmodelElementCollection", - }, + }, */ ], modelType: "SubmodelElementCollection", }; @@ -834,21 +836,38 @@ export class AssetInterfaceDescriptionUtil { private createEndpointMetadata( td: ThingDescription, + protocol: string, submodelIdShort: string, submodelElementIdShort: string ): Record { const values: Array = []; - // base ? - if (td.base != null) { - values.push({ - idShort: "base", - semanticId: this.createSemanticId("https://www.w3.org/2019/wot/td#baseURI"), - valueType: "xs:anyURI", - value: td.base, // TODO - modelType: "Property", - }); + // base (AID requires base) + let base = td.base ?? "NO_BASE"; + if (td.base == null && td.properties) { + // do best effort if base is not specified by looking at property forms + for (const propertyKey in td.properties) { + const property: PropertyElement = td.properties[propertyKey]; + // check whether form exists for a given protocol (prefix) + const formElementPicked = this.getFormForProtocol(property, protocol); + if (formElementPicked?.href !== undefined) { + const urlParts = URLToolkit.parseURL(formElementPicked.href); + if (urlParts != null) { + // keep scheme and netLoc only + urlParts.path = urlParts.params = urlParts.query = urlParts.fragment = ""; + base = URLToolkit.buildURLFromParts(urlParts); + continue; // abort to loop over remaining properties + } + } + } } + values.push({ + idShort: "base", + semanticId: this.createSemanticId("https://www.w3.org/2019/wot/td#baseURI"), + valueType: "xs:anyURI", + value: base, + modelType: "Property", + }); // TODO wrong place.. not allowed in TD spec? /* @@ -890,14 +909,16 @@ export class AssetInterfaceDescriptionUtil { }, ], }, + modelType: "ReferenceElement", }); } } values.push({ idShort: "security", semanticId: this.createSemanticId("https://www.w3.org/2019/wot/td#hasSecurityConfiguration"), + typeValueListElement: "ReferenceElement", value: securityValues, - modelType: "SubmodelElementCollection", + modelType: "SubmodelElementList", }); // securityDefinitions @@ -1049,6 +1070,21 @@ export class AssetInterfaceDescriptionUtil { return endpointMetadata; } + private getFormForProtocol(property: PropertyElement, protocol: string): FormElementBase | undefined { + let formElementPicked: FormElementBase | undefined; + // check whether protocol prefix exists for a form + if (property.forms) { + for (const formElementProperty of property.forms) { + if (formElementProperty.href != null && formElementProperty.href.startsWith(protocol)) { + formElementPicked = formElementProperty; + // found matching form --> abort loop + break; + } + } + } + return formElementPicked; + } + private createInterfaceMetadata(td: ThingDescription, protocol: string): Record { const properties: Array = []; const actions: Array = []; @@ -1058,19 +1094,10 @@ export class AssetInterfaceDescriptionUtil { // Properties if (td.properties) { for (const propertyKey in td.properties) { - const propertyValue: PropertyElement = td.properties[propertyKey]; - - // check whether protocol prefix exists for a form - let formElementPicked: FormElementBase | undefined; - if (propertyValue.forms) { - for (const formElementProperty of propertyValue.forms) { - if (formElementProperty.href != null && formElementProperty.href.startsWith(protocol)) { - formElementPicked = formElementProperty; - // found matching form --> abort loop - break; - } - } - } + const property: PropertyElement = td.properties[propertyKey]; + + // check whether form exists for a given protocol (prefix) + const formElementPicked = this.getFormForProtocol(property, protocol); if (formElementPicked === undefined) { // do not add this property, since there will be no href of interest continue; @@ -1078,41 +1105,40 @@ export class AssetInterfaceDescriptionUtil { const propertyValues: Array = []; // type - if (propertyValue.type != null) { + if (property.type != null) { propertyValues.push({ idShort: "type", semanticId: this.createSemanticId("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"), valueType: "xs:string", - value: propertyValue.type, + value: property.type, modelType: "Property", }); // special AID treatment - if (propertyValue.minimum != null || propertyValue.maximum != null) { + if (property.minimum != null || property.maximum != null) { const minMax: { [k: string]: unknown } = { idShort: "min_max", semanticId: this.createSemanticId( "https://admin-shell.io/idta/AssetInterfacesDescription/1/0/minMaxRange" ), supplementalSemanticIds: [], - valueType: - "integer".localeCompare(propertyValue.type) === 0 ? "xs:integer" : "xs:double", + valueType: "integer".localeCompare(property.type) === 0 ? "xs:integer" : "xs:double", modelType: "Range", }; - if (propertyValue.minimum != null) { - minMax.min = propertyValue.minimum.toString(); + if (property.minimum != null) { + minMax.min = property.minimum.toString(); (minMax.supplementalSemanticIds as Array).push( this.createSemanticId("https://www.w3.org/2019/wot/json-schema#minimum") ); } - if (propertyValue.maximum != null) { - minMax.max = propertyValue.maximum.toString(); + if (property.maximum != null) { + minMax.max = property.maximum.toString(); (minMax.supplementalSemanticIds as Array).push( this.createSemanticId("https://www.w3.org/2019/wot/json-schema#maximum") ); } propertyValues.push(minMax); } - if (propertyValue.minItems != null || propertyValue.maxItems != null) { + if (property.minItems != null || property.maxItems != null) { const itemsRange: { [k: string]: unknown } = { idShort: "itemsRange", semanticId: this.createSemanticId( @@ -1122,21 +1148,21 @@ export class AssetInterfaceDescriptionUtil { valueType: "xs:integer", modelType: "Range", }; - if (propertyValue.minItems != null) { - itemsRange.min = propertyValue.minItems.toString(); + if (property.minItems != null) { + itemsRange.min = property.minItems.toString(); (itemsRange.supplementalSemanticIds as Array).push( this.createSemanticId("https://www.w3.org/2019/wot/json-schema#minItems") ); } - if (propertyValue.maxItems != null) { - itemsRange.max = propertyValue.maxItems.toString(); + if (property.maxItems != null) { + itemsRange.max = property.maxItems.toString(); (itemsRange.supplementalSemanticIds as Array).push( this.createSemanticId("https://www.w3.org/2019/wot/json-schema#maxItems") ); } propertyValues.push(itemsRange); } - if (propertyValue.minLength != null || propertyValue.maxLength != null) { + if (property.minLength != null || property.maxLength != null) { const lengthRange: { [k: string]: unknown } = { idShort: "lengthRange", semanticId: this.createSemanticId( @@ -1146,14 +1172,14 @@ export class AssetInterfaceDescriptionUtil { valueType: "xs:integer", modelType: "Range", }; - if (propertyValue.minLength != null) { - lengthRange.min = propertyValue.minLength.toString(); + if (property.minLength != null) { + lengthRange.min = property.minLength.toString(); (lengthRange.supplementalSemanticIds as Array).push( this.createSemanticId("https://www.w3.org/2019/wot/json-schema#minLength") ); } - if (propertyValue.maxLength != null) { - lengthRange.max = propertyValue.maxLength.toString(); + if (property.maxLength != null) { + lengthRange.max = property.maxLength.toString(); (lengthRange.supplementalSemanticIds as Array).push( this.createSemanticId("https://www.w3.org/2019/wot/json-schema#maxLength") ); @@ -1162,72 +1188,67 @@ export class AssetInterfaceDescriptionUtil { } } // title - if (propertyValue.title != null) { + if (property.title != null) { propertyValues.push({ idShort: "title", semanticId: this.createSemanticId("https://www.w3.org/2019/wot/td#title"), valueType: "xs:string", - value: propertyValue.title, + value: property.title, modelType: "Property", }); } // description - if (propertyValue.description != null) { - propertyValues.push({ - idShort: "description", - valueType: "xs:string", - value: propertyValue.description, - modelType: "Property", - }); + if (property.description != null) { + // AID deals with description in level above } // observable (if it deviates from the default == false only) - if (propertyValue.observable != null && propertyValue.observable === true) { + if (property.observable != null && property.observable === true) { propertyValues.push({ idShort: "observable", semanticId: this.createSemanticId("https://www.w3.org/2019/wot/td#isObservable"), valueType: "xs:boolean", - value: `${propertyValue.observable}`, // in AID represented as string + value: `${property.observable}`, // in AID represented as string modelType: "Property", }); } // contentMediaType - if (propertyValue.contentMediaType != null) { + if (property.contentMediaType != null) { propertyValues.push({ idShort: "contentMediaType", semanticId: this.createSemanticId( "https://www.w3.org/2019/wot/json-schema#contentMediaType" ), valueType: "xs:string", - value: propertyValue.contentMediaType, + value: property.contentMediaType, modelType: "Property", }); } // TODO enum // const - if (propertyValue.const != null) { + if (property.const != null) { propertyValues.push({ idShort: "const", valueType: "xs:string", - value: propertyValue.const, + value: property.const, modelType: "Property", }); } // default - if (propertyValue.default != null) { + if (property.default != null) { propertyValues.push({ idShort: "default", semanticId: this.createSemanticId("https://www.w3.org/2019/wot/json-schema#default"), - valueType: this.getSimpleValueTypeXsd(propertyValue.default), - value: propertyValue.default, + valueType: this.getSimpleValueTypeXsd(property.default), + value: property.default, modelType: "Property", }); } // unit - if (propertyValue.unit != null) { + if (property.unit != null) { propertyValues.push({ idShort: "unit", valueType: "xs:string", - value: propertyValue.unit, + value: property.unit, modelType: "Property", }); } @@ -1282,8 +1303,8 @@ export class AssetInterfaceDescriptionUtil { semanticId = "https://www.w3.org/2019/wot/modbus#hasTimeout"; } else if (formTerm === "modbus: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 === "modbus:type") { + semanticId = "https://www.w3.org/2019/wot/modbus#type"; } else if (formTerm === "mqv:retain") { semanticId = "https://www.w3.org/2019/wot/mqtt#hasRetainFlag"; } else if (formTerm === "mqv:controlPacket") { @@ -1301,6 +1322,9 @@ export class AssetInterfaceDescriptionUtil { typeof formValue === "number" || typeof formValue === "boolean" ) { + // AID schema restricts terms in form to a finite set of *allowed* terms + // e.g., "op" is not allowed + // at the momement all of them have "semanticId" -> use this as check if (semanticId !== undefined) { propertyForm.push({ idShort: formTerm, @@ -1310,12 +1334,13 @@ export class AssetInterfaceDescriptionUtil { modelType: "Property", }); } else { - propertyForm.push({ - idShort: formTerm, - valueType: this.getSimpleValueTypeXsd(formValue), - value: formValue.toString(), - modelType: "Property", - }); + // unknown AID term + /* propertyForm.push({ + idShort: formTerm, + valueType: this.getSimpleValueTypeXsd(formValue), + value: formValue.toString(), + modelType: "Property", + }); */ } } @@ -1330,21 +1355,21 @@ export class AssetInterfaceDescriptionUtil { } let description; - if (propertyValue.descriptions) { + if (property.descriptions) { description = []; - for (const langKey in propertyValue.descriptions) { - const langValue = propertyValue.descriptions[langKey]; + for (const langKey in property.descriptions) { + const langValue = property.descriptions[langKey]; description.push({ language: langKey, text: langValue, }); } - } else if (propertyValue.description != null) { + } else if (property.description != null) { // fallback description = []; description.push({ language: "en", // TODO where to get language identifier - text: propertyValue.description, + text: property.description, }); } diff --git a/packages/td-tools/test/AssetInterfaceDescriptionTest.ts b/packages/td-tools/test/AssetInterfaceDescriptionTest.ts index 0f0f842fb..ac7b0a633 100644 --- a/packages/td-tools/test/AssetInterfaceDescriptionTest.ts +++ b/packages/td-tools/test/AssetInterfaceDescriptionTest.ts @@ -20,12 +20,39 @@ import { AssetInterfaceDescriptionUtil } from "../src/util/asset-interface-descr import { promises as fs } from "fs"; import { ThingDescription } from "wot-typescript-definitions"; +import Ajv, { ValidateFunction, ErrorObject } from "ajv"; +import * as AIDSchema from "../test/util/AIDSchema.json"; + +const aidSchema = AIDSchema; +const ajv = new Ajv({ strict: false }); + @suite("tests to verify the Asset Interface Description Utils") class AssetInterfaceDescriptionUtilTest { private assetInterfaceDescriptionUtil = new AssetInterfaceDescriptionUtil(); + aidValidator = ajv.compile(aidSchema) as ValidateFunction; + + // Note: Should this be a functionality of the AID tool OR for the time beeing just a test/control + validateAID(aidSubmodel: object): { valid: boolean; errors?: string } { + const isValid = this.aidValidator(aidSubmodel); + let errors; + if (!isValid) { + errors = this.aidValidator.errors?.map((o: ErrorObject) => o.message).join("\n"); + } + return { + valid: isValid, + errors, + }; + } + @test async "should correctly transform counterHTTP into a TD"() { const modelAID = (await fs.readFile("test/util/counterHTTP.json")).toString(); + + const modelAIDobj = JSON.parse(modelAID); + expect(modelAIDobj).to.have.property("submodels").to.be.an("array").to.have.lengthOf(1); + const isValid = this.validateAID(modelAIDobj.submodels[0]); + expect(isValid.valid, isValid.errors).to.equal(true); + const td = this.assetInterfaceDescriptionUtil.transformAAS2TD(modelAID, `{"title": "bla"}`); const tdObj = JSON.parse(td); @@ -167,6 +194,12 @@ class AssetInterfaceDescriptionUtilTest { @test async "should correctly transform inverterModbus into a TD"() { const modelAID = (await fs.readFile("test/util/inverterModbus.json")).toString(); + + const modelAIDobj = JSON.parse(modelAID); + expect(modelAIDobj).to.have.property("submodels").to.be.an("array").to.have.lengthOf(1); + const isValid = this.validateAID(modelAIDobj.submodels[0]); + expect(isValid.valid, isValid.errors).to.equal(true); + const td = this.assetInterfaceDescriptionUtil.transformAAS2TD(modelAID, `{"title": "bla"}`); const tdObj = JSON.parse(td); @@ -196,7 +229,7 @@ class AssetInterfaceDescriptionUtilTest { .to.have.property("forms") .to.be.an("array") .to.have.lengthOf(1); - expect(tdObj.properties.device_name.forms[0]).to.have.property("op").to.eql("readproperty"); + // expect(tdObj.properties.device_name.forms[0]).to.have.property("op").to.eql("readproperty"); // AID does not know "op" expect(tdObj.properties.device_name.forms[0]) .to.have.property("href") .to.eql("modbus+tcp://192.168.178.146:502/1/40020?quantity=16"); @@ -233,7 +266,7 @@ class AssetInterfaceDescriptionUtilTest { .to.have.property("forms") .to.be.an("array") .to.have.lengthOf(1); - expect(tdObj.properties.soc.forms[0]).to.have.property("op").to.eql("readproperty"); + // expect(tdObj.properties.soc.forms[0]).to.have.property("op").to.eql("readproperty"); // AID does not know "op" expect(tdObj.properties.soc.forms[0]) .to.have.property("href") .to.eql("modbus+tcp://192.168.178.146:502/40361?quantity=1"); @@ -250,6 +283,8 @@ class AssetInterfaceDescriptionUtilTest { const aidOutput = this.assetInterfaceDescriptionUtil.transformTD2SM(td); const smObj = JSON.parse(aidOutput); + const isValid = this.validateAID(smObj); + expect(isValid.valid, isValid.errors).to.equal(true); expect(smObj).to.have.property("idShort").that.equals("AssetInterfacesDescription"); expect(smObj).to.have.property("submodelElements").to.be.an("array").to.have.lengthOf.greaterThan(0); const smInterface = smObj.submodelElements[0]; @@ -370,7 +405,8 @@ class AssetInterfaceDescriptionUtilTest { expect(formEntry.value).to.equal("1/40020?quantity=16"); } else if (formEntry.idShort === "op") { hasOp = true; - expect(formEntry.value).to.equal("readproperty"); + // Note: AID does not know "op" + // expect(formEntry.value).to.equal("readproperty"); } else if (formEntry.idShort === "contentType") { hasContentType = true; expect(formEntry.value).to.equal("application/octet-stream"); @@ -385,7 +421,7 @@ class AssetInterfaceDescriptionUtilTest { } } expect(hasHref).to.equal(true); - expect(hasOp).to.equal(true); + expect(hasOp).to.equal(false); expect(hasContentType).to.equal(true); expect(hasModbusFunction).to.equal(true); expect(hasModbusType).to.equal(true); @@ -435,7 +471,8 @@ class AssetInterfaceDescriptionUtilTest { expect(formEntry.value).to.equal("40361?quantity=1"); // use base } else if (formEntry.idShort === "op") { hasOp = true; - expect(formEntry.value).to.equal("readproperty"); + // Note: AID does not know "op" + // expect(formEntry.value).to.equal("readproperty"); } else if (formEntry.idShort === "contentType") { hasContentType = true; expect(formEntry.value).to.equal("application/octet-stream"); @@ -450,7 +487,7 @@ class AssetInterfaceDescriptionUtilTest { } } expect(hasHref).to.equal(true); - expect(hasOp).to.equal(true); + expect(hasOp).to.equal(false); expect(hasContentType).to.equal(true); expect(hasModbusFunction).to.equal(true); expect(hasModbusType).to.equal(true); @@ -521,6 +558,8 @@ class AssetInterfaceDescriptionUtilTest { const sm = this.assetInterfaceDescriptionUtil.transformTD2SM(JSON.stringify(this.td1), ["https"]); const smObj = JSON.parse(sm); + const isValid = this.validateAID(smObj); + expect(isValid.valid, isValid.errors).to.equal(true); expect(smObj).to.have.property("idShort").that.equals("AssetInterfacesDescription"); expect(smObj).to.have.property("id"); expect(smObj).to.have.property("semanticId"); @@ -729,7 +768,7 @@ class AssetInterfaceDescriptionUtilTest { expect(propProperty.value).to.equal("number"); } else if (propProperty.idShort === "description") { hasDescription = true; - expect(propProperty.value).to.equal("Temperature value of the weather station"); + // Note: AID has description on upper level } else if (propProperty.idShort === "unit") { hasUnit = true; expect(propProperty.value).to.equal("degreeCelsius"); @@ -738,7 +777,7 @@ class AssetInterfaceDescriptionUtilTest { } } expect(hasType).to.equal(true); - expect(hasDescription).to.equal(true); + expect(hasDescription).to.equal(false); expect(hasUnit).to.equal(true); expect(hasForms).to.equal(true); } @@ -811,7 +850,7 @@ class AssetInterfaceDescriptionUtilTest { href: "modbus+tcp://127.0.0.1:60000/1", op: "readproperty", "modbus:function": "readCoil", - "modbus:address": 1, + "modbus:pollingTime": 1, }, ], }, @@ -822,6 +861,9 @@ class AssetInterfaceDescriptionUtilTest { const sm = this.assetInterfaceDescriptionUtil.transformTD2SM(JSON.stringify(this.td2)); const smObj = JSON.parse(sm); + // console.log("###\n\n" + JSON.stringify(smObj) + "\n\n###"); + const isValid = this.validateAID(smObj); + expect(isValid.valid, isValid.errors).to.equal(true); expect(smObj).to.have.property("idShort").that.equals("AssetInterfacesDescription"); expect(smObj).to.have.property("semanticId"); expect(smObj).to.have.property("submodelElements").to.be.an("array").to.have.lengthOf.greaterThan(0); @@ -855,6 +897,7 @@ class AssetInterfaceDescriptionUtilTest { for (const endpointMetadataValue of endpointMetadata.value) { if (endpointMetadataValue.idShort === "base") { hasBase = true; + expect(endpointMetadataValue.value).to.equal("modbus+tcp://127.0.0.1:60000"); } else if (endpointMetadataValue.idShort === "contentType") { hasContentType = true; } else if (endpointMetadataValue.idShort === "security") { @@ -872,7 +915,7 @@ class AssetInterfaceDescriptionUtilTest { hasSecurityDefinitions = true; } } - expect(hasBase).to.equal(false); + expect(hasBase).to.equal(true); // AID requires base to exist expect(hasContentType).to.equal(false); expect(hasSecurity).to.equal(true); expect(hasSecurityDefinitions).to.equal(true); @@ -933,11 +976,12 @@ class AssetInterfaceDescriptionUtilTest { hasContentType = true; } else if (formEntry.idShort === "op") { hasOp = true; - expect(formEntry.value).to.equal("readproperty"); + // Note: AID does not know "op" + // expect(formEntry.value).to.equal("readproperty"); } else if (formEntry.idShort === "modbus_function") { hasModbusFunction = true; expect(formEntry.value).to.equal("readCoil"); - } else if (formEntry.idShort === "modbus_address") { + } else if (formEntry.idShort === "modbus_pollingTime") { hasModbusAddress = true; expect(formEntry.value).to.equal("1"); expect(formEntry.valueType).to.equal("xs:int"); @@ -945,7 +989,7 @@ class AssetInterfaceDescriptionUtilTest { } expect(hasHref).to.equal(true); expect(hasContentType).to.equal(false); - expect(hasOp).to.equal(true); + expect(hasOp).to.equal(false); expect(hasModbusFunction).to.equal(true); expect(hasModbusAddress).to.equal(true); } @@ -970,17 +1014,17 @@ class AssetInterfaceDescriptionUtilTest { const response = await fetch("http://plugfest.thingweb.io:8083/counter"); const counterTD = await response.json(); - const sm = this.assetInterfaceDescriptionUtil.transformTD2AAS(JSON.stringify(counterTD), ["http", "coap"]); + const sm = this.assetInterfaceDescriptionUtil.transformTD2AAS(JSON.stringify(counterTD), ["http"]); // "coap" + console.log("XXX AAS\n\n" + sm + "\n\nXXX"); const aasObj = JSON.parse(sm); // TODO proper AID submodel checks - console.log("XXX\n\n"); - console.log(JSON.stringify(aasObj)); - console.log("\n\nXXX"); - expect(aasObj).to.have.property("assetAdministrationShells").to.be.an("array"); expect(aasObj).to.have.property("submodels").to.be.an("array").to.have.lengthOf(1); const submodel = aasObj.submodels[0]; - expect(submodel).to.have.property("submodelElements").to.be.an("array").to.have.lengthOf(2); + console.log("YYY AID\n\n" + JSON.stringify(submodel) + "\n\nYYY"); + const isValid = this.validateAID(submodel); + expect(isValid.valid, isValid.errors).to.equal(true); + expect(submodel).to.have.property("submodelElements").to.be.an("array").to.have.lengthOf(1); } } diff --git a/packages/td-tools/test/tsconfig.json b/packages/td-tools/test/tsconfig.json index 786b1b616..eb7429d64 100644 --- a/packages/td-tools/test/tsconfig.json +++ b/packages/td-tools/test/tsconfig.json @@ -3,5 +3,5 @@ "compilerOptions": { "rootDir": ".." }, - "include": ["*.ts", "**/*.ts", "../src/**/*.ts"] + "include": ["*.ts", "**/*.ts", "../src/**/*.ts", "**/AIDSchema.json"] } diff --git a/packages/td-tools/test/util/AIDSchema.json b/packages/td-tools/test/util/AIDSchema.json new file mode 100644 index 000000000..b72d1c6e2 --- /dev/null +++ b/packages/td-tools/test/util/AIDSchema.json @@ -0,0 +1,3674 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "type": "object", + "allOf": [ + { + "$ref": "#/definitions/Identifiable" + }, + { + "$ref": "#/definitions/HasKind" + }, + { + "$ref": "#/definitions/HasSemantics" + }, + { + "$ref": "#/definitions/Qualifiable" + }, + { + "$ref": "#/definitions/HasDataSpecification" + } + ], + "properties": { + "idShort": { + "type": "string", + "enum": ["AssetInterfacesDescription"] + }, + "submodelElements": { + "type": "array", + "minItems": 1, + "maxItems": 3, + "uniqueItems": true, + "items": { + "anyOf": [ + { + "$ref": "#/definitions/InterfaceHTTP" + }, + { + "$ref": "#/definitions/InterfaceMQTT" + }, + { + "$ref": "#/definitions/InterfaceMODBUS" + } + ] + } + }, + "modelType": { + "const": "Submodel" + } + }, + "definitions": { + "AasSubmodelElements": { + "type": "string", + "enum": [ + "AnnotatedRelationshipElement", + "BasicEventElement", + "Blob", + "Capability", + "DataElement", + "Entity", + "EventElement", + "File", + "MultiLanguageProperty", + "Operation", + "Property", + "Range", + "ReferenceElement", + "RelationshipElement", + "SubmodelElement", + "SubmodelElementCollection", + "SubmodelElementList" + ] + }, + "AbstractLangString": { + "type": "object", + "properties": { + "language": { + "type": "string", + "pattern": "^(([a-zA-Z]{2,3}(-[a-zA-Z]{3}(-[a-zA-Z]{3}){2})?|[a-zA-Z]{4}|[a-zA-Z]{5,8})(-[a-zA-Z]{4})?(-([a-zA-Z]{2}|[0-9]{3}))?(-(([a-zA-Z0-9]){5,8}|[0-9]([a-zA-Z0-9]){3}))*(-[0-9A-WY-Za-wy-z](-([a-zA-Z0-9]){2,8})+)*(-[xX](-([a-zA-Z0-9]){1,8})+)?|[xX](-([a-zA-Z0-9]){1,8})+|((en-GB-oed|i-ami|i-bnn|i-default|i-enochian|i-hak|i-klingon|i-lux|i-mingo|i-navajo|i-pwn|i-tao|i-tay|i-tsu|sgn-BE-FR|sgn-BE-NL|sgn-CH-DE)|(art-lojban|cel-gaulish|no-bok|no-nyn|zh-guoyu|zh-hakka|zh-min|zh-min-nan|zh-xiang)))$" + }, + "text": { + "type": "string", + "minLength": 1, + "pattern": "^([\\t\\n\\r -퟿-�]|\\ud800[\\udc00-\\udfff]|[\\ud801-\\udbfe][\\udc00-\\udfff]|\\udbff[\\udc00-\\udfff])*$" + } + }, + "required": ["language", "text"] + }, + "AdministrativeInformation": { + "allOf": [ + { + "$ref": "#/definitions/HasDataSpecification" + }, + { + "properties": { + "version": { + "type": "string", + "allOf": [ + { + "minLength": 1, + "maxLength": 4 + }, + { + "pattern": "^([\\t\\n\\r -퟿-�]|\\ud800[\\udc00-\\udfff]|[\\ud801-\\udbfe][\\udc00-\\udfff]|\\udbff[\\udc00-\\udfff])*$" + }, + { + "pattern": "^(0|[1-9][0-9]*)$" + } + ] + }, + "revision": { + "type": "string", + "allOf": [ + { + "minLength": 1, + "maxLength": 4 + }, + { + "pattern": "^([\\t\\n\\r -퟿-�]|\\ud800[\\udc00-\\udfff]|[\\ud801-\\udbfe][\\udc00-\\udfff]|\\udbff[\\udc00-\\udfff])*$" + }, + { + "pattern": "^(0|[1-9][0-9]*)$" + } + ] + }, + "creator": { + "$ref": "#/definitions/Reference" + }, + "templateId": { + "type": "string", + "minLength": 1, + "maxLength": 2000, + "pattern": "^([\\t\\n\\r -퟿-�]|\\ud800[\\udc00-\\udfff]|[\\ud801-\\udbfe][\\udc00-\\udfff]|\\udbff[\\udc00-\\udfff])*$" + } + } + } + ] + }, + "DataElement": { + "$ref": "#/definitions/SubmodelElement" + }, + "DataElement_choice": { + "oneOf": [ + { + "$ref": "#/definitions/File" + }, + { + "$ref": "#/definitions/Property" + }, + { + "$ref": "#/definitions/Range" + }, + { + "$ref": "#/definitions/ReferenceElement" + } + ] + }, + "DataSpecificationContent": { + "type": "object", + "properties": { + "modelType": { + "$ref": "#/definitions/ModelType" + } + }, + "required": ["modelType"] + }, + "DataSpecificationContent_choice": { + "oneOf": [ + { + "$ref": "#/definitions/DataSpecificationIec61360" + } + ] + }, + "DataSpecificationIec61360": { + "allOf": [ + { + "$ref": "#/definitions/DataSpecificationContent" + }, + { + "properties": { + "preferredName": { + "type": "array", + "items": { + "$ref": "#/definitions/LangStringPreferredNameTypeIec61360" + }, + "minItems": 1 + }, + "shortName": { + "type": "array", + "items": { + "$ref": "#/definitions/LangStringShortNameTypeIec61360" + }, + "minItems": 1 + }, + "unit": { + "type": "string", + "minLength": 1, + "pattern": "^([\\t\\n\\r -퟿-�]|\\ud800[\\udc00-\\udfff]|[\\ud801-\\udbfe][\\udc00-\\udfff]|\\udbff[\\udc00-\\udfff])*$" + }, + "unitId": { + "$ref": "#/definitions/Reference" + }, + "sourceOfDefinition": { + "type": "string", + "minLength": 1, + "pattern": "^([\\t\\n\\r -퟿-�]|\\ud800[\\udc00-\\udfff]|[\\ud801-\\udbfe][\\udc00-\\udfff]|\\udbff[\\udc00-\\udfff])*$" + }, + "symbol": { + "type": "string", + "minLength": 1, + "pattern": "^([\\t\\n\\r -퟿-�]|\\ud800[\\udc00-\\udfff]|[\\ud801-\\udbfe][\\udc00-\\udfff]|\\udbff[\\udc00-\\udfff])*$" + }, + "dataType": { + "$ref": "#/definitions/DataTypeIec61360" + }, + "definition": { + "type": "array", + "items": { + "$ref": "#/definitions/LangStringDefinitionTypeIec61360" + }, + "minItems": 1 + }, + "valueFormat": { + "type": "string", + "minLength": 1, + "pattern": "^([\\t\\n\\r -퟿-�]|\\ud800[\\udc00-\\udfff]|[\\ud801-\\udbfe][\\udc00-\\udfff]|\\udbff[\\udc00-\\udfff])*$" + }, + "valueList": { + "$ref": "#/definitions/ValueList" + }, + "value": { + "type": "string", + "minLength": 1, + "maxLength": 2000, + "pattern": "^([\\t\\n\\r -퟿-�]|\\ud800[\\udc00-\\udfff]|[\\ud801-\\udbfe][\\udc00-\\udfff]|\\udbff[\\udc00-\\udfff])*$" + }, + "levelType": { + "$ref": "#/definitions/LevelType" + }, + "modelType": { + "const": "DataSpecificationIec61360" + } + }, + "required": ["preferredName"] + } + ] + }, + "DataTypeDefXsd": { + "type": "string", + "enum": [ + "xs:anyURI", + "xs:base64Binary", + "xs:boolean", + "xs:byte", + "xs:date", + "xs:dateTime", + "xs:decimal", + "xs:double", + "xs:duration", + "xs:float", + "xs:gDay", + "xs:gMonth", + "xs:gMonthDay", + "xs:gYear", + "xs:gYearMonth", + "xs:hexBinary", + "xs:int", + "xs:integer", + "xs:long", + "xs:negativeInteger", + "xs:nonNegativeInteger", + "xs:nonPositiveInteger", + "xs:positiveInteger", + "xs:short", + "xs:string", + "xs:time", + "xs:unsignedByte", + "xs:unsignedInt", + "xs:unsignedLong", + "xs:unsignedShort" + ] + }, + "DataTypeIec61360": { + "type": "string", + "enum": [ + "BLOB", + "BOOLEAN", + "DATE", + "FILE", + "HTML", + "INTEGER_COUNT", + "INTEGER_CURRENCY", + "INTEGER_MEASURE", + "IRDI", + "IRI", + "RATIONAL", + "RATIONAL_MEASURE", + "REAL_COUNT", + "REAL_CURRENCY", + "REAL_MEASURE", + "STRING", + "STRING_TRANSLATABLE", + "TIME", + "TIMESTAMP" + ] + }, + "EmbeddedDataSpecification": { + "type": "object", + "properties": { + "dataSpecification": { + "$ref": "#/definitions/Reference" + }, + "dataSpecificationContent": { + "$ref": "#/definitions/DataSpecificationContent_choice" + } + }, + "required": ["dataSpecification", "dataSpecificationContent"] + }, + "Extension": { + "allOf": [ + { + "$ref": "#/definitions/HasSemantics" + }, + { + "properties": { + "name": { + "type": "string", + "minLength": 1, + "maxLength": 128, + "pattern": "^([\\t\\n\\r -퟿-�]|\\ud800[\\udc00-\\udfff]|[\\ud801-\\udbfe][\\udc00-\\udfff]|\\udbff[\\udc00-\\udfff])*$" + }, + "valueType": { + "$ref": "#/definitions/DataTypeDefXsd" + }, + "value": { + "type": "string" + }, + "refersTo": { + "type": "array", + "items": { + "$ref": "#/definitions/Reference" + }, + "minItems": 1 + } + }, + "required": ["name"] + } + ] + }, + "File": { + "allOf": [ + { + "$ref": "#/definitions/DataElement" + }, + { + "properties": { + "value": { + "type": "string", + "allOf": [ + { + "minLength": 1, + "maxLength": 2000 + }, + { + "pattern": "^([\\t\\n\\r -퟿-�]|\\ud800[\\udc00-\\udfff]|[\\ud801-\\udbfe][\\udc00-\\udfff]|\\udbff[\\udc00-\\udfff])*$" + }, + { + "pattern": "^file:(//((localhost|(\\[((([0-9A-Fa-f]{1,4}:){6}([0-9A-Fa-f]{1,4}:[0-9A-Fa-f]{1,4}|([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))|::([0-9A-Fa-f]{1,4}:){5}([0-9A-Fa-f]{1,4}:[0-9A-Fa-f]{1,4}|([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))|([0-9A-Fa-f]{1,4})?::([0-9A-Fa-f]{1,4}:){4}([0-9A-Fa-f]{1,4}:[0-9A-Fa-f]{1,4}|([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))|(([0-9A-Fa-f]{1,4}:)?[0-9A-Fa-f]{1,4})?::([0-9A-Fa-f]{1,4}:){3}([0-9A-Fa-f]{1,4}:[0-9A-Fa-f]{1,4}|([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))|(([0-9A-Fa-f]{1,4}:){2}[0-9A-Fa-f]{1,4})?::([0-9A-Fa-f]{1,4}:){2}([0-9A-Fa-f]{1,4}:[0-9A-Fa-f]{1,4}|([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))|(([0-9A-Fa-f]{1,4}:){3}[0-9A-Fa-f]{1,4})?::[0-9A-Fa-f]{1,4}:([0-9A-Fa-f]{1,4}:[0-9A-Fa-f]{1,4}|([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))|(([0-9A-Fa-f]{1,4}:){4}[0-9A-Fa-f]{1,4})?::([0-9A-Fa-f]{1,4}:[0-9A-Fa-f]{1,4}|([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))|(([0-9A-Fa-f]{1,4}:){5}[0-9A-Fa-f]{1,4})?::[0-9A-Fa-f]{1,4}|(([0-9A-Fa-f]{1,4}:){6}[0-9A-Fa-f]{1,4})?::)|[vV][0-9A-Fa-f]+\\.([a-zA-Z0-9\\-._~]|[!$&'()*+,;=]|:)+)\\]|([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])|([a-zA-Z0-9\\-._~]|%[0-9A-Fa-f][0-9A-Fa-f]|[!$&'()*+,;=])*)))?/((([a-zA-Z0-9\\-._~]|%[0-9A-Fa-f][0-9A-Fa-f]|[!$&'()*+,;=]|[:@]))+(/(([a-zA-Z0-9\\-._~]|%[0-9A-Fa-f][0-9A-Fa-f]|[!$&'()*+,;=]|[:@]))*)*)?|/((([a-zA-Z0-9\\-._~]|%[0-9A-Fa-f][0-9A-Fa-f]|[!$&'()*+,;=]|[:@]))+(/(([a-zA-Z0-9\\-._~]|%[0-9A-Fa-f][0-9A-Fa-f]|[!$&'()*+,;=]|[:@]))*)*)?)$" + } + ] + }, + "contentType": { + "type": "string", + "allOf": [ + { + "minLength": 1, + "maxLength": 100 + }, + { + "pattern": "^([\\t\\n\\r -퟿-�]|\\ud800[\\udc00-\\udfff]|[\\ud801-\\udbfe][\\udc00-\\udfff]|\\udbff[\\udc00-\\udfff])*$" + }, + { + "pattern": "^([!#$%&'*+\\-.^_`|~0-9a-zA-Z])+/([!#$%&'*+\\-.^_`|~0-9a-zA-Z])+([ \\t]*;[ \\t]*([!#$%&'*+\\-.^_`|~0-9a-zA-Z])+=(([!#$%&'*+\\-.^_`|~0-9a-zA-Z])+|\"(([\\t !#-\\[\\]-~]|[€-ÿ])|\\\\([\\t !-~]|[€-ÿ]))*\"))*$" + } + ] + }, + "modelType": { + "const": "File" + } + }, + "required": ["contentType"] + } + ] + }, + "HasDataSpecification": { + "type": "object", + "properties": { + "embeddedDataSpecifications": { + "type": "array", + "items": { + "$ref": "#/definitions/EmbeddedDataSpecification" + }, + "minItems": 0 + } + } + }, + "HasExtensions": { + "type": "object", + "properties": { + "extensions": { + "type": "array", + "items": { + "$ref": "#/definitions/Extension" + }, + "minItems": 1 + } + } + }, + "HasKind": { + "type": "object", + "properties": { + "kind": { + "$ref": "#/definitions/ModellingKind" + } + } + }, + "HasSemantics": { + "type": "object", + "properties": { + "semanticId": { + "$ref": "#/definitions/Reference" + }, + "supplementalSemanticIds": { + "type": "array", + "items": { + "$ref": "#/definitions/Reference" + }, + "minItems": 1 + } + } + }, + "Identifiable": { + "allOf": [ + { + "$ref": "#/definitions/Referable" + }, + { + "properties": { + "administration": { + "$ref": "#/definitions/AdministrativeInformation" + }, + "id": { + "type": "string", + "minLength": 1, + "maxLength": 2000, + "pattern": "^([\\t\\n\\r -퟿-�]|\\ud800[\\udc00-\\udfff]|[\\ud801-\\udbfe][\\udc00-\\udfff]|\\udbff[\\udc00-\\udfff])*$" + } + }, + "required": ["id"] + } + ] + }, + "Key": { + "type": "object", + "properties": { + "type": { + "$ref": "#/definitions/KeyTypes" + }, + "value": { + "type": "string", + "minLength": 1, + "maxLength": 2000, + "pattern": "^([\\t\\n\\r -퟿-�]|\\ud800[\\udc00-\\udfff]|[\\ud801-\\udbfe][\\udc00-\\udfff]|\\udbff[\\udc00-\\udfff])*$" + } + }, + "required": ["type", "value"] + }, + "KeyTypes": { + "type": "string", + "enum": [ + "AnnotatedRelationshipElement", + "AssetAdministrationShell", + "BasicEventElement", + "Blob", + "Capability", + "ConceptDescription", + "DataElement", + "Entity", + "EventElement", + "File", + "FragmentReference", + "GlobalReference", + "Identifiable", + "MultiLanguageProperty", + "Operation", + "Property", + "Range", + "Referable", + "ReferenceElement", + "RelationshipElement", + "Submodel", + "SubmodelElement", + "SubmodelElementCollection", + "SubmodelElementList" + ] + }, + "LangStringDefinitionTypeIec61360": { + "allOf": [ + { + "$ref": "#/definitions/AbstractLangString" + }, + { + "properties": { + "text": { + "maxLength": 1023 + } + } + } + ] + }, + "LangStringNameType": { + "allOf": [ + { + "$ref": "#/definitions/AbstractLangString" + }, + { + "properties": { + "text": { + "maxLength": 128 + } + } + } + ] + }, + "LangStringPreferredNameTypeIec61360": { + "allOf": [ + { + "$ref": "#/definitions/AbstractLangString" + }, + { + "properties": { + "text": { + "maxLength": 255 + } + } + } + ] + }, + "LangStringShortNameTypeIec61360": { + "allOf": [ + { + "$ref": "#/definitions/AbstractLangString" + }, + { + "properties": { + "text": { + "maxLength": 18 + } + } + } + ] + }, + "LangStringTextType": { + "allOf": [ + { + "$ref": "#/definitions/AbstractLangString" + }, + { + "properties": { + "text": { + "maxLength": 1023 + } + } + } + ] + }, + "LevelType": { + "type": "object", + "properties": { + "min": { + "type": "boolean" + }, + "nom": { + "type": "boolean" + }, + "typ": { + "type": "boolean" + }, + "max": { + "type": "boolean" + } + }, + "required": ["min", "nom", "typ", "max"] + }, + "ModelType": { + "type": "string", + "enum": [ + "AnnotatedRelationshipElement", + "AssetAdministrationShell", + "BasicEventElement", + "Blob", + "Capability", + "ConceptDescription", + "DataSpecificationIec61360", + "Entity", + "File", + "MultiLanguageProperty", + "Operation", + "Property", + "Range", + "ReferenceElement", + "RelationshipElement", + "Submodel", + "SubmodelElementCollection", + "SubmodelElementList" + ] + }, + "ModellingKind": { + "type": "string", + "enum": ["Instance", "Template"] + }, + "MultiLanguageProperty": { + "allOf": [ + { + "$ref": "#/definitions/DataElement" + }, + { + "properties": { + "value": { + "type": "array", + "items": { + "$ref": "#/definitions/LangStringTextType" + }, + "minItems": 1 + }, + "valueId": { + "$ref": "#/definitions/Reference" + }, + "modelType": { + "const": "MultiLanguageProperty" + } + } + } + ] + }, + "Property": { + "allOf": [ + { + "$ref": "#/definitions/DataElement" + }, + { + "properties": { + "valueType": { + "$ref": "#/definitions/DataTypeDefXsd" + }, + "value": { + "type": "string" + }, + "valueId": { + "$ref": "#/definitions/Reference" + }, + "modelType": { + "const": "Property" + } + }, + "required": ["valueType"] + } + ] + }, + "Qualifiable": { + "type": "object", + "properties": { + "qualifiers": { + "type": "array", + "items": { + "$ref": "#/definitions/Qualifier" + }, + "minItems": 1 + }, + "modelType": { + "$ref": "#/definitions/ModelType" + } + }, + "required": ["modelType"] + }, + "Qualifier": { + "allOf": [ + { + "$ref": "#/definitions/HasSemantics" + }, + { + "properties": { + "kind": { + "$ref": "#/definitions/QualifierKind" + }, + "type": { + "type": "string", + "minLength": 1, + "maxLength": 128, + "pattern": "^([\\t\\n\\r -퟿-�]|\\ud800[\\udc00-\\udfff]|[\\ud801-\\udbfe][\\udc00-\\udfff]|\\udbff[\\udc00-\\udfff])*$" + }, + "valueType": { + "$ref": "#/definitions/DataTypeDefXsd" + }, + "value": { + "type": "string" + }, + "valueId": { + "$ref": "#/definitions/Reference" + } + }, + "required": ["type", "valueType"] + } + ] + }, + "QualifierKind": { + "type": "string", + "enum": ["ConceptQualifier", "TemplateQualifier", "ValueQualifier"] + }, + "Range": { + "allOf": [ + { + "$ref": "#/definitions/DataElement" + }, + { + "properties": { + "valueType": { + "$ref": "#/definitions/DataTypeDefXsd" + }, + "min": { + "type": "string" + }, + "max": { + "type": "string" + }, + "modelType": { + "const": "Range" + } + }, + "required": ["valueType"] + } + ] + }, + "Referable": { + "allOf": [ + { + "$ref": "#/definitions/HasExtensions" + }, + { + "properties": { + "category": { + "type": "string", + "minLength": 1, + "maxLength": 128, + "pattern": "^([\\t\\n\\r -퟿-�]|\\ud800[\\udc00-\\udfff]|[\\ud801-\\udbfe][\\udc00-\\udfff]|\\udbff[\\udc00-\\udfff])*$" + }, + "idShort": { + "type": "string", + "allOf": [ + { + "minLength": 1, + "maxLength": 128 + }, + { + "pattern": "^([\\t\\n\\r -퟿-�]|\\ud800[\\udc00-\\udfff]|[\\ud801-\\udbfe][\\udc00-\\udfff]|\\udbff[\\udc00-\\udfff])*$" + }, + { + "pattern": "^[a-zA-Z][a-zA-Z0-9_]*$" + } + ] + }, + "displayName": { + "type": "array", + "items": { + "$ref": "#/definitions/LangStringNameType" + }, + "minItems": 1 + }, + "description": { + "type": "array", + "items": { + "$ref": "#/definitions/LangStringTextType" + }, + "minItems": 1 + }, + "modelType": { + "$ref": "#/definitions/ModelType" + } + }, + "required": ["modelType"] + } + ] + }, + "Reference": { + "type": "object", + "properties": { + "type": { + "$ref": "#/definitions/ReferenceTypes" + }, + "referredSemanticId": { + "$ref": "#/definitions/Reference" + }, + "keys": { + "type": "array", + "items": { + "$ref": "#/definitions/Key" + }, + "minItems": 1 + } + }, + "required": ["type", "keys"] + }, + "ReferenceElement": { + "allOf": [ + { + "$ref": "#/definitions/DataElement" + }, + { + "properties": { + "value": { + "$ref": "#/definitions/Reference" + }, + "modelType": { + "const": "ReferenceElement" + } + } + } + ] + }, + "ReferenceTypes": { + "type": "string", + "enum": ["ExternalReference", "ModelReference"] + }, + "Resource": { + "type": "object", + "properties": { + "path": { + "type": "string", + "allOf": [ + { + "minLength": 1, + "maxLength": 2000 + }, + { + "pattern": "^([\\t\\n\\r -퟿-�]|\\ud800[\\udc00-\\udfff]|[\\ud801-\\udbfe][\\udc00-\\udfff]|\\udbff[\\udc00-\\udfff])*$" + }, + { + "pattern": "^file:(//((localhost|(\\[((([0-9A-Fa-f]{1,4}:){6}([0-9A-Fa-f]{1,4}:[0-9A-Fa-f]{1,4}|([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))|::([0-9A-Fa-f]{1,4}:){5}([0-9A-Fa-f]{1,4}:[0-9A-Fa-f]{1,4}|([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))|([0-9A-Fa-f]{1,4})?::([0-9A-Fa-f]{1,4}:){4}([0-9A-Fa-f]{1,4}:[0-9A-Fa-f]{1,4}|([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))|(([0-9A-Fa-f]{1,4}:)?[0-9A-Fa-f]{1,4})?::([0-9A-Fa-f]{1,4}:){3}([0-9A-Fa-f]{1,4}:[0-9A-Fa-f]{1,4}|([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))|(([0-9A-Fa-f]{1,4}:){2}[0-9A-Fa-f]{1,4})?::([0-9A-Fa-f]{1,4}:){2}([0-9A-Fa-f]{1,4}:[0-9A-Fa-f]{1,4}|([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))|(([0-9A-Fa-f]{1,4}:){3}[0-9A-Fa-f]{1,4})?::[0-9A-Fa-f]{1,4}:([0-9A-Fa-f]{1,4}:[0-9A-Fa-f]{1,4}|([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))|(([0-9A-Fa-f]{1,4}:){4}[0-9A-Fa-f]{1,4})?::([0-9A-Fa-f]{1,4}:[0-9A-Fa-f]{1,4}|([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))|(([0-9A-Fa-f]{1,4}:){5}[0-9A-Fa-f]{1,4})?::[0-9A-Fa-f]{1,4}|(([0-9A-Fa-f]{1,4}:){6}[0-9A-Fa-f]{1,4})?::)|[vV][0-9A-Fa-f]+\\.([a-zA-Z0-9\\-._~]|[!$&'()*+,;=]|:)+)\\]|([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])|([a-zA-Z0-9\\-._~]|%[0-9A-Fa-f][0-9A-Fa-f]|[!$&'()*+,;=])*)))?/((([a-zA-Z0-9\\-._~]|%[0-9A-Fa-f][0-9A-Fa-f]|[!$&'()*+,;=]|[:@]))+(/(([a-zA-Z0-9\\-._~]|%[0-9A-Fa-f][0-9A-Fa-f]|[!$&'()*+,;=]|[:@]))*)*)?|/((([a-zA-Z0-9\\-._~]|%[0-9A-Fa-f][0-9A-Fa-f]|[!$&'()*+,;=]|[:@]))+(/(([a-zA-Z0-9\\-._~]|%[0-9A-Fa-f][0-9A-Fa-f]|[!$&'()*+,;=]|[:@]))*)*)?)$" + } + ] + }, + "contentType": { + "type": "string", + "allOf": [ + { + "minLength": 1, + "maxLength": 100 + }, + { + "pattern": "^([\\t\\n\\r -퟿-�]|\\ud800[\\udc00-\\udfff]|[\\ud801-\\udbfe][\\udc00-\\udfff]|\\udbff[\\udc00-\\udfff])*$" + }, + { + "pattern": "^([!#$%&'*+\\-.^_`|~0-9a-zA-Z])+/([!#$%&'*+\\-.^_`|~0-9a-zA-Z])+([ \\t]*;[ \\t]*([!#$%&'*+\\-.^_`|~0-9a-zA-Z])+=(([!#$%&'*+\\-.^_`|~0-9a-zA-Z])+|\"(([\\t !#-\\[\\]-~]|[€-ÿ])|\\\\([\\t !-~]|[€-ÿ]))*\"))*$" + } + ] + } + }, + "required": ["path"] + }, + "Submodel": { + "allOf": [ + { + "$ref": "#/definitions/Identifiable" + }, + { + "$ref": "#/definitions/HasKind" + }, + { + "$ref": "#/definitions/HasSemantics" + }, + { + "$ref": "#/definitions/Qualifiable" + }, + { + "$ref": "#/definitions/HasDataSpecification" + }, + { + "properties": { + "submodelElements": { + "type": "array", + "items": { + "$ref": "#/definitions/SubmodelElement_choice" + }, + "minItems": 1 + }, + "modelType": { + "const": "Submodel" + } + } + } + ] + }, + "SubmodelElement": { + "allOf": [ + { + "$ref": "#/definitions/Referable" + }, + { + "$ref": "#/definitions/HasSemantics" + }, + { + "$ref": "#/definitions/Qualifiable" + }, + { + "$ref": "#/definitions/HasDataSpecification" + } + ] + }, + "SubmodelElementCollection": { + "allOf": [ + { + "$ref": "#/definitions/SubmodelElement" + }, + { + "properties": { + "value": { + "type": "array", + "items": { + "$ref": "#/definitions/SubmodelElement_choice" + }, + "minItems": 1 + }, + "modelType": { + "const": "SubmodelElementCollection" + } + } + } + ] + }, + "SubmodelElementList": { + "allOf": [ + { + "$ref": "#/definitions/SubmodelElement" + }, + { + "properties": { + "orderRelevant": { + "type": "boolean" + }, + "semanticIdListElement": { + "$ref": "#/definitions/Reference" + }, + "typeValueListElement": { + "$ref": "#/definitions/AasSubmodelElements" + }, + "valueTypeListElement": { + "$ref": "#/definitions/DataTypeDefXsd" + }, + "value": { + "type": "array", + "items": { + "$ref": "#/definitions/SubmodelElement_choice" + }, + "minItems": 1 + }, + "modelType": { + "const": "SubmodelElementList" + } + }, + "required": ["typeValueListElement"] + } + ] + }, + "SubmodelElement_choice": { + "oneOf": [ + { + "$ref": "#/definitions/File" + }, + { + "$ref": "#/definitions/Property" + }, + { + "$ref": "#/definitions/Range" + }, + { + "$ref": "#/definitions/ReferenceElement" + }, + { + "$ref": "#/definitions/SubmodelElementCollection" + }, + { + "$ref": "#/definitions/SubmodelElementList" + } + ] + }, + "ValueList": { + "type": "object", + "properties": { + "valueReferencePairs": { + "type": "array", + "items": { + "$ref": "#/definitions/ValueReferencePair" + }, + "minItems": 1 + } + }, + "required": ["valueReferencePairs"] + }, + "ValueReferencePair": { + "type": "object", + "properties": { + "value": { + "type": "string", + "minLength": 1, + "maxLength": 2000, + "pattern": "^([\\t\\n\\r -퟿-�]|\\ud800[\\udc00-\\udfff]|[\\ud801-\\udbfe][\\udc00-\\udfff]|\\udbff[\\udc00-\\udfff])*$" + }, + "valueId": { + "$ref": "#/definitions/Reference" + } + }, + "required": ["value", "valueId"] + }, + "InterfaceHTTP": { + "allOf": [ + { + "$ref": "#/definitions/SubmodelElement" + }, + { + "properties": { + "idShort": { + "type": "string" + }, + "value": { + "title": "Interface HTTP submodelElement collection", + "description": "In this collection, EndpointMetadta and InterfaceMetadata should be mandatory and other elements should be optional", + "type": "array", + "uniqueItems": true, + "unevaluatedItems": false, + "maxItems": 7, + "items": { + "anyOf": [ + { "$ref": "#/definitions/titleElement" }, + { "$ref": "#/definitions/createdElement" }, + { "$ref": "#/definitions/modifiedElement" }, + { "$ref": "#/definitions/supportElement" }, + { "$ref": "#/definitions/ExternalDescriptorContainer" }, + { "$ref": "#/definitions/HTTPEndpointMetadata" }, + { "$ref": "#/definitions/HTTPInterfaceMetadata" } + ] + }, + "if": { + "not": { + "contains": { + "$ref": "#/definitions/ExternalDescriptorContainer" + } + } + }, + "then": { + "contains": { + "anyOf": [ + { "$ref": "#/definitions/HTTPEndpointMetadata" }, + { "$ref": "#/definitions/HTTPInterfaceMetadata" } + ] + }, + "minContains": 2, + "maxContains": 2 + } + }, + "modelType": { + "const": "SubmodelElementCollection" + } + } + } + ] + }, + "InterfaceMODBUS": { + "allOf": [ + { + "$ref": "#/definitions/SubmodelElement" + }, + { + "properties": { + "idShort": { + "type": "string" + }, + "value": { + "title": "Interface modbus submodelElement collection", + "description": "In this collection, EndpointMetadta and InterfaceMetadata should be mandatory and other elements should be optional", + "type": "array", + "uniqueItems": true, + "unevaluatedItems": false, + "maxItems": 7, + "items": { + "anyOf": [ + { "$ref": "#/definitions/titleElement" }, + { "$ref": "#/definitions/createdElement" }, + { "$ref": "#/definitions/modifiedElement" }, + { "$ref": "#/definitions/supportElement" }, + { "$ref": "#/definitions/ExternalDescriptorContainer" }, + { "$ref": "#/definitions/MODBUSEndpointMetadata" }, + { "$ref": "#/definitions/MODBUSInterfaceMetadata" } + ] + }, + "if": { + "not": { + "contains": { + "$ref": "#/definitions/ExternalDescriptorContainer" + } + } + }, + "then": { + "contains": { + "anyOf": [ + { "$ref": "#/definitions/MODBUSEndpointMetadata" }, + { "$ref": "#/definitions/MODBUSInterfaceMetadata" } + ] + }, + "minContains": 2, + "maxContains": 2 + } + }, + "modelType": { + "const": "SubmodelElementCollection" + } + } + } + ] + }, + "InterfaceMQTT": { + "allOf": [ + { + "$ref": "#/definitions/SubmodelElement" + }, + { + "properties": { + "idShort": { + "type": "string" + }, + "value": { + "title": "Interface MQTT submodelElement collection", + "description": "In this collection, EndpointMetadta and InterfaceMetadata should be mandatory and other elements should be optional", + "type": "array", + "uniqueItems": true, + "unevaluatedItems": false, + "maxItems": 7, + "items": { + "anyOf": [ + { "$ref": "#/definitions/titleElement" }, + { "$ref": "#/definitions/createdElement" }, + { "$ref": "#/definitions/modifiedElement" }, + { "$ref": "#/definitions/supportElement" }, + { "$ref": "#/definitions/ExternalDescriptorContainer" }, + { "$ref": "#/definitions/MQTTEndpointMetadata" }, + { "$ref": "#/definitions/MQTTInterfaceMetadata" } + ] + }, + "if": { + "not": { + "contains": { + "$ref": "#/definitions/ExternalDescriptorContainer" + } + } + }, + "then": { + "contains": { + "anyOf": [ + { "$ref": "#/definitions/MQTTEndpointMetadata" }, + { "$ref": "#/definitions/MQTTInterfaceMetadata" } + ] + }, + "minContains": 2, + "maxContains": 2 + } + }, + "modelType": { + "const": "SubmodelElementCollection" + } + } + } + ] + }, + "titleElement": { + "allOf": [ + { + "$ref": "#/definitions/DataElement" + }, + { + "properties": { + "idShort": { + "type": "string", + "enum": ["title"] + }, + + "valueType": { + "type": "string", + "enum": ["xs:string"] + }, + "value": { + "type": "string" + }, + "valueId": { + "$ref": "#/definitions/Reference" + }, + "modelType": { + "const": "Property" + } + }, + "required": ["valueType", "idShort"] + } + ] + }, + "createdElement": { + "allOf": [ + { + "$ref": "#/definitions/DataElement" + }, + { + "properties": { + "idShort": { + "type": "string", + "enum": ["created"] + }, + + "valueType": { + "type": "string", + "enum": ["xs:dateTime", "xs:date"] + }, + "value": { + "type": "string" + }, + "valueId": { + "$ref": "#/definitions/Reference" + }, + "modelType": { + "const": "Property" + } + }, + "required": ["valueType", "idShort"] + } + ] + }, + "modifiedElement": { + "allOf": [ + { + "$ref": "#/definitions/DataElement" + }, + { + "properties": { + "idShort": { + "type": "string", + "enum": ["modified"] + }, + + "valueType": { + "type": "string", + "enum": ["xs:dateTime", "xs:date"] + }, + "value": { + "type": "string" + }, + "valueId": { + "$ref": "#/definitions/Reference" + }, + "modelType": { + "const": "Property" + } + }, + "required": ["valueType", "idShort"] + } + ] + }, + "supportElement": { + "allOf": [ + { + "$ref": "#/definitions/DataElement" + }, + { + "properties": { + "idShort": { + "type": "string", + "enum": ["support"] + }, + + "valueType": { + "type": "string", + "enum": ["xs:anyURI"] + }, + "value": { + "type": "string" + }, + "valueId": { + "$ref": "#/definitions/Reference" + }, + "modelType": { + "const": "Property" + } + }, + "required": ["valueType", "idShort"] + } + ] + }, + "HTTPEndpointMetadata": { + "allOf": [ + { + "$ref": "#/definitions/SubmodelElement" + }, + { + "properties": { + "idShort": { + "type": "string", + "enum": ["EndpointMetadata"] + }, + "value": { + "uniqueItems": true, + "unevaluatedItems": false, + "maxItems": 4, + "type": "array", + "items": { + "anyOf": [ + { "$ref": "#/definitions/securityDefinitionsElement" }, + { "$ref": "#/definitions/contentTypeElement" }, + { "$ref": "#/definitions/HTTPbaseElement" }, + { "$ref": "#/definitions/securityElement" } + ] + }, + "contains": { + "oneOf": [ + { "$ref": "#/definitions/securityDefinitionsElement" }, + { "$ref": "#/definitions/HTTPbaseElement" }, + { "$ref": "#/definitions/securityElement" } + ] + }, + "minContains": 3, + "maxContains": 3 + }, + "modelType": { + "const": "SubmodelElementCollection" + } + } + } + ] + }, + "MODBUSEndpointMetadata": { + "allOf": [ + { + "$ref": "#/definitions/SubmodelElement" + }, + { + "properties": { + "idShort": { + "type": "string", + "enum": ["EndpointMetadata"] + }, + "value": { + "uniqueItems": true, + "unevaluatedItems": false, + "maxItems": 4, + "type": "array", + "items": { + "anyOf": [ + { "$ref": "#/definitions/securityDefinitionsElement" }, + { "$ref": "#/definitions/contentTypeElement" }, + { "$ref": "#/definitions/MODBUSbaseElement" }, + { "$ref": "#/definitions/securityElement" } + ] + }, + "contains": { + "oneOf": [ + { "$ref": "#/definitions/securityDefinitionsElement" }, + { "$ref": "#/definitions/MODBUSbaseElement" }, + { "$ref": "#/definitions/securityElement" } + ] + }, + "minContains": 3, + "maxContains": 3 + }, + "modelType": { + "const": "SubmodelElementCollection" + } + } + } + ] + }, + "MQTTEndpointMetadata": { + "allOf": [ + { + "$ref": "#/definitions/SubmodelElement" + }, + { + "properties": { + "idShort": { + "type": "string", + "enum": ["EndpointMetadata"] + }, + "value": { + "uniqueItems": true, + "unevaluatedItems": false, + "maxItems": 4, + "type": "array", + "items": { + "anyOf": [ + { "$ref": "#/definitions/securityDefinitionsElement" }, + { "$ref": "#/definitions/contentTypeElement" }, + { "$ref": "#/definitions/MQTTbaseElement" }, + { "$ref": "#/definitions/securityElement" } + ] + }, + "contains": { + "oneOf": [ + { "$ref": "#/definitions/securityDefinitionsElement" }, + { "$ref": "#/definitions/MQTTbaseElement" }, + { "$ref": "#/definitions/securityElement" } + ] + }, + "minContains": 3, + "maxContains": 3 + }, + "modelType": { + "const": "SubmodelElementCollection" + } + } + } + ] + }, + "HTTPInterfaceMetadata": { + "allOf": [ + { + "$ref": "#/definitions/SubmodelElement" + }, + { + "properties": { + "idShort": { + "type": "string", + "enum": ["InterfaceMetadata"] + }, + "value": { + "type": "array", + "uniqueItems": true, + "unevaluatedItems": false, + "maxItems": 3, + "items": { + "anyOf": [ + { + "$ref": "#/definitions/HTTPInterfaceMetadataPropertiesElement" + }, + { "$ref": "#/definitions/InterfaceMetadataActionsElement" }, + { "$ref": "#/definitions/InterfaceMetadataEventsElement" } + ] + } + }, + "modelType": { + "const": "SubmodelElementCollection" + } + } + } + ] + }, + "MODBUSInterfaceMetadata": { + "allOf": [ + { + "$ref": "#/definitions/SubmodelElement" + }, + { + "properties": { + "idShort": { + "type": "string", + "enum": ["InterfaceMetadata"] + }, + "value": { + "type": "array", + "uniqueItems": true, + "unevaluatedItems": false, + "maxItems": 3, + "items": { + "anyOf": [ + { + "$ref": "#/definitions/ModbusInterfaceMetadataPropertiesElement" + }, + { "$ref": "#/definitions/InterfaceMetadataActionsElement" }, + { "$ref": "#/definitions/InterfaceMetadataEventsElement" } + ] + } + }, + "modelType": { + "const": "SubmodelElementCollection" + } + } + } + ] + }, + "MQTTInterfaceMetadata": { + "allOf": [ + { + "$ref": "#/definitions/SubmodelElement" + }, + { + "properties": { + "idShort": { + "type": "string", + "enum": ["InterfaceMetadata"] + }, + "value": { + "type": "array", + "uniqueItems": true, + "unevaluatedItems": false, + "maxItems": 3, + "items": { + "anyOf": [ + { + "$ref": "#/definitions/MQTTInterfaceMetadataPropertiesElement" + }, + { "$ref": "#/definitions/InterfaceMetadataActionsElement" }, + { "$ref": "#/definitions/InterfaceMetadataEventsElement" } + ] + } + }, + "modelType": { + "const": "SubmodelElementCollection" + } + } + } + ] + }, + "HTTPInterfaceMetadataPropertiesElement": { + "allOf": [ + { + "$ref": "#/definitions/SubmodelElement" + }, + { + "properties": { + "idShort": { + "type": "string", + "enum": ["properties"] + }, + "value": { + "type": "array", + "items": { + "$ref": "#/definitions/HTTPPropertyOfPropertiesElement" + } + }, + "modelType": { + "const": "SubmodelElementCollection" + } + } + } + ] + }, + "ModbusInterfaceMetadataPropertiesElement": { + "allOf": [ + { + "$ref": "#/definitions/SubmodelElement" + }, + { + "properties": { + "idShort": { + "type": "string", + "enum": ["properties"] + }, + "value": { + "type": "array", + "items": { + "$ref": "#/definitions/ModbusPropertyOfPropertiesElement" + } + }, + "modelType": { + "const": "SubmodelElementCollection" + } + } + } + ] + }, + "MQTTInterfaceMetadataPropertiesElement": { + "allOf": [ + { + "$ref": "#/definitions/SubmodelElement" + }, + { + "properties": { + "idShort": { + "type": "string", + "enum": ["properties"] + }, + "value": { + "type": "array", + "items": { + "$ref": "#/definitions/MQTTPropertyOfPropertiesElement" + } + }, + "modelType": { + "const": "SubmodelElementCollection" + } + } + } + ] + }, + "InterfaceMetadataActionsElement": { + "allOf": [ + { + "$ref": "#/definitions/SubmodelElement" + }, + { + "properties": { + "idShort": { + "type": "string", + "enum": ["actions"] + }, + "value": { + "type": "array", + "uniqueItems": true, + "unevaluatedItems": false, + "maxItems": 3, + "items": { + "oneOf": [{}] + } + }, + "modelType": { + "const": "SubmodelElementCollection" + } + } + } + ] + }, + "InterfaceMetadataEventsElement": { + "allOf": [ + { + "$ref": "#/definitions/SubmodelElement" + }, + { + "properties": { + "idShort": { + "type": "string", + "enum": ["events"] + }, + "value": { + "type": "array", + "uniqueItems": true, + "unevaluatedItems": false, + "maxItems": 3, + "items": { + "oneOf": [{}] + } + }, + "modelType": { + "const": "SubmodelElementCollection" + } + } + } + ] + }, + "HTTPPropertyOfPropertiesElement": { + "allOf": [ + { + "$ref": "#/definitions/SubmodelElement" + }, + { + "properties": { + "value": { + "type": "array", + "uniqueItems": true, + "items": { + "anyOf": [ + { "$ref": "#/definitions/keyElement" }, + { "$ref": "#/definitions/typeElement" }, + { "$ref": "#/definitions/observableElement" }, + { "$ref": "#/definitions/constElement" }, + { "$ref": "#/definitions/defaultElement" }, + { "$ref": "#/definitions/unitElement" }, + { "$ref": "#/definitions/min_maxElement" }, + { "$ref": "#/definitions/lengthRangeElement" }, + { "$ref": "#/definitions/itemsRangeElement" }, + { "$ref": "#/definitions/valueSemanticsElement" }, + { "$ref": "#/definitions/httpFormsElement" }, + { "$ref": "#/definitions/titleElement" }, + { "$ref": "#/definitions/itemsElement" }, + { "$ref": "#/definitions/InternalPropertiesForObjectElement" } + ] + }, + "contains": { + "$ref": "#/definitions/httpFormsElement" + } + }, + "modelType": { + "const": "SubmodelElementCollection" + } + } + } + ] + }, + "ModbusPropertyOfPropertiesElement": { + "allOf": [ + { + "$ref": "#/definitions/SubmodelElement" + }, + { + "properties": { + "value": { + "type": "array", + "items": { + "anyOf": [ + { "$ref": "#/definitions/keyElement" }, + { "$ref": "#/definitions/typeElement" }, + { "$ref": "#/definitions/observableElement" }, + { "$ref": "#/definitions/constElement" }, + { "$ref": "#/definitions/defaultElement" }, + { "$ref": "#/definitions/unitElement" }, + { "$ref": "#/definitions/min_maxElement" }, + { "$ref": "#/definitions/lengthRangeElement" }, + { "$ref": "#/definitions/itemsRangeElement" }, + { "$ref": "#/definitions/valueSemanticsElement" }, + { "$ref": "#/definitions/modbusFormsElement" }, + { "$ref": "#/definitions/titleElement" }, + { "$ref": "#/definitions/itemsElement" }, + { "$ref": "#/definitions/InternalPropertiesForObjectElement" } + ] + }, + "contains": { + "$ref": "#/definitions/modbusFormsElement" + } + }, + "modelType": { + "const": "SubmodelElementCollection" + } + } + } + ] + }, + "MQTTPropertyOfPropertiesElement": { + "allOf": [ + { + "$ref": "#/definitions/SubmodelElement" + }, + { + "properties": { + "value": { + "type": "array", + "items": { + "anyOf": [ + { "$ref": "#/definitions/keyElement" }, + { "$ref": "#/definitions/typeElement" }, + { "$ref": "#/definitions/observableElement" }, + { "$ref": "#/definitions/constElement" }, + { "$ref": "#/definitions/defaultElement" }, + { "$ref": "#/definitions/unitElement" }, + { "$ref": "#/definitions/min_maxElement" }, + { "$ref": "#/definitions/lengthRangeElement" }, + { "$ref": "#/definitions/itemsRangeElement" }, + { "$ref": "#/definitions/valueSemanticsElement" }, + { "$ref": "#/definitions/mqttFormsElement" }, + { "$ref": "#/definitions/titleElement" }, + { "$ref": "#/definitions/itemsElement" }, + { "$ref": "#/definitions/InternalPropertiesForObjectElement" } + ] + }, + "contains": { + "$ref": "#/definitions/mqttFormsElement" + } + }, + "modelType": { + "const": "SubmodelElementCollection" + } + } + } + ] + }, + "ExternalDescriptorContainer": { + "allOf": [ + { + "$ref": "#/definitions/SubmodelElement" + }, + { + "properties": { + "idShort": { + "type": "string", + "enum": ["ExternalDescriptor"] + }, + "value": { + "type": "array", + "uniqueItems": true, + "unevaluatedItems": false, + "minItems": 1, + "items": { + "$ref": "#/definitions/ExternalDescriptorElement" + } + }, + "modelType": { + "const": "SubmodelElementCollection" + } + } + } + ] + }, + "ExternalDescriptorElement": { + "allOf": [ + { + "$ref": "#/definitions/DataElement" + }, + { + "properties": { + "idShort": { + "type": "string" + }, + "value": { + "type": "string", + "allOf": [ + { + "minLength": 1, + "maxLength": 2000 + }, + { + "pattern": "^([\\t\\n\\r -퟿-�]|\\ud800[\\udc00-\\udfff]|[\\ud801-\\udbfe][\\udc00-\\udfff]|\\udbff[\\udc00-\\udfff])*$" + } + ] + }, + "contentType": { + "type": "string", + "allOf": [ + { + "minLength": 1, + "maxLength": 100 + }, + { + "pattern": "^([\\t\\n\\r -퟿-�]|\\ud800[\\udc00-\\udfff]|[\\ud801-\\udbfe][\\udc00-\\udfff]|\\udbff[\\udc00-\\udfff])*$" + }, + { + "pattern": "^([!#$%&'*+\\-.^_`|~0-9a-zA-Z])+/([!#$%&'*+\\-.^_`|~0-9a-zA-Z])+([ \\t]*;[ \\t]*([!#$%&'*+\\-.^_`|~0-9a-zA-Z])+=(([!#$%&'*+\\-.^_`|~0-9a-zA-Z])+|\"(([\\t !#-\\[\\]-~]|[€-ÿ])|\\\\([\\t !-~]|[€-ÿ]))*\"))*$" + } + ] + }, + "modelType": { + "const": "File" + } + }, + "required": ["contentType"] + } + ] + }, + "HTTPbaseElement": { + "allOf": [ + { + "$ref": "#/definitions/DataElement" + }, + { + "properties": { + "idShort": { + "type": "string", + "enum": ["base"] + }, + + "valueType": { + "$ref": "#/definitions/DataTypeDefXsd", + "enum": ["xs:anyURI"] + }, + "value": { + "type": "string" + }, + "valueId": { + "$ref": "#/definitions/Reference" + }, + "modelType": { + "const": "Property" + } + }, + "required": ["valueType"] + } + ] + }, + "MODBUSbaseElement": { + "allOf": [ + { + "$ref": "#/definitions/DataElement" + }, + { + "properties": { + "idShort": { + "type": "string", + "enum": ["base"] + }, + + "valueType": { + "$ref": "#/definitions/DataTypeDefXsd", + "enum": ["xs:anyURI"] + }, + "value": { + "type": "string" + }, + "valueId": { + "$ref": "#/definitions/Reference" + }, + "modelType": { + "const": "Property" + } + }, + "required": ["valueType"] + } + ] + }, + "MQTTbaseElement": { + "allOf": [ + { + "$ref": "#/definitions/DataElement" + }, + { + "properties": { + "idShort": { + "type": "string", + "enum": ["base"] + }, + + "valueType": { + "$ref": "#/definitions/DataTypeDefXsd", + "enum": ["xs:anyURI"] + }, + "value": { + "type": "string" + }, + "valueId": { + "$ref": "#/definitions/Reference" + }, + "modelType": { + "const": "Property" + } + }, + "required": ["valueType"] + } + ] + }, + "contentTypeElement": { + "allOf": [ + { + "$ref": "#/definitions/DataElement" + }, + { + "properties": { + "idShort": { + "type": "string", + "enum": ["contentType"] + }, + + "valueType": { + "$ref": "#/definitions/DataTypeDefXsd", + "enum": ["xs:string"] + }, + "value": { + "type": "string", + "enum": [ + "application/json", + "application/octet-stream", + "application/pdf", + "application/rdf+xml", + "image/svg+xml", + "image/png;base64" + ] + }, + "valueId": { + "$ref": "#/definitions/Reference" + }, + "modelType": { + "const": "Property" + } + }, + "required": ["valueType"] + } + ] + }, + "securityElement": { + "allOf": [ + { + "$ref": "#/definitions/SubmodelElement" + }, + { + "properties": { + "idShort": { + "type": "string", + "enum": ["security"] + }, + "orderRelevant": { + "type": "boolean" + }, + "semanticIdListElement": { + "$ref": "#/definitions/Reference" + }, + "typeValueListElement": { + "$ref": "#/definitions/AasSubmodelElements" + }, + "valueTypeListElement": { + "$ref": "#/definitions/DataTypeDefXsd" + }, + "value": { + "type": "array", + "minItems": 1, + "items": { + "$ref": "#/definitions/securityReferenceName" + } + }, + "modelType": { + "const": "SubmodelElementList" + } + }, + "required": ["typeValueListElement"] + } + ] + }, + "securityDefinitionsElement": { + "allOf": [ + { + "$ref": "#/definitions/SubmodelElement" + }, + { + "properties": { + "idShort": { + "type": "string", + "enum": ["securityDefinitions"] + }, + "value": { + "type": "array", + "minItems": 1, + "items": { + "anyOf": [ + { "$ref": "#/definitions/basicSecurityDefinitions" }, + { "$ref": "#/definitions/bearerSecurityDefinitions" }, + { "$ref": "#/definitions/digestSecurityDefinitions" }, + { "$ref": "#/definitions/apikeySecurityDefinitions" }, + { "$ref": "#/definitions/autoSecurityDefinitions" }, + { "$ref": "#/definitions/oauth2SecurityDefinitions" }, + { "$ref": "#/definitions/comboSecurityDefinitions" }, + { "$ref": "#/definitions/pskSecurityDefinitions" }, + { "$ref": "#/definitions/nosecSecurityDefinitions" } + ] + } + }, + "modelType": { + "const": "SubmodelElementCollection" + } + } + } + ] + }, + "securityReferenceName": { + "allOf": [ + { + "$ref": "#/definitions/DataElement" + }, + { + "properties": { + "value": { + "$ref": "#/definitions/Reference" + }, + "modelType": { + "const": "ReferenceElement" + } + } + } + ] + }, + "securityName": { + "allOf": [ + { + "$ref": "#/definitions/DataElement" + }, + { + "properties": { + "idShort": { + "type": "string" + }, + + "valueType": { + "type": "string", + "enum": ["xs:string"] + }, + "value": { + "type": "string" + }, + "valueId": { + "$ref": "#/definitions/Reference" + }, + "modelType": { + "const": "Property" + } + }, + "required": ["valueType"] + } + ] + }, + "nosecSecurityDefinitions": { + "allOf": [ + { + "$ref": "#/definitions/SubmodelElement" + }, + { + "properties": { + "idShort": { + "type": "string" + }, + "value": { + "type": "array", + "minItems": 1, + "items": { + "allOf": [{ "$ref": "#/definitions/schemeSecurityElement" }] + } + }, + "modelType": { + "const": "SubmodelElementCollection" + } + } + } + ] + }, + "basicSecurityDefinitions": { + "allOf": [ + { + "$ref": "#/definitions/SubmodelElement" + }, + { + "properties": { + "idShort": { + "type": "string" + }, + "value": { + "type": "array", + "minItems": 1, + "minContains": 1, + "items": { + "anyOf": [ + { "$ref": "#/definitions/nameSecurityElement" }, + { "$ref": "#/definitions/inSecurityElement" }, + { "$ref": "#/definitions/proxySecurityElement" }, + { "$ref": "#/definitions/schemeSecurityElement" } + ] + }, + "contains": { + "allOf": [{ "$ref": "#/definitions/schemeSecurityElement" }] + } + }, + "modelType": { + "const": "SubmodelElementCollection" + } + } + } + ] + }, + "bearerSecurityDefinitions": { + "allOf": [ + { + "$ref": "#/definitions/SubmodelElement" + }, + { + "properties": { + "idShort": { + "type": "string" + }, + "value": { + "type": "array", + "minItems": 1, + "minContains": 1, + "items": { + "anyOf": [ + { "$ref": "#/definitions/authorizationSecurityElement" }, + { "$ref": "#/definitions/nameSecurityElement" }, + { "$ref": "#/definitions/algSecurityElement" }, + { "$ref": "#/definitions/formatSecurityElement" }, + { "$ref": "#/definitions/inSecurityElement" }, + { "$ref": "#/definitions/proxySecurityElement" }, + { "$ref": "#/definitions/schemeSecurityElement" } + ] + }, + "contains": { + "allOf": [{ "$ref": "#/definitions/schemeSecurityElement" }] + } + }, + "modelType": { + "const": "SubmodelElementCollection" + } + } + } + ] + }, + "digestSecurityDefinitions": { + "allOf": [ + { + "$ref": "#/definitions/SubmodelElement" + }, + { + "properties": { + "idShort": { + "type": "string" + }, + "value": { + "type": "array", + "minItems": 1, + "minContains": 1, + "items": { + "anyOf": [ + { "$ref": "#/definitions/nameSecurityElement" }, + { "$ref": "#/definitions/inSecurityElement" }, + { "$ref": "#/definitions/qopSecurityElement" }, + { "$ref": "#/definitions/proxySecurityElement" }, + { "$ref": "#/definitions/schemeSecurityElement" } + ] + }, + "contains": { + "allOf": [{ "$ref": "#/definitions/schemeSecurityElement" }] + } + }, + "modelType": { + "const": "SubmodelElementCollection" + } + } + } + ] + }, + "apikeySecurityDefinitions": { + "allOf": [ + { + "$ref": "#/definitions/SubmodelElement" + }, + { + "properties": { + "idShort": { + "type": "string" + }, + "value": { + "type": "array", + "minItems": 1, + "minContains": 1, + "items": { + "anyOf": [ + { "$ref": "#/definitions/nameSecurityElement" }, + { "$ref": "#/definitions/inSecurityElement" }, + { "$ref": "#/definitions/proxySecurityElement" }, + { "$ref": "#/definitions/schemeSecurityElement" } + ] + }, + "contains": { + "allOf": [{ "$ref": "#/definitions/schemeSecurityElement" }] + } + }, + "modelType": { + "const": "SubmodelElementCollection" + } + } + } + ] + }, + "autoSecurityDefinitions": { + "allOf": [ + { + "$ref": "#/definitions/SubmodelElement" + }, + { + "properties": { + "idShort": { + "type": "string" + }, + "value": { + "type": "array", + "minItems": 1, + "minContains": 1, + "items": { + "anyOf": [ + { "$ref": "#/definitions/proxySecurityElement" }, + { "$ref": "#/definitions/schemeSecurityElement" } + ] + }, + "contains": { + "allOf": [{ "$ref": "#/definitions/schemeSecurityElement" }] + } + }, + "modelType": { + "const": "SubmodelElementCollection" + } + } + } + ] + }, + "pskSecurityDefinitions": { + "allOf": [ + { + "$ref": "#/definitions/SubmodelElement" + }, + { + "properties": { + "idShort": { + "type": "string" + }, + "value": { + "type": "array", + "minItems": 1, + "minContains": 1, + "items": { + "anyOf": [ + { "$ref": "#/definitions/identitySecurityElement" }, + { "$ref": "#/definitions/proxySecurityElement" }, + { "$ref": "#/definitions/schemeSecurityElement" } + ] + }, + "contains": { + "allOf": [{ "$ref": "#/definitions/schemeSecurityElement" }] + } + }, + "modelType": { + "const": "SubmodelElementCollection" + } + } + } + ] + }, + "oauth2SecurityDefinitions": { + "allOf": [ + { + "$ref": "#/definitions/SubmodelElement" + }, + { + "properties": { + "idShort": { + "type": "string" + }, + "value": { + "type": "array", + "minItems": 1, + + "items": { + "anyOf": [ + { "$ref": "#/definitions/authorizationSecurityElement" }, + { "$ref": "#/definitions/tokenSecurityElement" }, + { "$ref": "#/definitions/refreshSecurityElement" }, + { "$ref": "#/definitions/flowSecurityElement" }, + { "$ref": "#/definitions/proxySecurityElement" }, + { "$ref": "#/definitions/schemeSecurityElement" }, + { "$ref": "#/definitions/scopesSecurityElement" } + ] + }, + "contains": { + "anyOf": [ + { "$ref": "#/definitions/flowSecurityElement" }, + { "$ref": "#/definitions/schemeSecurityElement" } + ] + } + }, + "modelType": { + "const": "SubmodelElementCollection" + } + } + } + ] + }, + "comboSecurityDefinitions": { + "allOf": [ + { + "$ref": "#/definitions/SubmodelElement" + }, + { + "properties": { + "idShort": { + "type": "string" + }, + "value": { + "type": "array", + "minItems": 1, + "items": { + "oneOf": [ + { "$ref": "#/definitions/allOfsecurityElement" }, + { "$ref": "#/definitions/oneOfsecurityElement" }, + { "$ref": "#/definitions/proxySecurityElement" }, + { "$ref": "#/definitions/schemeSecurityElement" } + ] + } + }, + "modelType": { + "const": "SubmodelElementCollection" + } + } + } + ] + }, + "schemeSecurityElement": { + "allOf": [ + { + "$ref": "#/definitions/DataElement" + }, + { + "properties": { + "idShort": { + "type": "string", + "enum": ["scheme"] + }, + + "valueType": { + "$ref": "#/definitions/DataTypeDefXsd", + "enum": ["xs:string"] + }, + "value": { + "type": "string", + "enum": ["nosec", "digest", "basic", "apikey", "psk", "bearer", "auto", "combo", "oauth2"] + }, + "valueId": { + "$ref": "#/definitions/Reference" + }, + "modelType": { + "const": "Property" + } + }, + "required": ["valueType"] + } + ] + }, + "proxySecurityElement": { + "allOf": [ + { + "$ref": "#/definitions/DataElement" + }, + { + "properties": { + "idShort": { + "type": "string", + "enum": ["proxy"] + }, + + "valueType": { + "$ref": "#/definitions/DataTypeDefXsd", + "enum": ["xs:anyURI"] + }, + "value": { + "type": "string" + }, + "valueId": { + "$ref": "#/definitions/Reference" + }, + "modelType": { + "const": "Property" + } + }, + "required": ["valueType"] + } + ] + }, + "nameSecurityElement": { + "allOf": [ + { + "$ref": "#/definitions/DataElement" + }, + { + "properties": { + "idShort": { + "type": "string", + "enum": ["name"] + }, + + "valueType": { + "$ref": "#/definitions/DataTypeDefXsd", + "enum": ["xs:string"] + }, + "value": { + "type": "string" + }, + "valueId": { + "$ref": "#/definitions/Reference" + }, + "modelType": { + "const": "Property" + } + }, + "required": ["valueType"] + } + ] + }, + "inSecurityElement": { + "allOf": [ + { + "$ref": "#/definitions/DataElement" + }, + { + "properties": { + "idShort": { + "type": "string", + "enum": ["in"] + }, + + "valueType": { + "$ref": "#/definitions/DataTypeDefXsd", + "enum": ["xs:string"] + }, + "value": { + "type": "string", + "enum": ["header", "query", "body", "cookie", "auto"] + }, + "valueId": { + "$ref": "#/definitions/Reference" + }, + "modelType": { + "const": "Property" + } + }, + "required": ["valueType"] + } + ] + }, + "identitySecurityElement": { + "allOf": [ + { + "$ref": "#/definitions/DataElement" + }, + { + "properties": { + "idShort": { + "type": "string", + "enum": ["identity"] + }, + + "valueType": { + "$ref": "#/definitions/DataTypeDefXsd", + "enum": ["xs:string"] + }, + "value": { + "type": "string" + }, + "valueId": { + "$ref": "#/definitions/Reference" + }, + "modelType": { + "const": "Property" + } + }, + "required": ["valueType"] + } + ] + }, + "qopSecurityElement": { + "allOf": [ + { + "$ref": "#/definitions/DataElement" + }, + { + "properties": { + "idShort": { + "type": "string", + "enum": ["qop"] + }, + + "valueType": { + "$ref": "#/definitions/DataTypeDefXsd", + "enum": ["xs:string"] + }, + "value": { + "type": "string", + "enum": ["auth", "auth-int"] + }, + "valueId": { + "$ref": "#/definitions/Reference" + }, + "modelType": { + "const": "Property" + } + }, + "required": ["valueType"] + } + ] + }, + "authorizationSecurityElement": { + "allOf": [ + { + "$ref": "#/definitions/DataElement" + }, + { + "properties": { + "idShort": { + "type": "string", + "enum": ["authorization"] + }, + + "valueType": { + "$ref": "#/definitions/DataTypeDefXsd", + "enum": ["xs:anyURI"] + }, + "value": { + "type": "string" + }, + "valueId": { + "$ref": "#/definitions/Reference" + }, + "modelType": { + "const": "Property" + } + }, + "required": ["valueType"] + } + ] + }, + "algSecurityElement": { + "allOf": [ + { + "$ref": "#/definitions/DataElement" + }, + { + "properties": { + "idShort": { + "type": "string", + "enum": ["alg"] + }, + + "valueType": { + "$ref": "#/definitions/DataTypeDefXsd", + "enum": ["xs:string"] + }, + "value": { + "type": "string", + "enum": ["ES256", "ES512-256"] + }, + "valueId": { + "$ref": "#/definitions/Reference" + }, + "modelType": { + "const": "Property" + } + }, + "required": ["valueType"] + } + ] + }, + "formatSecurityElement": { + "allOf": [ + { + "$ref": "#/definitions/DataElement" + }, + { + "properties": { + "idShort": { + "type": "string", + "enum": ["format"] + }, + + "valueType": { + "$ref": "#/definitions/DataTypeDefXsd", + "enum": ["xs:string"] + }, + "value": { + "type": "string", + "enum": ["jwt", "cwt", "jwe", "jws"] + }, + "valueId": { + "$ref": "#/definitions/Reference" + }, + "modelType": { + "const": "Property" + } + }, + "required": ["valueType"] + } + ] + }, + "tokenSecurityElement": { + "allOf": [ + { + "$ref": "#/definitions/DataElement" + }, + { + "properties": { + "idShort": { + "type": "string", + "enum": ["token"] + }, + + "valueType": { + "$ref": "#/definitions/DataTypeDefXsd", + "enum": ["xs:anyURI"] + }, + "value": { + "type": "string" + }, + "valueId": { + "$ref": "#/definitions/Reference" + }, + "modelType": { + "const": "Property" + } + }, + "required": ["valueType"] + } + ] + }, + "refreshSecurityElement": { + "allOf": [ + { + "$ref": "#/definitions/DataElement" + }, + { + "properties": { + "idShort": { + "type": "string", + "enum": ["refresh"] + }, + + "valueType": { + "$ref": "#/definitions/DataTypeDefXsd", + "enum": ["xs:anyURI"] + }, + "value": { + "type": "string" + }, + "valueId": { + "$ref": "#/definitions/Reference" + }, + "modelType": { + "const": "Property" + } + }, + "required": ["valueType"] + } + ] + }, + "scopesSecurityElement": { + "allOf": [ + { + "$ref": "#/definitions/DataElement" + }, + { + "properties": { + "idShort": { + "type": "string", + "enum": ["scopes"] + }, + + "valueType": { + "$ref": "#/definitions/DataTypeDefXsd", + "enum": ["xs:string"] + }, + "value": { + "type": "string" + }, + "valueId": { + "$ref": "#/definitions/Reference" + }, + "modelType": { + "const": "Property" + } + }, + "required": ["valueType"] + } + ] + }, + "flowSecurityElement": { + "allOf": [ + { + "$ref": "#/definitions/DataElement" + }, + { + "properties": { + "idShort": { + "type": "string", + "enum": ["flow"] + }, + + "valueType": { + "$ref": "#/definitions/DataTypeDefXsd", + "enum": ["xs:string"] + }, + "value": { + "type": "string", + "enum": ["code", "client"] + }, + "valueId": { + "$ref": "#/definitions/Reference" + }, + "modelType": { + "const": "Property" + } + }, + "required": ["valueType"] + } + ] + }, + "allOfsecurityElement": { + "allOf": [ + { + "$ref": "#/definitions/SubmodelElement" + }, + { + "properties": { + "idShort": { + "type": "string", + "enum": ["allOf"] + }, + "orderRelevant": { + "type": "boolean" + }, + "semanticIdListElement": { + "$ref": "#/definitions/Reference" + }, + "typeValueListElement": { + "$ref": "#/definitions/AasSubmodelElements" + }, + "valueTypeListElement": { + "$ref": "#/definitions/DataTypeDefXsd" + }, + "value": { + "type": "array", + "items": { + "$ref": "#/definitions/securityName" + }, + "minItems": 1 + }, + "modelType": { + "const": "SubmodelElementList" + } + }, + "required": ["typeValueListElement"] + } + ] + }, + "oneOfsecurityElement": { + "allOf": [ + { + "$ref": "#/definitions/SubmodelElement" + }, + { + "properties": { + "idShort": { + "type": "string", + "enum": ["oneOf"] + }, + "orderRelevant": { + "type": "boolean" + }, + "semanticIdListElement": { + "$ref": "#/definitions/Reference" + }, + "typeValueListElement": { + "$ref": "#/definitions/AasSubmodelElements" + }, + "valueTypeListElement": { + "$ref": "#/definitions/DataTypeDefXsd" + }, + "value": { + "type": "array", + "items": { + "$ref": "#/definitions/securityName" + }, + "minItems": 1 + }, + "modelType": { + "const": "SubmodelElementList" + } + }, + "required": ["typeValueListElement"] + } + ] + }, + "keyElement": { + "allOf": [ + { + "$ref": "#/definitions/DataElement" + }, + { + "properties": { + "idShort": { + "type": "string", + "enum": ["key"] + }, + + "valueType": { + "type": "string", + "enum": ["xs:string"] + }, + "value": { + "type": "string" + }, + "valueId": { + "$ref": "#/definitions/Reference" + }, + "modelType": { + "const": "Property" + } + }, + "required": ["valueType"] + } + ] + }, + "typeElement": { + "allOf": [ + { + "$ref": "#/definitions/DataElement" + }, + { + "properties": { + "idShort": { + "type": "string", + "enum": ["type"] + }, + + "valueType": { + "type": "string", + "enum": ["xs:string"] + }, + "value": { + "type": "string", + "enum": ["float", "integer", "object", "array", "number", "string"] + }, + "valueId": { + "$ref": "#/definitions/Reference" + }, + "modelType": { + "const": "Property" + } + }, + "required": ["valueType"] + } + ] + }, + "observableElement": { + "allOf": [ + { + "$ref": "#/definitions/DataElement" + }, + { + "properties": { + "idShort": { + "type": "string", + "enum": ["observable"] + }, + + "valueType": { + "type": "string", + "enum": ["xs:boolean"] + }, + "value": { + "type": "string" + }, + "valueId": { + "$ref": "#/definitions/Reference" + }, + "modelType": { + "const": "Property" + } + }, + "required": ["valueType"] + } + ] + }, + "constElement": { + "allOf": [ + { + "$ref": "#/definitions/DataElement" + }, + { + "properties": { + "idShort": { + "type": "string", + "enum": ["const"] + }, + + "valueType": { + "$ref": "#/definitions/DataTypeDefXsd" + }, + "value": { + "type": "string" + }, + "valueId": { + "$ref": "#/definitions/Reference" + }, + "modelType": { + "const": "Property" + } + }, + "required": ["valueType"] + } + ] + }, + "defaultElement": { + "allOf": [ + { + "$ref": "#/definitions/DataElement" + }, + { + "properties": { + "idShort": { + "type": "string", + "enum": ["default"] + }, + + "valueType": { + "$ref": "#/definitions/DataTypeDefXsd" + }, + "value": { + "type": "string" + }, + "valueId": { + "$ref": "#/definitions/Reference" + }, + "modelType": { + "const": "Property" + } + }, + "required": ["valueType"] + } + ] + }, + "unitElement": { + "allOf": [ + { + "$ref": "#/definitions/DataElement" + }, + { + "properties": { + "idShort": { + "type": "string", + "enum": ["unit"] + }, + + "valueType": { + "type": "string" + }, + "value": { + "type": "string" + }, + "valueId": { + "$ref": "#/definitions/Reference" + }, + "modelType": { + "const": "Property" + } + }, + "required": ["valueType"] + } + ] + }, + "min_maxElement": { + "allOf": [ + { + "$ref": "#/definitions/DataElement" + }, + { + "properties": { + "idShort": { + "type": "string", + "enum": ["min_max"] + }, + "valueType": { + "$ref": "#/definitions/DataTypeDefXsd" + }, + "min": { + "type": "string" + }, + "max": { + "type": "string" + }, + "modelType": { + "const": "Range" + } + }, + "required": ["valueType"] + } + ] + }, + "lengthRangeElement": { + "allOf": [ + { + "$ref": "#/definitions/DataElement" + }, + { + "properties": { + "idShort": { + "type": "string", + "enum": ["lengthRange"] + }, + "valueType": { + "$ref": "#/definitions/DataTypeDefXsd" + }, + "min": { + "type": "string" + }, + "max": { + "type": "string" + }, + "modelType": { + "const": "Range" + } + }, + "required": ["valueType"] + } + ] + }, + "itemsRangeElement": { + "allOf": [ + { + "$ref": "#/definitions/DataElement" + }, + { + "properties": { + "idShort": { + "type": "string", + "enum": ["itemsRange"] + }, + "valueType": { + "$ref": "#/definitions/DataTypeDefXsd" + }, + "min": { + "type": "string" + }, + "max": { + "type": "string" + }, + "modelType": { + "const": "Range" + } + }, + "required": ["valueType"] + } + ] + }, + "valueSemanticsElement": { + "allOf": [ + { + "$ref": "#/definitions/DataElement" + }, + { + "properties": { + "idShort": { + "type": "string", + "enum": ["valueSemantics"] + }, + "value": { + "$ref": "#/definitions/Reference" + }, + "modelType": { + "const": "ReferenceElement" + } + } + } + ] + }, + "itemsElement": { + "allOf": [ + { + "$ref": "#/definitions/SubmodelElement" + }, + { + "properties": { + "idShort": { + "type": "string", + "enum": ["items"] + }, + "value": { + "type": "array", + "items": {} + }, + "modelType": { + "const": "SubmodelElementCollection" + } + } + } + ] + }, + "InternalPropertiesForObjectElement": { + "allOf": [ + { + "$ref": "#/definitions/SubmodelElement" + }, + { + "properties": { + "idShort": { + "type": "string", + "enum": ["properties"] + }, + "value": { + "type": "array", + "items": {} + }, + "modelType": { + "const": "SubmodelElementCollection" + } + } + } + ] + }, + "hrefElement": { + "allOf": [ + { + "$ref": "#/definitions/DataElement" + }, + { + "properties": { + "idShort": { + "type": "string", + "enum": ["href"] + }, + + "valueType": { + "type": "string", + "enum": ["xs:anyURI", "xs:string"] + }, + "value": { + "type": "string" + }, + "valueId": { + "$ref": "#/definitions/Reference" + }, + "modelType": { + "const": "Property" + } + }, + "required": ["valueType"] + } + ] + }, + "htvMethodNameElement": { + "allOf": [ + { + "$ref": "#/definitions/DataElement" + }, + { + "properties": { + "idShort": { + "type": "string", + "enum": ["htv_methodName"] + }, + + "valueType": { + "type": "string" + }, + "value": { + "type": "string" + }, + "valueId": { + "$ref": "#/definitions/Reference" + }, + "modelType": { + "const": "Property" + } + }, + "required": ["valueType"] + } + ] + }, + "htvHeadersElement": { + "allOf": [ + { + "$ref": "#/definitions/SubmodelElement" + }, + { + "properties": { + "idShort": { + "type": "string", + "enum": ["htv_headers"] + }, + "orderRelevant": { + "type": "boolean" + }, + "semanticIdListElement": { + "$ref": "#/definitions/Reference" + }, + "typeValueListElement": { + "$ref": "#/definitions/AasSubmodelElements" + }, + "valueTypeListElement": { + "$ref": "#/definitions/DataTypeDefXsd" + }, + "value": { + "type": "array", + "minItems": 1, + "items": {} + }, + "modelType": { + "const": "SubmodelElementList" + } + }, + "required": ["typeValueListElement"] + } + ] + }, + "mqvRetainElement": { + "allOf": [ + { + "$ref": "#/definitions/DataElement" + }, + { + "properties": { + "idShort": { + "type": "string", + "enum": ["mqv_retain"] + }, + + "valueType": { + "type": "string" + }, + "value": { + "type": "string" + }, + "valueId": { + "$ref": "#/definitions/Reference" + }, + "modelType": { + "const": "Property" + } + }, + "required": ["valueType"] + } + ] + }, + "mqvControlPacketElement": { + "allOf": [ + { + "$ref": "#/definitions/DataElement" + }, + { + "properties": { + "idShort": { + "type": "string", + "enum": ["mqv_controlPacket"] + }, + + "valueType": { + "type": "string" + }, + "value": { + "type": "string" + }, + "valueId": { + "$ref": "#/definitions/Reference" + }, + "modelType": { + "const": "Property" + } + }, + "required": ["valueType"] + } + ] + }, + "mqvQOSElement": { + "allOf": [ + { + "$ref": "#/definitions/DataElement" + }, + { + "properties": { + "idShort": { + "type": "string", + "enum": ["mqv_qos"] + }, + + "valueType": { + "type": "string" + }, + "value": { + "type": "string" + }, + "valueId": { + "$ref": "#/definitions/Reference" + }, + "modelType": { + "const": "Property" + } + }, + "required": ["valueType"] + } + ] + }, + "modbusFunctionElement": { + "allOf": [ + { + "$ref": "#/definitions/DataElement" + }, + { + "properties": { + "idShort": { + "type": "string", + "enum": ["modbus_function"] + }, + + "valueType": { + "type": "string", + "enum": ["xs:string"] + }, + "value": { + "type": "string" + }, + "valueId": { + "$ref": "#/definitions/Reference" + }, + "modelType": { + "const": "Property" + } + }, + "required": ["valueType"] + } + ] + }, + "modbusElements": { + "allOf": [ + { + "$ref": "#/definitions/DataElement" + }, + { + "properties": { + "idShort": { + "type": "string", + "enum": ["modbus_function"] + }, + + "valueType": { + "type": "string", + "enum": ["xs:string"] + }, + "value": { + "type": "string" + }, + "valueId": { + "$ref": "#/definitions/Reference" + }, + "modelType": { + "const": "Property" + } + }, + "required": ["valueType"] + } + ] + }, + "modbusEntityElement": { + "allOf": [ + { + "$ref": "#/definitions/DataElement" + }, + { + "properties": { + "idShort": { + "type": "string", + "enum": ["modbus_entity"] + }, + + "valueType": { + "type": "string" + }, + "value": { + "type": "string" + }, + "valueId": { + "$ref": "#/definitions/Reference" + }, + "modelType": { + "const": "Property" + } + }, + "required": ["valueType"] + } + ] + }, + "modbusZeroBasedAddressingElement": { + "allOf": [ + { + "$ref": "#/definitions/DataElement" + }, + { + "properties": { + "idShort": { + "type": "string", + "enum": ["modbus_zeroBasedAddressing"] + }, + + "valueType": { + "type": "string" + }, + "value": { + "type": "string" + }, + "valueId": { + "$ref": "#/definitions/Reference" + }, + "modelType": { + "const": "Property" + } + }, + "required": ["valueType"] + } + ] + }, + "modbusPollingTimeElement": { + "allOf": [ + { + "$ref": "#/definitions/DataElement" + }, + { + "properties": { + "idShort": { + "type": "string", + "enum": ["modbus_pollingTime"] + }, + + "valueType": { + "type": "string" + }, + "value": { + "type": "string" + }, + "valueId": { + "$ref": "#/definitions/Reference" + }, + "modelType": { + "const": "Property" + } + }, + "required": ["valueType"] + } + ] + }, + "modbustimeoutElement": { + "allOf": [ + { + "$ref": "#/definitions/DataElement" + }, + { + "properties": { + "idShort": { + "type": "string", + "enum": ["modbus_timeout"] + }, + + "valueType": { + "type": "string" + }, + "value": { + "type": "string" + }, + "valueId": { + "$ref": "#/definitions/Reference" + }, + "modelType": { + "const": "Property" + } + }, + "required": ["valueType"] + } + ] + }, + "modbusTypeElement": { + "allOf": [ + { + "$ref": "#/definitions/DataElement" + }, + { + "properties": { + "idShort": { + "type": "string", + "enum": ["modbus_type"] + }, + + "valueType": { + "type": "string" + }, + "value": { + "type": "string" + }, + "valueId": { + "$ref": "#/definitions/Reference" + }, + "modelType": { + "const": "Property" + } + }, + "required": ["valueType"] + } + ] + }, + "httpFormsElement": { + "allOf": [ + { + "$ref": "#/definitions/SubmodelElement" + }, + { + "properties": { + "idShort": { + "type": "string", + "enum": ["forms"] + }, + "value": { + "type": "array", + "items": { + "anyOf": [ + { "$ref": "#/definitions/contentTypeElement" }, + { "$ref": "#/definitions/hrefElement" }, + { "$ref": "#/definitions/securityElement" }, + { "$ref": "#/definitions/htvMethodNameElement" }, + { "$ref": "#/definitions/htvHeadersElement" } + ] + }, + "contains": { + "$ref": "#/definitions/hrefElement" + } + }, + "modelType": { + "const": "SubmodelElementCollection" + } + } + } + ] + }, + "mqttFormsElement": { + "allOf": [ + { + "$ref": "#/definitions/SubmodelElement" + }, + { + "properties": { + "idShort": { + "type": "string", + "enum": ["forms"] + }, + "value": { + "type": "array", + "items": { + "anyOf": [ + { "$ref": "#/definitions/contentTypeElement" }, + { "$ref": "#/definitions/hrefElement" }, + { "$ref": "#/definitions/securityElement" }, + { "$ref": "#/definitions/mqvQOSElement" }, + { "$ref": "#/definitions/mqvRetainElement" }, + { "$ref": "#/definitions/mqvControlPacketElement" } + ] + }, + "contains": { + "anyOf": [ + { "$ref": "#/definitions/hrefElement" }, + { "$ref": "#/definitions/mqvControlPacketElement" } + ] + } + }, + "modelType": { + "const": "SubmodelElementCollection" + } + } + } + ] + }, + "modbusFormsElement": { + "allOf": [ + { + "$ref": "#/definitions/SubmodelElement" + }, + { + "properties": { + "idShort": { + "type": "string", + "enum": ["forms"] + }, + "value": { + "uniqueItems": true, + "unevaluatedItems": false, + "maxItems": 9, + "type": "array", + "items": { + "anyOf": [ + { "$ref": "#/definitions/contentTypeElement" }, + { "$ref": "#/definitions/hrefElement" }, + { "$ref": "#/definitions/securityElement" }, + { "$ref": "#/definitions/modbusEntityElement" }, + { "$ref": "#/definitions/modbusFunctionElement" }, + { "$ref": "#/definitions/modbusPollingTimeElement" }, + { "$ref": "#/definitions/modbusTypeElement" }, + { "$ref": "#/definitions/modbusZeroBasedAddressingElement" }, + { "$ref": "#/definitions/modbustimeoutElement" } + ] + }, + "contains": { + "anyOf": [ + { "$ref": "#/definitions/hrefElement" }, + { "$ref": "#/definitions/modbusFunctionElement" } + ] + } + }, + "modelType": { + "const": "SubmodelElementCollection" + } + } + } + ] + } + } +} diff --git a/packages/td-tools/test/util/counterHTTP.aasx b/packages/td-tools/test/util/counterHTTP.aasx deleted file mode 100644 index eb01b3fbd..000000000 Binary files a/packages/td-tools/test/util/counterHTTP.aasx and /dev/null differ diff --git a/packages/td-tools/test/util/counterHTTP.json b/packages/td-tools/test/util/counterHTTP.json index 9de3bc1cc..a8239fd37 100644 --- a/packages/td-tools/test/util/counterHTTP.json +++ b/packages/td-tools/test/util/counterHTTP.json @@ -27,42 +27,72 @@ { "idShort": "AssetInterfacesDescription", "description": [ - { - "language": "en", - "text": "Counter example Thing" - }, - { - "language": "de", - "text": "Zähler Beispiel Ding" - }, - { - "language": "it", - "text": "Contatore di esempio" - } + { "language": "en", "text": "Counter example Thing" }, + { "language": "de", "text": "Zähler Beispiel Ding" }, + { "language": "it", "text": "Contatore di esempio" } ], "id": "https://example.com/ids/sm/4333_9041_7022_4184", "kind": "Instance", "semanticId": { "type": "ExternalReference", - "keys": [] + "keys": [ + { + "type": "GlobalReference", + "value": "https://admin-shell.io/idta/AssetInterfacesDescription/1/0/Submodel" + } + ] }, "submodelElements": [ { "idShort": "InterfaceHTTP", "semanticId": { "type": "ExternalReference", - "keys": [] + "keys": [ + { + "type": "GlobalReference", + "value": "https://admin-shell.io/idta/AssetInterfacesDescription/1/0/Interface" + } + ] }, + "supplementalSemanticIds": [ + { + "type": "ExternalReference", + "keys": [ + { + "type": "GlobalReference", + "value": "http://www.w3.org/2011/http" + } + ] + } + ], "embeddedDataSpecifications": [], "value": [ { "idShort": "title", + "semanticId": { + "type": "ExternalReference", + "keys": [ + { + "type": "GlobalReference", + "value": "https://www.w3.org/2019/wot/td#title" + } + ] + }, "valueType": "xs:string", "value": "Counter", "modelType": "Property" }, { "idShort": "support", + "semanticId": { + "type": "ExternalReference", + "keys": [ + { + "type": "GlobalReference", + "value": "https://www.w3.org/2019/wot/td#support" + } + ] + }, "valueType": "xs:anyURI", "value": "https://github.com/eclipse-thingweb/node-wot/", "modelType": "Property" @@ -71,7 +101,12 @@ "idShort": "EndpointMetadata", "semanticId": { "type": "ExternalReference", - "keys": [] + "keys": [ + { + "type": "GlobalReference", + "value": "https://admin-shell.io/idta/AssetInterfacesDescription/1/0/EndpointMetadata" + } + ] }, "embeddedDataSpecifications": [], "value": [ @@ -79,7 +114,12 @@ "idShort": "base", "semanticId": { "type": "ExternalReference", - "keys": [] + "keys": [ + { + "type": "GlobalReference", + "value": "https://www.w3.org/2019/wot/td#base" + } + ] }, "embeddedDataSpecifications": [], "valueType": "xs:anyURI", @@ -90,7 +130,12 @@ "idShort": "contentType", "semanticId": { "type": "ExternalReference", - "keys": [] + "keys": [ + { + "type": "GlobalReference", + "value": "https://www.w3.org/2019/wot/hypermedia#forContentType" + } + ] }, "embeddedDataSpecifications": [], "valueType": "xs:string", @@ -99,7 +144,16 @@ }, { "idShort": "security", - "typeValueListElement": "SubmodelElement", + "semanticId": { + "type": "ExternalReference", + "keys": [ + { + "type": "GlobalReference", + "value": "https://www.w3.org/2019/wot/td#hasSecurityConfiguration" + } + ] + }, + "typeValueListElement": "ReferenceElement", "value": [ { "value": { @@ -136,7 +190,12 @@ "idShort": "securityDefinitions", "semanticId": { "type": "ExternalReference", - "keys": [] + "keys": [ + { + "type": "GlobalReference", + "value": "https://www.w3.org/2019/wot/td#definesSecurityScheme" + } + ] }, "embeddedDataSpecifications": [], "value": [ @@ -144,12 +203,26 @@ "idShort": "nosec_sc", "semanticId": { "type": "ExternalReference", - "keys": [] + "keys": [ + { + "type": "GlobalReference", + "value": "https://www.w3.org/2019/wot/security#NoSecurityScheme" + } + ] }, "embeddedDataSpecifications": [], "value": [ { "idShort": "scheme", + "semanticId": { + "type": "ExternalReference", + "keys": [ + { + "type": "GlobalReference", + "value": "https://www.w3.org/2019/wot/td#definesSecurityScheme" + } + ] + }, "valueType": "xs:string", "value": "nosec", "modelType": "Property" @@ -167,7 +240,12 @@ "idShort": "InterfaceMetadata", "semanticId": { "type": "ExternalReference", - "keys": [] + "keys": [ + { + "type": "GlobalReference", + "value": "https://admin-shell.io/idta/AssetInterfacesDescription/1/0/InterfaceMetadata" + } + ] }, "embeddedDataSpecifications": [], "value": [ @@ -175,20 +253,22 @@ "idShort": "properties", "semanticId": { "type": "ExternalReference", - "keys": [] + "keys": [ + { + "type": "GlobalReference", + "value": "https://www.w3.org/2019/wot/td#PropertyAffordance" + } + ] }, "embeddedDataSpecifications": [], "value": [ { "idShort": "count", "description": [ - { - "language": "en", - "text": "Current counter value" - }, + { "language": "en", "text": "Current counter value" }, { "language": "de", - "text": "Derzeitiger Zählerwert" + "text": "Derzeitiger Z\u00E4hlerwert" }, { "language": "it", @@ -197,19 +277,56 @@ ], "semanticId": { "type": "ExternalReference", - "keys": [] + "keys": [ + { + "type": "GlobalReference", + "value": "https://admin-shell.io/idta/AssetInterfaceDescription/1/0/PropertyDefinition" + } + ] }, - "qualifiers": [], "embeddedDataSpecifications": [], "value": [ { "idShort": "type", + "semanticId": { + "type": "ExternalReference", + "keys": [ + { + "type": "GlobalReference", + "value": "https://www.w3.org/1999/02/22-rdf-syntax-ns#type" + } + ] + }, "valueType": "xs:string", "value": "integer", "modelType": "Property" }, { - "idShort": "range", + "idShort": "min_max", + "semanticId": { + "type": "ExternalReference", + "keys": [ + { + "type": "GlobalReference", + "value": "https://admin-shell.io/idta/AssetInterfacesDescription/1/0/minMaxRange" + } + ] + }, + "supplementalSemanticIds": [ + { + "type": "ExternalReference", + "keys": [ + { + "type": "GlobalReference", + "value": "https://www.w3.org/2019/wot/json-schema#minimum" + }, + { + "type": "GlobalReference", + "value": "https://www.w3.org/2019/wot/json-schema#maximum" + } + ] + } + ], "valueType": "xs:integer", "min": "1", "max": "100", @@ -217,12 +334,30 @@ }, { "idShort": "title", + "semanticId": { + "type": "ExternalReference", + "keys": [ + { + "type": "GlobalReference", + "value": "https://www.w3.org/2019/wot/td#title" + } + ] + }, "valueType": "xs:string", "value": "Count", "modelType": "Property" }, { "idShort": "observable", + "semanticId": { + "type": "ExternalReference", + "keys": [ + { + "type": "GlobalReference", + "value": "https://www.w3.org/2019/wot/td#isObservable" + } + ] + }, "valueType": "xs:boolean", "value": "true", "modelType": "Property" @@ -231,15 +366,25 @@ "idShort": "forms", "semanticId": { "type": "ExternalReference", - "keys": [] + "keys": [ + { + "type": "GlobalReference", + "value": "https://www.w3.org/2019/wot/td#hasForm" + } + ] }, "embeddedDataSpecifications": [], "value": [ { - "idShort": "htv:methodName", + "idShort": "htv_methodName", "semanticId": { "type": "ExternalReference", - "keys": [] + "keys": [ + { + "type": "GlobalReference", + "value": "https://www.w3.org/2011/http#methodName" + } + ] }, "embeddedDataSpecifications": [], "valueType": "xs:string", @@ -250,7 +395,12 @@ "idShort": "href", "semanticId": { "type": "ExternalReference", - "keys": [] + "keys": [ + { + "type": "GlobalReference", + "value": "https://www.w3.org/2019/wot/hypermedia#hasTarget" + } + ] }, "embeddedDataSpecifications": [], "valueType": "xs:string", @@ -272,7 +422,7 @@ }, { "language": "de", - "text": "Aktueller Zählerwert als SVG-Bild" + "text": "Aktueller Z\u00E4hlerwert als SVG-Bild" }, { "language": "it", @@ -281,13 +431,26 @@ ], "semanticId": { "type": "ExternalReference", - "keys": [] + "keys": [ + { + "type": "GlobalReference", + "value": "https://admin-shell.io/idta/AssetInterfaceDescription/1/0/PropertyDefinition" + } + ] }, - "qualifiers": [], "embeddedDataSpecifications": [], "value": [ { "idShort": "observable", + "semanticId": { + "type": "ExternalReference", + "keys": [ + { + "type": "GlobalReference", + "value": "https://www.w3.org/2019/wot/td#isObservable" + } + ] + }, "valueType": "xs:boolean", "value": "false", "modelType": "Property" @@ -296,15 +459,25 @@ "idShort": "forms", "semanticId": { "type": "ExternalReference", - "keys": [] + "keys": [ + { + "type": "GlobalReference", + "value": "https://www.w3.org/2019/wot/td#hasForm" + } + ] }, "embeddedDataSpecifications": [], "value": [ { - "idShort": "htv:methodName", + "idShort": "htv_methodName", "semanticId": { "type": "ExternalReference", - "keys": [] + "keys": [ + { + "type": "GlobalReference", + "value": "https://www.w3.org/2011/http#methodName" + } + ] }, "embeddedDataSpecifications": [], "valueType": "xs:string", @@ -315,7 +488,12 @@ "idShort": "href", "semanticId": { "type": "ExternalReference", - "keys": [] + "keys": [ + { + "type": "GlobalReference", + "value": "https://www.w3.org/2019/wot/hypermedia#hasTarget" + } + ] }, "embeddedDataSpecifications": [], "valueType": "xs:string", @@ -326,11 +504,16 @@ "idShort": "contentType", "semanticId": { "type": "ExternalReference", - "keys": [] + "keys": [ + { + "type": "GlobalReference", + "value": "https://www.w3.org/2019/wot/hypermedia#forContentType" + } + ] }, "embeddedDataSpecifications": [], "valueType": "xs:string", - "value": "image/svg+xml", + "value": "image/svg\u002Bxml", "modelType": "Property" } ], @@ -342,14 +525,8 @@ { "idShort": "redDotImage", "description": [ - { - "language": "en", - "text": "Red dot image as PNG" - }, - { - "language": "de", - "text": "Rotes Punktbild als PNG" - }, + { "language": "en", "text": "Red dot image as PNG" }, + { "language": "de", "text": "Rotes Punktbild als PNG" }, { "language": "it", "text": "Immagine punto rosso come PNG" @@ -357,13 +534,26 @@ ], "semanticId": { "type": "ExternalReference", - "keys": [] + "keys": [ + { + "type": "GlobalReference", + "value": "https://admin-shell.io/idta/AssetInterfaceDescription/1/0/PropertyDefinition" + } + ] }, - "qualifiers": [], "embeddedDataSpecifications": [], "value": [ { "idShort": "observable", + "semanticId": { + "type": "ExternalReference", + "keys": [ + { + "type": "GlobalReference", + "value": "https://www.w3.org/2019/wot/td#isObservable" + } + ] + }, "valueType": "xs:boolean", "value": "false", "modelType": "Property" @@ -372,15 +562,25 @@ "idShort": "forms", "semanticId": { "type": "ExternalReference", - "keys": [] + "keys": [ + { + "type": "GlobalReference", + "value": "https://www.w3.org/2019/wot/td#hasForm" + } + ] }, "embeddedDataSpecifications": [], "value": [ { - "idShort": "htv:methodName", + "idShort": "htv_methodName", "semanticId": { "type": "ExternalReference", - "keys": [] + "keys": [ + { + "type": "GlobalReference", + "value": "https://www.w3.org/2011/http#methodName" + } + ] }, "embeddedDataSpecifications": [], "valueType": "xs:string", @@ -391,7 +591,12 @@ "idShort": "href", "semanticId": { "type": "ExternalReference", - "keys": [] + "keys": [ + { + "type": "GlobalReference", + "value": "https://www.w3.org/2019/wot/hypermedia#hasTarget" + } + ] }, "embeddedDataSpecifications": [], "valueType": "xs:string", @@ -402,7 +607,12 @@ "idShort": "contentType", "semanticId": { "type": "ExternalReference", - "keys": [] + "keys": [ + { + "type": "GlobalReference", + "value": "https://www.w3.org/2019/wot/hypermedia#forContentType" + } + ] }, "embeddedDataSpecifications": [], "valueType": "xs:string", @@ -422,10 +632,7 @@ "language": "en", "text": "Last change of counter value" }, - { - "language": "de", - "text": "Letzte Änderung" - }, + { "language": "de", "text": "Letzte \u00C4nderung" }, { "language": "it", "text": "Ultima modifica del valore" @@ -433,25 +640,56 @@ ], "semanticId": { "type": "ExternalReference", - "keys": [] + "keys": [ + { + "type": "GlobalReference", + "value": "https://admin-shell.io/idta/AssetInterfaceDescription/1/0/PropertyDefinition" + } + ] }, - "qualifiers": [], "embeddedDataSpecifications": [], "value": [ { "idShort": "type", + "semanticId": { + "type": "ExternalReference", + "keys": [ + { + "type": "GlobalReference", + "value": "https://www.w3.org/1999/02/22-rdf-syntax-ns#type" + } + ] + }, "valueType": "xs:string", "value": "string", "modelType": "Property" }, { "idShort": "title", + "semanticId": { + "type": "ExternalReference", + "keys": [ + { + "type": "GlobalReference", + "value": "https://www.w3.org/2019/wot/td#title" + } + ] + }, "valueType": "xs:string", "value": "Last change", "modelType": "Property" }, { "idShort": "observable", + "semanticId": { + "type": "ExternalReference", + "keys": [ + { + "type": "GlobalReference", + "value": "https://www.w3.org/2019/wot/td#isObservable" + } + ] + }, "valueType": "xs:boolean", "value": "true", "modelType": "Property" @@ -460,15 +698,25 @@ "idShort": "forms", "semanticId": { "type": "ExternalReference", - "keys": [] + "keys": [ + { + "type": "GlobalReference", + "value": "https://www.w3.org/2019/wot/td#hasForm" + } + ] }, "embeddedDataSpecifications": [], "value": [ { - "idShort": "htv:methodName", + "idShort": "htv_methodName", "semanticId": { "type": "ExternalReference", - "keys": [] + "keys": [ + { + "type": "GlobalReference", + "value": "https://www.w3.org/2011/http#methodName" + } + ] }, "embeddedDataSpecifications": [], "valueType": "xs:string", @@ -479,7 +727,12 @@ "idShort": "href", "semanticId": { "type": "ExternalReference", - "keys": [] + "keys": [ + { + "type": "GlobalReference", + "value": "https://www.w3.org/2019/wot/hypermedia#hasTarget" + } + ] }, "embeddedDataSpecifications": [], "valueType": "xs:string", @@ -499,7 +752,12 @@ "idShort": "actions", "semanticId": { "type": "ExternalReference", - "keys": [] + "keys": [ + { + "type": "GlobalReference", + "value": "https://www.w3.org/2019/wot/td#ActionAffordance" + } + ] }, "embeddedDataSpecifications": [], "value": [], @@ -509,7 +767,12 @@ "idShort": "events", "semanticId": { "type": "ExternalReference", - "keys": [] + "keys": [ + { + "type": "GlobalReference", + "value": "https://www.w3.org/2019/wot/td#EventAffordance" + } + ] }, "embeddedDataSpecifications": [], "value": [], @@ -519,10 +782,15 @@ "modelType": "SubmodelElementCollection" }, { - "idShort": "externalDescriptor", + "idShort": "ExternalDescriptor", "semanticId": { "type": "ExternalReference", - "keys": [] + "keys": [ + { + "type": "GlobalReference", + "value": "https://admin-shell.io/idta/AssetInterfacesDescription/1/0/ExternalDescriptor" + } + ] }, "embeddedDataSpecifications": [], "value": [ @@ -530,7 +798,12 @@ "idShort": "ThingDescription", "semanticId": { "type": "ExternalReference", - "keys": [] + "keys": [ + { + "type": "GlobalReference", + "value": "https://admin-shell.io/idta/AssetInterfacesDescription/1/0/externalDescriptorName" + } + ] }, "embeddedDataSpecifications": [], "value": "/aasx/files/counter-http-simple.td.jsonld", diff --git a/packages/td-tools/test/util/inverterModbus.json b/packages/td-tools/test/util/inverterModbus.json index 1ef9f4243..aab0d99c7 100644 --- a/packages/td-tools/test/util/inverterModbus.json +++ b/packages/td-tools/test/util/inverterModbus.json @@ -50,7 +50,7 @@ }, { "idShort": "security", - "typeValueListElement": "SubmodelElement", + "typeValueListElement": "ReferenceElement", "value": [ { "value": { @@ -81,7 +81,7 @@ "modelType": "ReferenceElement" } ], - "modelType": "SubmodelElementCollection" + "modelType": "SubmodelElementList" }, { "idShort": "securityDefinitions", @@ -128,12 +128,6 @@ { "idShort": "forms", "value": [ - { - "idShort": "op", - "valueType": "xs:string", - "value": "readproperty", - "modelType": "Property" - }, { "idShort": "href", "valueType": "xs:string", @@ -189,12 +183,6 @@ { "idShort": "forms", "value": [ - { - "idShort": "op", - "valueType": "xs:string", - "value": "readproperty", - "modelType": "Property" - }, { "idShort": "href", "valueType": "xs:string", @@ -202,13 +190,13 @@ "modelType": "Property" }, { - "idShort": "modbus:function", + "idShort": "modbus_function", "valueType": "xs:string", "value": "readHoldingRegisters", "modelType": "Property" }, { - "idShort": "modbus:type", + "idShort": "modbus_type", "valueType": "xs:string", "value": "uint16be", "modelType": "Property"