You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: draft-ietf-asdf-instance-information.md
+39-36Lines changed: 39 additions & 36 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -323,9 +323,7 @@ Messages may have to be complemented by this context for
323
323
interpretation, i.e., the context needed may need to be reified in the
324
324
message (compare the use of SenML "n").
325
325
Information that enables interactions via application-layer protocols (such as an IP address) can also be considered context information.
326
-
327
-
For this purpose, we are using the `sdfContext` keyword introduced by {{-non-affordance}}.
328
-
Note that `sdfContext` *could* also be modelled via `sdfProperty`.
326
+
For this purpose, the `sdfProperty` quality is reused.
329
327
330
328
TODO: explain how {{RFC9039}} could be used to obtain device names (using `urn:dev:org` in the example).
331
329
@@ -403,7 +401,6 @@ Note that we also have to replicate a nested structure via `sdfThing` and/or `sd
403
401
| thingId | string | (Optional) identifier of the instance (e.g., a UUID) |
404
402
| sdfThing | map | Values for the thing entries in the referenced SDF definition |
405
403
| sdfObject | map | Values for the object entries in the referenced SDF definition |
406
-
| sdfContext | map | Values for the context entries in the referenced SDF definition |
407
404
| sdfProperty | map | Values for the properties in the referenced SDF definition |
408
405
| sdfAction | map | Values for the actions in the referenced SDF definition |
409
406
| sdfEvent | map | Values for the events in the referenced SDF definition |
@@ -427,7 +424,7 @@ Security-related aspects, e.g. regarding authentication and authorization, MUST
427
424
In practical use, we can at least differentiate two use cases for snapshot messages.
428
425
The corresponding message variants are (colloquially) referred to as "Context Snapshots" and "Proofshots".
429
426
430
-
Context Snapshots *only* contain context information related to a Thing (indicated via the `sdfContext` quality).
427
+
Context Snapshots *only* contain context information related to a Thing (indicated via non-writable `sdfPropety` definitions).
431
428
{{example-context}} gives an example for this kind of instance-related message.
432
429
433
430
~~~ sdf
@@ -442,7 +439,7 @@ sdfInstanceOf:
442
439
model: sensors:#/sdfObject/envSensor
443
440
sdfInstance:
444
441
thingId: envSensor:abc123
445
-
sdfContext:
442
+
sdfProperty:
446
443
installationInfo:
447
444
floor: 3
448
445
mountType: ceiling
@@ -475,10 +472,9 @@ sdfInstanceOf:
475
472
model: sensors:#/sdfObject/envSensor
476
473
sdfInstance:
477
474
thingId: envSensor:abc123
478
-
sdfContext:
475
+
sdfProperty:
479
476
installationInfo:
480
477
mountType: ceiling
481
-
sdfProperty:
482
478
temperature: 23.124
483
479
484
480
~~~
@@ -516,7 +512,7 @@ sdfInstanceOf:
516
512
model: sensors:#/sdfObject/envSensor
517
513
sdfInstance:
518
514
thingId: envSensor:unit42
519
-
sdfContext:
515
+
sdfProperty:
520
516
ipAddress: 192.168.1.5
521
517
unit: Cel
522
518
deviceIdentity:
@@ -531,7 +527,7 @@ A special type of construction message that only contains identity-related infor
531
527
532
528
<!-- TODO: Evaluate whether this approach actually works -->
533
529
Via `sdfRequired`, an SDF model can indicate which context information must be present and therefore initialized within an instance.
534
-
All definitions included in `sdfRequired` MUST also be present in a construction message, while other `sdfContext` definitions could be left out.
530
+
All definitions included in `sdfRequired` MUST also be present in a construction message, while definitions could be left out.
535
531
536
532
~~~ sdf
537
533
info:
@@ -544,7 +540,7 @@ sdfInstanceOf:
544
540
model: sensors:#/sdfObject/envSensor
545
541
sdfInstance:
546
542
thingId: envSensor:unit42
547
-
sdfContext:
543
+
sdfProperty:
548
544
deviceIdentity:
549
545
manufacturer: HealthTech Inc.
550
546
firmwareVersion: 1.4.3
@@ -604,7 +600,7 @@ sdfInstanceOf:
604
600
model: sensors:#/sdfObject/envSensor
605
601
patchMethod: merge-patch
606
602
sdfInstance:
607
-
sdfContext:
603
+
sdfProperty:
608
604
installationInfo:
609
605
mountType: wall
610
606
~~~
@@ -620,9 +616,11 @@ Other specifications may define additional use cases instance-related messages c
620
616
621
617
## Construction
622
618
623
-
In SDF models, we can speicify a Thing's configurable parameters via `sdfContext` definitions for which Construction Messages can provide concrete values.
619
+
In SDF models, we can specify a Thing's configurable parameters via `sdfProperty` definitions for which Construction Messages can provide concrete values.
624
620
{{code-sdf-construction-sdf-context}} shows an example for such an SDF model.
625
-
The parameters settable during construction (in this case: the `temperature` property's `unit`) are modeled as `sdfContext` definitions, to which the entries of the `sdfParameters` map may point to using JSON pointers.
621
+
In this example, the `unit` quality of the `temperature` property has to be considered a construction parameter, as a connection to the `unit` property is established via the `sdfParameters` map using a JSON Pointer.
622
+
623
+
If the `unit` is not initialized during construction, it falls back to the default `Cel` for degrees Celcius.
626
624
627
625
~~~ sdf
628
626
namespace:
@@ -634,32 +632,33 @@ sdfObject:
634
632
sdfRequired:
635
633
- ipAddress
636
634
- deviceIdentity
637
-
sdfContext:
635
+
sdfProperty:
638
636
ipAddress:
637
+
writable: false
639
638
type: string
640
639
unit:
640
+
writable: false
641
641
type: string
642
+
default: Cel
642
643
deviceIdentity:
644
+
writable: false
643
645
type: object
644
646
properties:
645
647
manufacturer:
646
648
type: string
647
649
firmwareVersion:
648
650
type: string
649
-
sdfProperty:
650
651
temperature:
651
652
type: number
652
653
sdfParameters:
653
-
unit: "#/sdfObject/sensor/sdfContext/unit"
654
-
sdfRequired:
655
-
- "#/sdfObject/sensor/sdfContext/unit"
654
+
unit: "#/sdfObject/sensor/sdfProperty/unit"
656
655
~~~
657
656
{:sdf #code-sdf-construction-sdf-context
658
657
title="Example for SDF model with constructors"}
659
658
660
659
Based on the SDF model above, a Construction Message such as the one shown in {{code-sdf-construction-message}} can trigger a construction process.
661
660
As indicated via `sdfRequired`, this process must include the initialization of an IP address as well as the device's identity definitions.
662
-
In the example model, initializing the `unit` context definition is only required if the `temperature` property is present, which is expressed by the JSON pointer within the property's `sdfRequired` definition.
661
+
Initializing the `unit` quality is only required if the `temperature` property is present, which is expressed by the JSON pointer within the property's `sdfRequired` definition.
663
662
664
663
## Protocol Binding Information
665
664
@@ -671,7 +670,7 @@ Therefore, we can utilize context information that varies between instances to c
671
670
672
671
{{code-sdf-protocol-map-plus-context}} illustrates the potential relationship between the two concepts in an SDF model.
673
672
Here, a (hypothetical) CoAP protocol mapping specification defines an interface for parameters such as an IP address.
674
-
Via JSON pointers, the `sdfParameters` within the `sdfProtocolMap` are linked to compatible `sdfContext` entries that may further restrict the set of allowed values via their schema definitions.
673
+
Via JSON pointers, the `sdfParameters` within the `sdfProtocolMap` are linked to compatible `sdfProperty` definitions that may further restrict the set of allowed values via their schema.
title="Example of an SDF model where a CoAP-based protocol map points to the definition of relevant context information: an IP address."}
700
701
701
-
{{code-sdf-ipaddress-context}} shows how a Snapshot Message can provide the necessary IP address that is needed for retrieving the temperature value from the sensor described by the SDF model above.
702
+
{{code-sdf-ipaddress-context}} shows how a Snapshot Message can report the necessary IP address that is needed for retrieving the temperature value from the sensor described by the SDF model above.
702
703
703
704
~~~ sdf
704
705
info:
@@ -710,18 +711,18 @@ defaultNamespace: models
710
711
sdfInstanceOf:
711
712
model: sensors:#/sdfObject/sensor
712
713
sdfInstance:
713
-
sdfContext:
714
+
sdfProperty:
714
715
ipAddress: 192.168.1.5
715
716
~~~
716
717
{:sdf #code-sdf-ipaddress-context
717
718
title="Example of a snapshot message that provides the IP address needed to perform a CoAP-based interaction with the sensor from the previous figure."}
718
719
719
720
## Modelling the State of Interaction Affordances
720
721
721
-
Besides context information, Snapshot and (in a relative fashion) Delta Messages can report the current state associated with interaction affordances.
722
-
For `sdfProperty` definitions, this is very similar to context information and very straightforward, as previously seen in in {{code-sdf-delta-message}}.
722
+
Snapshot and (in a relative fashion) Delta Messages can report the current state associated with interaction affordances.
723
+
For `sdfProperty` definitions, this is very straightforward, as previously seen in in {{code-sdf-delta-message}}.
723
724
724
-
Actions and events, however, are handled differently: In the case of actions, the state of one or more actions is reported, which might already be in a completed or error state, or may also still be running.
725
+
Actions and events, however, need to be handled differently: In the case of actions, the state of one or more actions is reported, which might already be in a completed or error state, or may also still be running.
725
726
For events, a history is reported that includes the returned values.
726
727
The exact of number of action and event reports is implementation-dependent and may vary between deployments.
727
728
@@ -803,13 +804,17 @@ namespace:
803
804
defaultNamespace: models
804
805
sdfObject:
805
806
envSensor:
806
-
sdfContext:
807
+
sdfProperty:
807
808
deviceIdentity:
808
-
manufacturer:
809
-
type: string
810
-
firmwareVersion:
811
-
type: string
809
+
writable: false
810
+
type: object
811
+
properties:
812
+
manufacturer:
813
+
type: string
814
+
firmwareVersion:
815
+
type: string
812
816
installationInfo:
817
+
writable: false
813
818
type: object
814
819
properties:
815
820
floor:
@@ -818,11 +823,9 @@ sdfObject:
818
823
enum:
819
824
- ceiling
820
825
- wall
821
-
sdfProperty:
822
826
temperature:
823
827
type: number
824
828
unit: Cel
825
-
826
829
~~~
827
830
{:sdf #code-off-device-model
828
831
title="SDF Model that serves as a reference point for the instance-related messages in this draft"}
0 commit comments