diff --git a/.gencode_hash.txt b/.gencode_hash.txt index f3d0e96950..d8fcf9ee9e 100644 --- a/.gencode_hash.txt +++ b/.gencode_hash.txt @@ -14,7 +14,7 @@ e550539d52ce1f63b35247d425c038e5d5ba33f997eedd09e486a3bd9838c2c2 gencode/docs/e cac253f57c5c92ef32e2a5f91b6cec8229e8db1dcffcc96a58f06da068e741e7 gencode/docs/events_system.html 151c1b62db35e84e51d5ff2a7464f61ced4d7fb0c7eb795715c245ee0a1b3436 gencode/docs/events_udmi.html 73dbe799e7943ec20ac58b544998e986a39539d4ef0cb4f5023e92e7634d3124 gencode/docs/events_validation.html -8713e90241e3e5aa8840f361202980fefaf886f3ec18f49537e1b2695d0ec5a6 gencode/docs/metadata.html +dbd37c286727041def7f20b21bcce1788a8d95511ffc830522f915d8fa0018c2 gencode/docs/metadata.html c86682715d348bd3dd971fa5bd925a8a3d0f3c2944c65a47c4b64fe1a5ccdea2 gencode/docs/monitoring.html 474ca16edc9f3cad2bb3ab40b6993cbced90263f762f66ee6cd246a6c4a0d18f gencode/docs/persistent_device.html e11595fd11477947a27461f8ef4fb6facb5f60e2abd6212193f7581ab123ff84 gencode/docs/properties.html @@ -50,6 +50,7 @@ c44f25ab2b9f17ea18c7cd5b78e4c5565ba4ecc20d426105d778c28bb6b32263 gencode/java/u 7f2d98ef9f1eef27a2aad684fda33ad79728421a228df93f502fbde981fdfbf3 gencode/java/udmi/schema/Connections.java 5a82b0496e2f907fe37ce38cd0437b59d75b458827ed5eb14a836c34982421ec gencode/java/udmi/schema/Coordinates.java 256ecb8fe4388ed5b16c4bbc292a655e423e67c3d5102f18cc053ae6110bf085 gencode/java/udmi/schema/Credential.java +3e9493f6348b03f0e833d17b450b2b7319905acd2876cc0e7bec72ea416545fa gencode/java/udmi/schema/DetailRelationshipsModel.java 4cfcfcb79aed8b6a0319b17efeb43ad601cb8d7f746ab4352d8ec30e75a61274 gencode/java/udmi/schema/DeviceMappingConfig.java 625c58696de0d960d93195d79f9e88dfcd5717697fb0f0a6310e5114fb7e6438 gencode/java/udmi/schema/DeviceMappingState.java fd289a9a132a880bf0a14b80ed082ab1dcd77caab54175f8d6ccfc381d2d21ab gencode/java/udmi/schema/DevicePersistent.java @@ -95,7 +96,7 @@ ca932e3a0d0da213950aa89ad7a19d94505dd478bf196946aa93436c5c8b7512 gencode/java/u edbb091621a6f5e3f7e6804c7c30c0877fab0b0455661186f37b303ed108ff26 gencode/java/udmi/schema/MappingEvents.java 2742b162c3524152f3f5fce62015139295fab7cbf8f58beb7f8287ea5d294e7c gencode/java/udmi/schema/MappingState.java 8b15a8982ccadc52d52a8083cb9e101c73f2a48e069c4d41d6e59ea914352507 gencode/java/udmi/schema/MessageTemplateData.java -d0f48c974f10d23e7227c3040f30dfec1587cbc036c3dcd2929a9fa8a2906500 gencode/java/udmi/schema/Metadata.java +9c224bcfd5306437cc52c090fc850ac7f1c12bab790364a24dca85790dc3d01d gencode/java/udmi/schema/Metadata.java a64167bfcec809442cff132bb59ae0600055731407858656cc7147c3a38bb7cc gencode/java/udmi/schema/Metrics.java e986aff1efca08188441a246392f8c524c2cdaae107e475657402872a9a01561 gencode/java/udmi/schema/Monitoring.java 25210c7f94b6369c43c68ed1fefba1ab3dedfe3201352055c536fd5225a4c590 gencode/java/udmi/schema/MonitoringMetric.java @@ -134,7 +135,7 @@ a371232810e8a2ffb380384ca717da1ee5cc0b2e1129df9b5d8faa07ab4b1f46 gencode/java/u ffc9d3760db858b7d3d3cc1187cdb4df7d8396700f6ebdaaedb6bc3bcc8b569a gencode/java/udmi/schema/SystemDiscoveryData.java 4c1b621b16130ed993205b58e4eaa1aeef3ce2b9eb173d11720efb4df6092e9e gencode/java/udmi/schema/SystemEvents.java d36e487e0f59e6d9416c661aa6a70589a7e5b1763a2ff5a556fea7984b40200f gencode/java/udmi/schema/SystemHardware.java -f2d5c41298ad9cc1e8411ca1e094ada7d6457f1ee71743bcd163f77c51d8d9c0 gencode/java/udmi/schema/SystemModel.java +6b578b2e480bdf397afc02c1450a9b8cebd0c40867a7e9e1c0205f38d6afb61b gencode/java/udmi/schema/SystemModel.java 18a5e1e4daf656776d101aeda94021e6cab6f47f2caab88b7aba8abbbf5d2a7a gencode/java/udmi/schema/SystemState.java 7db128c5607f7f2a701e60895da9f49ae8b2c75a8daf7792fd155d537978fdd0 gencode/java/udmi/schema/TargetTestingModel.java f9c304ff024f26654ee7f6a06661a825dfaf312a4fffd0cf753f4eea5958060b gencode/java/udmi/schema/TestingModel.java @@ -148,10 +149,10 @@ eadc72e31b4796273479967303513b16563af0f946d1e1c7eba1748f9b133d40 gencode/java/u 5596535c39826e904949eed7894c3ecd1ee982d974beb7469f888965af2c7845 gencode/java/udmi/schema/VirtualEquipmentLinks.java 11f8dab5296d41e86cd623a4ed27b972ae673b141907cb913397d4eb53880c59 gencode/java/udmi/schema/Water.java d2a53a067185447ce672e5521cdb073a2b2100b9384b68e87211cafc5ef8cb2a gencode/presentation/presentation.json -b8f3e06b7e7c7c4fb7ac37adb2674ab661ebbc63574ab0e1794645c653aef0fa gencode/python/dist/udmi_schema-0.1.0-py3-none-any.whl -736a565b4d86ae48baa965721eb81fceda168a048030b885ad68eaf74640fd9d gencode/python/dist/udmi_schema-0.1.0.tar.gz +108b07a0ff7ac73a2b44f1ee8d30bdac8170a0e2c5f7b2f61caba714f068467c gencode/python/dist/udmi_schema-0.1.0-py3-none-any.whl +27086496cadddf30c7a54eadc951e715de2c798e22d9ab891b5e6843f648b31c gencode/python/dist/udmi_schema-0.1.0.tar.gz 4cf98cbd132cde0cc8813ac35cf3712cb46014154c817c04ad2902c268cdd8fe gencode/python/pyproject.toml -25c06f5e266f18797041492d5c17ae386abec5106da7d129e2b54e8de32e3980 gencode/python/udmi/schema/__init__.py +50114733a432ea19aeabd99b050ff0dd11f700ddc7db53dc8843a93bcb40e5e7 gencode/python/udmi/schema/__init__.py 478b09b7e26c07441e86e1778f7e5ce8f8fa1b3fce88b8089064347d1e2fc67b gencode/python/udmi/schema/_base.py 0e18050ec17fde8162f75a76d9dc623d3f6ddca4396441bd603189827ed21a80 gencode/python/udmi/schema/access_iot.py 32a951e2bf13f556082f8d94be079b3df6cc081b6ff59f71a82d32782cf8f8f6 gencode/python/udmi/schema/ancillary_properties.py @@ -201,7 +202,7 @@ e4cdab07942e52cae243b4dddbc72676794914947dd66df8add0f5969f31fd11 gencode/python 8c5a6101e62c751714a7440db3993167b7d86bffd80589076bca1feb0a91d214 gencode/python/udmi/schema/events_udmi.py 72559779680c79dace3c5903022709852cbad7b77ed42af97debc8d852d61cb7 gencode/python/udmi/schema/events_validation.py a3ea178f98a4993da708e2ec41f5ede74aa92d742ffbe201a77adef803d4143a gencode/python/udmi/schema/events_validation_device.py -8a77178da055ded46c350e83064057b3754f487bbbc30ed2ab475c647e0b3be5 gencode/python/udmi/schema/metadata.py +0f3a5c0d614b8d0b03e4efda32939053b9719775ebf650c7a0ce70505e65bfea gencode/python/udmi/schema/metadata.py bb3e28f8ae3b43ddd3b99fbc96a2a3cfd7103e0742fb9427c2191b3674ccea90 gencode/python/udmi/schema/model_cloud.py 670ea1a72ade3d9af0df00c694cbd755f3a2748022c99b90f3b86a017b7424a9 gencode/python/udmi/schema/model_cloud_config.py 798ee0ee5094d1c3e4681626832d16428df26e752e0e0425d61178f6e231efa6 gencode/python/udmi/schema/model_discovery.py @@ -214,7 +215,9 @@ c799ce667100201d81f02f0a5d22a4d0ef7db01035e7f08219a76a04c4507a15 gencode/python 977c2a40651b65aa68d8051fd09c796adb723575356c0791adc87e4331cdbebd gencode/python/udmi/schema/model_localnet_family.py 7a252256cce946af6750c644e91b0f09363c8e28b03dbb41c8ae3e5d0758d615 gencode/python/udmi/schema/model_pointset.py 7271212f7afa718dbcb81ff01af488c64cc4bfbd756f4e54efa8c4a5359ea47b gencode/python/udmi/schema/model_pointset_point.py -241c702f6a877f41c0ebd997c7e431ba8e6d6c0d1b21bc95a9fc57592ff094a7 gencode/python/udmi/schema/model_system.py +7bb2fab2c4583aec2be3989c53ee9d2021fc38c806fe4829f3df8023350557d1 gencode/python/udmi/schema/model_relationships.py +9aada0e766c478e680a863bff286b1f2233e9df4ad2acbb5f0f5edb2ce284bc6 gencode/python/udmi/schema/model_relationships_detail.py +cf69db19b9f44d4061f2907f94c548e298c40aaf6b12bddba1a56b2d5491cd6d gencode/python/udmi/schema/model_system.py 1db2fca012d3da953438b78acd2a5c15d94e46df8b77c459876e20ef2598dfbd gencode/python/udmi/schema/model_system_hardware.py 954806649d0e7364c482f84f75e19b01ce926990d64a79e76400f32043ddda66 gencode/python/udmi/schema/model_testing.py 345ee1c07dc58c9a2daabf0820e15d881c4af271a8ea85044c45cd4dca3c0afa gencode/python/udmi/schema/model_testing_target.py diff --git a/gencode/docs/metadata.html b/gencode/docs/metadata.html index 23306200d0..c9592ee2fc 100644 --- a/gencode/docs/metadata.html +++ b/gencode/docs/metadata.html @@ -1903,7 +1903,7 @@

d="M4 8a.5.5 0 0 1 .5-.5h5.793L8.146 5.354a.5.5 0 1 1 .708-.708l3 3a.5.5 0 0 1 0 .708l-3 3a.5.5 0 0 1-.708-.708L10.293 8.5H4.5A.5.5 0 0 1 4 8z" /> - tagsType: array
+ tagsType: array of string

Tags associated with the device

@@ -1937,7 +1937,7 @@

d="M4 8a.5.5 0 0 1 .5-.5h5.793L8.146 5.354a.5.5 0 1 1 .708-.708l3 3a.5.5 0 0 1 0 .708l-3 3a.5.5 0 0 1-.708-.708L10.293 8.5H4.5A.5.5 0 0 1 4 8z" /> - tags itemsType: object
+ tags itemsType: string
Must match regular expression: ^[a-z][_a-z0-9]+$ @@ -4718,6 +4718,314 @@

+
+
+
+

+ +

+
+ +
+
+ +

Relationships Model

Type: object
+

Information for modeling noun-verb-noun relationships between devices

+
+ + No Additional Properties + + + + + + +
+
+
+

+ +

+
+ +
+

+ +

+

All properties whose name matches the following regular expression must respect the following conditions

+ Property name regular expression: ^[A-Z]{2,6}-[1-9][0-9]*$ +
+ + Type: object
+ No Additional Properties + + + + + + +
+
+
+

+ +

+
+ +
+

+ +

+

All properties whose name matches the following regular expression must respect the following conditions

+ Property name regular expression: ^[a-z]+$ +
+ + Type: array
+ + + + + + + No Additional Items

Each item of this array must be:

+
+
+ + +

Detail Relationships Model

Type: object
+

Information for modeling noun-verb-noun relationships between devices

+
+ + No Additional Properties + + + + + + +
+
+
+

+ +

+
+ +
+
+ + Type: array of string
+

Tags associated with the device

+
+ + + + + +

All items must be unique

No Additional Items

Each item of this array must be:

+
+
+ + + Type: string
+Must match regular expression: ^[a-z][_a-z0-9]+$ + + + + + + +
+

+
Examples:
+
[
+    "lighting"
+]
+
+
[
+    "energy",
+    "building",
+    "vendor_managed"
+]
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/gencode/java/udmi/schema/DetailRelationshipsModel.java b/gencode/java/udmi/schema/DetailRelationshipsModel.java new file mode 100644 index 0000000000..94a7e96121 --- /dev/null +++ b/gencode/java/udmi/schema/DetailRelationshipsModel.java @@ -0,0 +1,52 @@ + +package udmi.schema; + +import java.util.Set; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyDescription; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + + +/** + * Detail Relationships Model + *

+ * Information for modeling noun-verb-noun relationships between devices + * + */ +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonPropertyOrder({ + "tags" +}) +public class DetailRelationshipsModel { + + /** + * Tags associated with the device + * + */ + @JsonProperty("tags") + @JsonDeserialize(as = java.util.LinkedHashSet.class) + @JsonPropertyDescription("Tags associated with the device") + public Set tags; + + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.tags == null)? 0 :this.tags.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof DetailRelationshipsModel) == false) { + return false; + } + DetailRelationshipsModel rhs = ((DetailRelationshipsModel) other); + return ((this.tags == rhs.tags)||((this.tags!= null)&&this.tags.equals(rhs.tags))); + } + +} diff --git a/gencode/java/udmi/schema/Metadata.java b/gencode/java/udmi/schema/Metadata.java index 5d022c96f0..6005a89d72 100644 --- a/gencode/java/udmi/schema/Metadata.java +++ b/gencode/java/udmi/schema/Metadata.java @@ -3,6 +3,7 @@ import java.util.Date; import java.util.HashMap; +import java.util.List; import java.util.Map; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -28,6 +29,7 @@ "externals", "gateway", "discovery", + "relationships", "localnet", "testing", "features", @@ -120,6 +122,15 @@ public class Metadata { @JsonProperty("discovery") @JsonPropertyDescription("Discovery target parameters") public DiscoveryModel discovery; + /** + * Relationships Model + *

+ * Information for modeling noun-verb-noun relationships between devices + * + */ + @JsonProperty("relationships") + @JsonPropertyDescription("Information for modeling noun-verb-noun relationships between devices") + public Map>> relationships; /** * Localnet Model *

@@ -166,6 +177,7 @@ public int hashCode() { result = ((result* 31)+((this.version == null)? 0 :this.version.hashCode())); result = ((result* 31)+((this.structure == null)? 0 :this.structure.hashCode())); result = ((result* 31)+((this.cloud == null)? 0 :this.cloud.hashCode())); + result = ((result* 31)+((this.relationships == null)? 0 :this.relationships.hashCode())); result = ((result* 31)+((this.features == null)? 0 :this.features.hashCode())); result = ((result* 31)+((this.system == null)? 0 :this.system.hashCode())); result = ((result* 31)+((this.discovery == null)? 0 :this.discovery.hashCode())); @@ -189,7 +201,7 @@ public boolean equals(Object other) { return false; } Metadata rhs = ((Metadata) other); - return ((((((((((((((((this.testing == rhs.testing)||((this.testing!= null)&&this.testing.equals(rhs.testing)))&&((this.version == rhs.version)||((this.version!= null)&&this.version.equals(rhs.version))))&&((this.structure == rhs.structure)||((this.structure!= null)&&this.structure.equals(rhs.structure))))&&((this.cloud == rhs.cloud)||((this.cloud!= null)&&this.cloud.equals(rhs.cloud))))&&((this.features == rhs.features)||((this.features!= null)&&this.features.equals(rhs.features))))&&((this.system == rhs.system)||((this.system!= null)&&this.system.equals(rhs.system))))&&((this.discovery == rhs.discovery)||((this.discovery!= null)&&this.discovery.equals(rhs.discovery))))&&((this.upgraded_from == rhs.upgraded_from)||((this.upgraded_from!= null)&&this.upgraded_from.equals(rhs.upgraded_from))))&&((this.pointset == rhs.pointset)||((this.pointset!= null)&&this.pointset.equals(rhs.pointset))))&&((this.externals == rhs.externals)||((this.externals!= null)&&this.externals.equals(rhs.externals))))&&((this.operation == rhs.operation)||((this.operation!= null)&&this.operation.equals(rhs.operation))))&&((this.hash == rhs.hash)||((this.hash!= null)&&this.hash.equals(rhs.hash))))&&((this.gateway == rhs.gateway)||((this.gateway!= null)&&this.gateway.equals(rhs.gateway))))&&((this.localnet == rhs.localnet)||((this.localnet!= null)&&this.localnet.equals(rhs.localnet))))&&((this.timestamp == rhs.timestamp)||((this.timestamp!= null)&&this.timestamp.equals(rhs.timestamp)))); + return (((((((((((((((((this.testing == rhs.testing)||((this.testing!= null)&&this.testing.equals(rhs.testing)))&&((this.version == rhs.version)||((this.version!= null)&&this.version.equals(rhs.version))))&&((this.structure == rhs.structure)||((this.structure!= null)&&this.structure.equals(rhs.structure))))&&((this.cloud == rhs.cloud)||((this.cloud!= null)&&this.cloud.equals(rhs.cloud))))&&((this.relationships == rhs.relationships)||((this.relationships!= null)&&this.relationships.equals(rhs.relationships))))&&((this.features == rhs.features)||((this.features!= null)&&this.features.equals(rhs.features))))&&((this.system == rhs.system)||((this.system!= null)&&this.system.equals(rhs.system))))&&((this.discovery == rhs.discovery)||((this.discovery!= null)&&this.discovery.equals(rhs.discovery))))&&((this.upgraded_from == rhs.upgraded_from)||((this.upgraded_from!= null)&&this.upgraded_from.equals(rhs.upgraded_from))))&&((this.pointset == rhs.pointset)||((this.pointset!= null)&&this.pointset.equals(rhs.pointset))))&&((this.externals == rhs.externals)||((this.externals!= null)&&this.externals.equals(rhs.externals))))&&((this.operation == rhs.operation)||((this.operation!= null)&&this.operation.equals(rhs.operation))))&&((this.hash == rhs.hash)||((this.hash!= null)&&this.hash.equals(rhs.hash))))&&((this.gateway == rhs.gateway)||((this.gateway!= null)&&this.gateway.equals(rhs.gateway))))&&((this.localnet == rhs.localnet)||((this.localnet!= null)&&this.localnet.equals(rhs.localnet))))&&((this.timestamp == rhs.timestamp)||((this.timestamp!= null)&&this.timestamp.equals(rhs.timestamp)))); } } diff --git a/gencode/java/udmi/schema/SystemModel.java b/gencode/java/udmi/schema/SystemModel.java index 7800ca5e33..3d1234b205 100644 --- a/gencode/java/udmi/schema/SystemModel.java +++ b/gencode/java/udmi/schema/SystemModel.java @@ -77,7 +77,7 @@ public class SystemModel { @JsonProperty("tags") @JsonDeserialize(as = java.util.LinkedHashSet.class) @JsonPropertyDescription("Tags associated with the device") - public Set tags; + public Set tags; /** * Properties of the expected physical location of the device * diff --git a/gencode/python/dist/udmi_schema-0.1.0-py3-none-any.whl b/gencode/python/dist/udmi_schema-0.1.0-py3-none-any.whl index 97f18d7fd4..c5f6d3e1ea 100644 Binary files a/gencode/python/dist/udmi_schema-0.1.0-py3-none-any.whl and b/gencode/python/dist/udmi_schema-0.1.0-py3-none-any.whl differ diff --git a/gencode/python/dist/udmi_schema-0.1.0.tar.gz b/gencode/python/dist/udmi_schema-0.1.0.tar.gz index ba9035bbb9..e5296102e3 100644 Binary files a/gencode/python/dist/udmi_schema-0.1.0.tar.gz and b/gencode/python/dist/udmi_schema-0.1.0.tar.gz differ diff --git a/gencode/python/udmi/schema/__init__.py b/gencode/python/udmi/schema/__init__.py index ced506c690..fcd00c0f56 100644 --- a/gencode/python/udmi/schema/__init__.py +++ b/gencode/python/udmi/schema/__init__.py @@ -60,6 +60,8 @@ from .model_localnet_family import * from .model_pointset import * from .model_pointset_point import * +from .model_relationships import * +from .model_relationships_detail import * from .model_system import * from .model_system_hardware import * from .model_testing import * diff --git a/gencode/python/udmi/schema/metadata.py b/gencode/python/udmi/schema/metadata.py index 81c7a33073..bb07f9dbec 100644 --- a/gencode/python/udmi/schema/metadata.py +++ b/gencode/python/udmi/schema/metadata.py @@ -16,6 +16,7 @@ from .model_gateway import GatewayModel from .model_localnet import LocalnetModel from .model_pointset import PointsetModel +from .model_relationships import RelationshipsModel from .model_system import SystemModel from .model_testing import TestingModel @@ -36,6 +37,7 @@ class Metadata(DataModel): externals: Optional[ExternalsModel] = None gateway: Optional[GatewayModel] = None discovery: Optional[DiscoveryModel] = None + relationships: Optional[RelationshipsModel] = None localnet: Optional[LocalnetModel] = None testing: Optional[TestingModel] = None features: Optional[TestingModel_1] = None diff --git a/gencode/python/udmi/schema/model_relationships.py b/gencode/python/udmi/schema/model_relationships.py new file mode 100644 index 0000000000..174e550e28 --- /dev/null +++ b/gencode/python/udmi/schema/model_relationships.py @@ -0,0 +1,11 @@ +# generated by datamodel-codegen: +# filename: model_relationships.json + +from __future__ import annotations + +from typing import Dict, List, Optional + +from ._base import DataModel +from .model_relationships_detail import DetailRelationshipsModel + +RelationshipsModel = Optional[Dict[str, Dict[str, List[DetailRelationshipsModel]]]] diff --git a/gencode/python/udmi/schema/model_relationships_detail.py b/gencode/python/udmi/schema/model_relationships_detail.py new file mode 100644 index 0000000000..12d798f7cb --- /dev/null +++ b/gencode/python/udmi/schema/model_relationships_detail.py @@ -0,0 +1,20 @@ +# generated by datamodel-codegen: +# filename: model_relationships_detail.json + +from __future__ import annotations + +from dataclasses import dataclass +from typing import List, Optional + +from ._base import DataModel + +Tag = Optional[str] + + +@dataclass +class DetailRelationshipsModel(DataModel): + """ + Information for modeling noun-verb-noun relationships between devices + """ + + tags: Optional[List[Tag]] = None diff --git a/gencode/python/udmi/schema/model_system.py b/gencode/python/udmi/schema/model_system.py index 5de71d1f54..7e5e32bfcd 100644 --- a/gencode/python/udmi/schema/model_system.py +++ b/gencode/python/udmi/schema/model_system.py @@ -4,12 +4,12 @@ from __future__ import annotations from dataclasses import dataclass -from typing import Any, Dict, List, Optional +from typing import Dict, List, Optional from ._base import DataModel from .model_system_hardware import SystemHardware -Tag = Optional[Any] +Tag = Optional[str] @dataclass diff --git a/schema/metadata.json b/schema/metadata.json index c9190e5a29..8485d0e6fb 100644 --- a/schema/metadata.json +++ b/schema/metadata.json @@ -59,6 +59,9 @@ "discovery": { "$ref": "file:model_discovery.json#" }, + "relationships": { + "$ref": "file:model_relationships.json#" + }, "localnet": { "$ref": "file:model_localnet.json#", "$presentation": { diff --git a/schema/model_relationships.json b/schema/model_relationships.json new file mode 100644 index 0000000000..a2b2e29329 --- /dev/null +++ b/schema/model_relationships.json @@ -0,0 +1,23 @@ +{ + "$udmi_version": "1.5.3", + "title": "Relationships Model", + "description": "Information for modeling noun-verb-noun relationships between devices", + "type": "object", + "$schema": "http://json-schema.org/draft-07/schema#", + "additionalProperties": false, + "existingJavaType": "java.util.Map>>", + "patternProperties": { + "^[A-Z]{2,6}-[1-9][0-9]*$": { + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^[a-z]+$": { + "type": "array", + "items": { + "$ref": "file:model_relationships_detail.json" + } + } + } + } + } +} diff --git a/schema/model_relationships_detail.json b/schema/model_relationships_detail.json new file mode 100644 index 0000000000..7eb4296ef6 --- /dev/null +++ b/schema/model_relationships_detail.json @@ -0,0 +1,24 @@ +{ + "$udmi_version": "1.5.3", + "title": "Detail Relationships Model", + "description": "Information for modeling noun-verb-noun relationships between devices", + "$schema": "http://json-schema.org/draft-07/schema#", + "type": "object", + "additionalProperties": false, + "properties": { + "tags":{ + "description": "Tags associated with the device", + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "pattern": "^[a-z][_a-z0-9]+$" + }, + "examples": [["lighting"], ["energy", "building", "vendor_managed"]], + "$presentation": { + "display": "show", + "style": "bold" + } + } + } +} diff --git a/schema/model_system.json b/schema/model_system.json index 587e9e3cee..89df3be4c6 100644 --- a/schema/model_system.json +++ b/schema/model_system.json @@ -56,6 +56,7 @@ "type": "array", "uniqueItems": true, "items": { + "type": "string", "pattern": "^[a-z][_a-z0-9]+$" }, "examples": [["lighting"], ["energy", "building", "vendor_managed"]], diff --git a/tests/sites/basic/devices/SNS-4/expected/metadata_norm.json b/tests/sites/basic/devices/SNS-4/expected/metadata_norm.json index d1872bbd5e..f2bdb81896 100644 --- a/tests/sites/basic/devices/SNS-4/expected/metadata_norm.json +++ b/tests/sites/basic/devices/SNS-4/expected/metadata_norm.json @@ -30,6 +30,23 @@ }, "sample_rate_sec": 30 }, + "relationships": { + "AHU-1": { + "feeds": [ + {} + ] + }, + "AHU-22": {}, + "SNS-4": { + "contains": [ + { + "tags": [ + "daily" + ] + } + ] + } + }, "system": { "location": { "section": "2-3N8C", diff --git a/tests/sites/basic/devices/SNS-4/metadata.json b/tests/sites/basic/devices/SNS-4/metadata.json index ecd2f5324b..667d543041 100644 --- a/tests/sites/basic/devices/SNS-4/metadata.json +++ b/tests/sites/basic/devices/SNS-4/metadata.json @@ -22,6 +22,11 @@ } } }, + "relationships": { + "AHU-1": { "feeds": [{}] }, + "AHU-22": { }, + "SNS-4": { "contains": [{ "tags": ["daily"] }] } + }, "externals": { "dbo": { "ext_id": "0060917f-8c21-47c4-b011-52521085fdc3", diff --git a/tests/sites/downgrade/devices/DWN-2/expected/errors.map b/tests/sites/downgrade/devices/DWN-2/expected/errors.map index 92cadf5eb3..1e7eb5cc6b 100644 --- a/tests/sites/downgrade/devices/DWN-2/expected/errors.map +++ b/tests/sites/downgrade/devices/DWN-2/expected/errors.map @@ -2,4 +2,4 @@ Exceptions for DWN-2 While loading device metadata for DWN-2 While converting strict to udmi.schema.Metadata While converting string/string to udmi.schema.Metadata - Unrecognized field "grumpy" (class udmi.schema.Metadata), not marked as ignorable (15 known properties: "upgraded_from", "gateway", "operation", "externals", "hash", "system", "discovery", "localnet", "structure", "cloud", "timestamp", "version", "features", "testing", "pointset"]) at [Source: (String)"{ "cloud" : { "auth_type" : "RS256" }, "grumpy" : { "reason" : "This is an intentional schema violation to test the tools" }, "hash" : "da852d15", "localnet" : { "families" : { "vendor" : { "addr" : "0x65" } } }, "pointset" : { "exclude_units_from_config" : true, "points" : { "filter_alarm_pressure_status" : { "ref" : "BV11.present_value", "units" : "No-units" }, "filter_differential_pressure" : { "[truncated 667 chars]; line: 5, column: 15] (through reference chain: udmi.schema.Metadata["grumpy"]) + Unrecognized field "grumpy" (class udmi.schema.Metadata), not marked as ignorable (16 known properties: "upgraded_from", "gateway", "operation", "externals", "hash", "system", "discovery", "localnet", "structure", "cloud", "timestamp", "version", "relationships", "features", "testing", "pointset"]) at [Source: (String)"{ "cloud" : { "auth_type" : "RS256" }, "grumpy" : { "reason" : "This is an intentional schema violation to test the tools" }, "hash" : "da852d15", "localnet" : { "families" : { "vendor" : { "addr" : "0x65" } } }, "pointset" : { "exclude_units_from_config" : true, "points" : { "filter_alarm_pressure_status" : { "ref" : "BV11.present_value", "units" : "No-units" }, "filter_differential_pressure" : { "[truncated 667 chars]; line: 5, column: 15] (through reference chain: udmi.schema.Metadata["grumpy"])