one-data-model / language

(Old repo:) Simple Definition Format (SDF) for One Data Model definitions
7 stars 4 forks source link

Need ODM Syntax to Cover Mutability / Writability of Properties #53

Open gerickson opened 5 years ago

gerickson commented 5 years ago

In Weave Data Language (WDL), properties may be decorated with an annotation to indicate from publishers their mutability or writability to subscribers.

To be expressed in ODM SDF losslessly, a syntax construct for representing mutability/writability is required.

Relevant Example Schema Input Files

Missing or Unmapped WDL-to-ODM SDF Syntax

Example Input WDL

message PowerSourceCapabilitiesTrait {
        option (wdl.message_type) = TRAIT;

        option (wdl.trait) = {
          stability: PROD,
                vendor_id: 0x0000,
                id:        0x0018,
                version:   1
        };

        // ----------- PROPERTIES ----------- //

        option (wdl.properties) = {
                writable: READ_ONLY,
                variability: STATIC,
                extendable: true,
                reserved_tag_min: 1,
                reserved_tag_max: 31
        };

        PowerSourceType         type              = 1;

        weave.common.StringRef  description       = 2 [(wdl.prop) = { string_constraints: { max_length: 32 },
                                                                      optional: true,
                                                                      nullable: true}];

        float                  nominal_voltage    = 3 [(wdl.prop) = { quantity_type: VOLTAGE,
                                                                      number_constraints: { min: 0.0, max: 700.0,
                                                                      precision: 0.001,
                                                                      fixed_encoding_width: 32 }},
                                                       (wdl.tlv)  = { encoding: FIXED } ];

        float                   maximum_current   = 4 [(wdl.prop) = { optional: true,
                                                                      nullable: true,
                                                                      quantity_type: CURRENT,
                                                                      number_constraints: { min: 0.0, max: 1000.0,
                                                                      precision: 0.001,
                                                                      fixed_encoding_width: 32 }},
                                                       (wdl.tlv)  = { encoding: FIXED } ];

        PowerSourceCurrentType  current_type      = 5;

        uint32                  order             = 6;

        bool                    removable         = 7;
}
mjkoster commented 5 years ago

We have ReadOnly and WriteOnly See issue #39 where "readable" and "writeable" are proposed

asoloway64 commented 5 years ago

F2F4: Agreed to have "readable" and "writeable" as separate qualities.