Skip to content

Commit c9395b5

Browse files
committed
Replace usages of sdfContext with sdfProperty
1 parent 0e6d091 commit c9395b5

1 file changed

Lines changed: 39 additions & 36 deletions

File tree

draft-ietf-asdf-instance-information.md

Lines changed: 39 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -323,9 +323,7 @@ Messages may have to be complemented by this context for
323323
interpretation, i.e., the context needed may need to be reified in the
324324
message (compare the use of SenML "n").
325325
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.
329327

330328
TODO: explain how {{RFC9039}} could be used to obtain device names (using `urn:dev:org` in the example).
331329

@@ -403,7 +401,6 @@ Note that we also have to replicate a nested structure via `sdfThing` and/or `sd
403401
| thingId | string | (Optional) identifier of the instance (e.g., a UUID) |
404402
| sdfThing | map | Values for the thing entries in the referenced SDF definition |
405403
| 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 |
407404
| sdfProperty | map | Values for the properties in the referenced SDF definition |
408405
| sdfAction | map | Values for the actions in the referenced SDF definition |
409406
| 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
427424
In practical use, we can at least differentiate two use cases for snapshot messages.
428425
The corresponding message variants are (colloquially) referred to as "Context Snapshots" and "Proofshots".
429426

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).
431428
{{example-context}} gives an example for this kind of instance-related message.
432429

433430
~~~ sdf
@@ -442,7 +439,7 @@ sdfInstanceOf:
442439
model: sensors:#/sdfObject/envSensor
443440
sdfInstance:
444441
thingId: envSensor:abc123
445-
sdfContext:
442+
sdfProperty:
446443
installationInfo:
447444
floor: 3
448445
mountType: ceiling
@@ -475,10 +472,9 @@ sdfInstanceOf:
475472
model: sensors:#/sdfObject/envSensor
476473
sdfInstance:
477474
thingId: envSensor:abc123
478-
sdfContext:
475+
sdfProperty:
479476
installationInfo:
480477
mountType: ceiling
481-
sdfProperty:
482478
temperature: 23.124
483479

484480
~~~
@@ -516,7 +512,7 @@ sdfInstanceOf:
516512
model: sensors:#/sdfObject/envSensor
517513
sdfInstance:
518514
thingId: envSensor:unit42
519-
sdfContext:
515+
sdfProperty:
520516
ipAddress: 192.168.1.5
521517
unit: Cel
522518
deviceIdentity:
@@ -531,7 +527,7 @@ A special type of construction message that only contains identity-related infor
531527

532528
<!-- TODO: Evaluate whether this approach actually works -->
533529
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.
535531

536532
~~~ sdf
537533
info:
@@ -544,7 +540,7 @@ sdfInstanceOf:
544540
model: sensors:#/sdfObject/envSensor
545541
sdfInstance:
546542
thingId: envSensor:unit42
547-
sdfContext:
543+
sdfProperty:
548544
deviceIdentity:
549545
manufacturer: HealthTech Inc.
550546
firmwareVersion: 1.4.3
@@ -604,7 +600,7 @@ sdfInstanceOf:
604600
model: sensors:#/sdfObject/envSensor
605601
patchMethod: merge-patch
606602
sdfInstance:
607-
sdfContext:
603+
sdfProperty:
608604
installationInfo:
609605
mountType: wall
610606
~~~
@@ -620,9 +616,11 @@ Other specifications may define additional use cases instance-related messages c
620616

621617
## Construction
622618

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.
624620
{{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.
626624

627625
~~~ sdf
628626
namespace:
@@ -634,32 +632,33 @@ sdfObject:
634632
sdfRequired:
635633
- ipAddress
636634
- deviceIdentity
637-
sdfContext:
635+
sdfProperty:
638636
ipAddress:
637+
writable: false
639638
type: string
640639
unit:
640+
writable: false
641641
type: string
642+
default: Cel
642643
deviceIdentity:
644+
writable: false
643645
type: object
644646
properties:
645647
manufacturer:
646648
type: string
647649
firmwareVersion:
648650
type: string
649-
sdfProperty:
650651
temperature:
651652
type: number
652653
sdfParameters:
653-
unit: "#/sdfObject/sensor/sdfContext/unit"
654-
sdfRequired:
655-
- "#/sdfObject/sensor/sdfContext/unit"
654+
unit: "#/sdfObject/sensor/sdfProperty/unit"
656655
~~~
657656
{:sdf #code-sdf-construction-sdf-context
658657
title="Example for SDF model with constructors"}
659658

660659
Based on the SDF model above, a Construction Message such as the one shown in {{code-sdf-construction-message}} can trigger a construction process.
661660
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.
663662

664663
## Protocol Binding Information
665664

@@ -671,7 +670,7 @@ Therefore, we can utilize context information that varies between instances to c
671670

672671
{{code-sdf-protocol-map-plus-context}} illustrates the potential relationship between the two concepts in an SDF model.
673672
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.
675674

676675
~~~ sdf
677676
namespace:
@@ -680,16 +679,18 @@ namespace:
680679
defaultNamespace: models
681680
sdfObject:
682681
sensor:
683-
sdfContext:
682+
sdfRequired:
683+
- ipAddress
684+
sdfProperty:
684685
ipAddress:
686+
writable: false
685687
type: string
686-
sdfProperty:
687688
temperature:
688689
type: number
689690
sdfProtocolMap:
690691
coap:
691692
sdfParameters:
692-
ipAddress: "#/sdfObject/sensor/sdfContext/ipAddress"
693+
ipAddress: "#/sdfObject/sensor/sdfProperty/ipAddress"
693694
read:
694695
method: GET
695696
href: "/temperature"
@@ -698,7 +699,7 @@ sdfObject:
698699
{:sdf #code-sdf-protocol-map-plus-context
699700
title="Example of an SDF model where a CoAP-based protocol map points to the definition of relevant context information: an IP address."}
700701

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.
702703

703704
~~~ sdf
704705
info:
@@ -710,18 +711,18 @@ defaultNamespace: models
710711
sdfInstanceOf:
711712
model: sensors:#/sdfObject/sensor
712713
sdfInstance:
713-
sdfContext:
714+
sdfProperty:
714715
ipAddress: 192.168.1.5
715716
~~~
716717
{:sdf #code-sdf-ipaddress-context
717718
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."}
718719

719720
## Modelling the State of Interaction Affordances
720721

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}}.
723724

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.
725726
For events, a history is reported that includes the returned values.
726727
The exact of number of action and event reports is implementation-dependent and may vary between deployments.
727728

@@ -803,13 +804,17 @@ namespace:
803804
defaultNamespace: models
804805
sdfObject:
805806
envSensor:
806-
sdfContext:
807+
sdfProperty:
807808
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
812816
installationInfo:
817+
writable: false
813818
type: object
814819
properties:
815820
floor:
@@ -818,11 +823,9 @@ sdfObject:
818823
enum:
819824
- ceiling
820825
- wall
821-
sdfProperty:
822826
temperature:
823827
type: number
824828
unit: Cel
825-
826829
~~~
827830
{:sdf #code-off-device-model
828831
title="SDF Model that serves as a reference point for the instance-related messages in this draft"}

0 commit comments

Comments
 (0)