one-data-model / language

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

Need ODM SDF Syntax to Cover Event Importance #46

Open gerickson opened 5 years ago

gerickson commented 5 years ago

In Weave Data Language (WDL), events may be tagged with an importance to help prioritize buffering and retention through various nodes and actors in the network and ecosystem. To be expressed in ODM SDF losslessly, a syntax construct for representing event importance is needed.

Relevant Example Schema Input Files

Missing or Unmapped WDL-to-ODM SDF Syntax

Example Input WDL

message BatteryChangedEvent {
    option (wdl.message_type) = EVENT;

    option (wdl.event) = {
        Id:               1,
        event_importance: EVENT_IMPORTANCE_PRODUCTION_STANDARD,
        extends:          "weave.trait.power.PowerSourceTrait.PowerSourceChangedEvent",
        extendable:       true,
        reserved_tag_min: 16,
        reserved_tag_max: 31
    };

    // SUPER PROPERTIES

    weave.trait.power.PowerSourceTrait.PowerSourceCondition  condition              =  1;
    weave.trait.power.PowerSourceTrait.PowerSourceStatus     status                 =  2;

    // EXTENDED PROPERTIES

    BatteryReplacementIndicator                              replacement_indicator  = 16;
    BatteryRemaining                                         remaining              = 17;
}

Example Output ODM SDF

"odmEvent" : {
    "BatteryChangedEvent" : {
        "odmProperty" : {
            "condition" : {
                "description" : "TBD",
                "name"        : "condition",
                "type"        : {
                    "$ref" : "#/odmData/weave.trait.power.PowerSourceTrait.PowerSourceCondition"
                },
                "id"          : 1,
                "optional"    : false,
                "nullable"    : false
            }
        },
        "odmProperty" : {
            "status" : {
                "description" : "TBD",
                "name"        : "status",
                "type"        : {
                    "$ref" : "#/odmData/weave.trait.power.PowerSourceTrait.PowerSourceStatus"
                },
                "id"          : 2,
                "optional"    : false,
                "nullable"    : false
            }
        },
        "odmProperty" : {
            "replacement_indicator" : {
                "description" : "TBD",
                "name"        : "replacement_indicator",
                "type"        : {
                    "$ref" : "#/odmData/BatteryReplacementIndicator"
                },
                "id"          : 16,
                "optional"    : false,
                "nullable"    : false
            }
        },
        "odmProperty" : {
            "remaining" : {
                "description" : "TBD",
                "name"        : "remaining",
                "type"        : {
                    "$ref" : "#/odmProperty/BatteryRemaining"
                },
                "id"          : 17,
                "optional"    : false,
                "nullable"    : false
            }
        }
    }
}
mjkoster commented 5 years ago

We agreed to add a quality for events to define "severity" or equivalent

asoloway64 commented 5 years ago

F2F4: It was decided that this is not a schema issue, but can be handled as part of "ODM Defined Data Types" which is a set of pre-defined values to be used by all data models. These will allow for vendor extensions.

gerickson commented 5 years ago

Is there more context on this resolution / outcome for those not at the F2F4?

/cc/ @mrjerryjohns

asoloway64 commented 5 years ago

Please see if the notes at https://iotliaison.org/wg/onedm/wiki/f2f-4-notes sufficiently capture the discussion.