Open dmocek opened 2 months ago
The datatype is 'Schema', whether it is inlined or referred to indirectly. You can see the schema type in the JSON-LD metamodel definition of DTDL v3 Telemetry, wherein the relevant parts are:
{
"@id": "dtmi:dtdl:class:Telemetry;3",
"sh:property": [
{
"sh:path": "dtmi:dtdl:property:schema;3",
"sh:or": [
{ "sh:class": "dtmi:dtdl:class:Schema;3" },
{ "sh:class": "dtmi:dtdl:class:Schema;2" }
]
}
]
}
You can also see in the DTDL Parser code that the Schema
property on the DTTelemetryInfo
class has type DTSchemaInfo
.
What is the data type for a 'schema' value when the value is a DTMI reference to an Interface schema? For example, in the DTDL v3 Spec, there is this example:
Per the spec, the schema for accelerometer1 is supposed to be of a data type 'Schema' and indeed it references the Interface schema 'Object' complex schema described below it. However, the data type of the value in this property:
is not a Primitive Schema nor a Complex Schema, but a DTMI reference to the Interface schema 'Object' complex schema. In the 'Complex Schema' section of the DTDL spec it states: "A complex schema can be specified directly as the value of a schema property or described in the Interface schemas set and referenced in a schema property.". What is the data type when "the complex schema is referenced in a schema property"? It seems to me that in the spec, the data type for "schema" should be either a 'Schema' (as already specified) or 'DTMI' (when it's a reference) which is a reference to an Interface schema.