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 or Convention to Cover a Wrapping Typespace for Enumerations and Structs #62

Open gerickson opened 5 years ago

gerickson commented 5 years ago

In the Weave Data Language (WDL), typespaces provide an encapsulated namespace within which to define just structs and enumerations for the purposes of re-use. Unlike traits, they cannot house properties, events, or commands (actions). They also cannot be referenced within a path and as such, do not have a profile identifier associated with them.

To be expressed in ODM SDF losslessly, a syntax construct for representing such a convention is required.

Relevant Example Schema Input Files

Example Input WDL

package nest.trait.occupancy;

message Geofencing {
    option (wdl.message_type) = TYPESPACE;

    option (wdl.typespace) = {
        stability: PROD,
        vendor_id: 0x235A,
        version: 1
    };

    enum GeofenceState {
        GEOFENCE_STATE_UNSPECIFIED = 0;
        GEOFENCE_STATE_INSIDE      = 1;
        GEOFENCE_STATE_OUTSIDE     = 2;
        GEOFENCE_STATE_UNKNOWN     = 3;
    }
};

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

    option (wdl.event) = {
        id: 1,
        event_importance: EVENT_IMPORTANCE_PRODUCTION_CRITICAL
    };

    nest.trait.occupancy.Geofencing.GeofenceState state = 1;
};
mjkoster commented 5 years ago

odmData can be defined and reused by odmType { $ref odmData }

Let's discuss additional requirements