Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Need ODM SDF Syntax to Cover Product / Resource Object / Trait and Thing / Interface Version Mappings #67

Open
gerickson opened this issue Aug 16, 2019 · 2 comments
Labels
Parking Lot WDL Related to Weave and the Weave Data Language and the ability for ODM SDF to losslessly express WDL.

Comments

@gerickson
Copy link

In Weave Data Language (WDL), resources are equivalent to ODM "products". Over time, the definition of the resource may evolve and its version incremented as those changes occur. To the extent that changes in the resource need to be bound to specific versions of one or more underlying traits (objects) and interfaces (things), WDL provides a construct in the form of the version_map decoration to specify those dependencies.

To be expressed in ODM SDF losslessly, a syntax construct for representing this version mapping, when present, is required.

See related issue #60.

Relevant Example Schema Input Files

Missing or Unmapped WDL-to-ODM SDF Syntax

  • version_map
    • This is an array of dictionaries specifying which specific versions of the interfaces and/or traits comprising the resource are depended upon for a particular resource version. The dictionaries contain three keys: resource_version, iface_version_list, and trait_version_list.

    • Note that not all interfaces or traits specified in the resource need be specified in the version map; they need only be specified if there are specific version requirements.

    • resource_version

      • The specific version of the resource for which interface and/or trait dependencies are being specified.
    • iface_version_list

      • This is an array of dictionaries specifying the interface and version thereof that is to be bound for a particular resource version. The dictionaries contain two keys: name and version.
      • name
        • The name of the interface on which the specific resource_version of this resource depends.
      • version
        • The version of the named interface on which the specific resource_version of this resource depends.
    • trait_version_list

      • This is an array of dictionaries specifying the trait and version thereof that is to be bound for a particular resource version. The dictionaries contain two keys: name and version.
      • name
        • The name of the trait on which the specific resource_version of this resource depends.
      • version
        • The version of the named trait on which the specific resource_version of this resource depends.

Example Input WDL

message TraitTestResource {
    option (wdl.message_type) = RESOURCE;

    option (wdl.resource) = {
        stability: ALPHA,
        vendor_id: NEST,
        vendor_product_id: 0xFE00,
        version: 2,
        version_map: [
            {
                resource_version: 2,
                trait_version_list: [
                    {name: "nest.test.trait.TestCTrait", version: 2},
                    {name: "nest.test.trait.TestDTrait", version: 2}
                ],
                iface_version_list: [
                    {name: "nest.test.iface.TestVersionedBasicIface", version: 2}
                ]
            }
        ]
    };

    nest.test.trait.TestATrait service_a = 1 [(wdl.traitconfig) = {published_by: EXTERNAL, proxied: false, subscribed: true}];
    nest.test.trait.TestBTrait service_b = 2 [(wdl.traitconfig) = {published_by: EXTERNAL, proxied: false, subscribed: true}];
    nest.test.trait.TestCTrait service_c = 3 [(wdl.traitconfig) = {published_by: EXTERNAL, proxied: false, subscribed: true}];
    nest.test.trait.TestDTrait service_d = 4 [(wdl.traitconfig) = {published_by: EXTERNAL, proxied: false, subscribed: true}];

    nest.test.trait.TestATrait device_a = 5 [(wdl.traitconfig) = {published_by: SELF, proxied: true, subscribed: false}, (wdl.traitinst) = {instance: 1}];
    nest.test.trait.TestBTrait device_b = 6 [(wdl.traitconfig) = {published_by: SELF, proxied: true, subscribed: false}, (wdl.traitinst) = {instance: 1}];
    nest.test.trait.TestCTrait device_c = 7 [(wdl.traitconfig) = {published_by: SELF, proxied: true, subscribed: false}, (wdl.traitinst) = {instance: 1}];
    nest.test.trait.TestDTrait device_d = 8 [(wdl.traitconfig) = {published_by: SELF, proxied: true, subscribed: false}, (wdl.traitinst) = {instance: 1}];

    // For multi-instance testing (e.g commands)
    nest.test.trait.TestATrait device_a2 = 9 [(wdl.traitconfig) = {published_by: SELF, proxied: true, subscribed: false}, (wdl.traitinst) = {instance: 2}];
    nest.test.trait.TestATrait device_a3 = 10 [(wdl.traitconfig) = {published_by: SELF, proxied: true, subscribed: false}, (wdl.traitinst) = {instance: 3}];

    message Implements {
        option (wdl.message_type) = IFACE_IMPLEMENTATIONS;

        nest.test.iface.TestBasicIface iface_1 = 1;

        nest.test.iface.TestNestedIface iface_2 = 2 [(wdl.implconfig) = {trait_mapping: [{from:"service_a", to:"trait_x"}]}];

        nest.test.iface.TestVersionedBasicIface iface_3 = 3 [(wdl.implconfig) = {min_version: 2}];
    };
};

message NestProtectCommonIface {
    option (wdl.message_type) = IFACE;

    option (wdl.iface) = {
        stability: PROD,
        vendor_id: NEST,
        version: 2,
    };

    message Implements {
        option (wdl.message_type) = IFACE_IMPLEMENTATIONS;

        weave.iface.common.DeviceIface device = 1;

        nest.iface.EnhancedPathlightIface enhanced_pathlight = 2 [(wdl.implconfig) = {min_version: 2}];
    };
};
@mjkoster mjkoster added enhancement New feature or request Parking Lot and removed enhancement New feature or request labels Aug 28, 2019
@gerickson gerickson added the WDL Related to Weave and the Weave Data Language and the ability for ODM SDF to losslessly express WDL. label Sep 6, 2019
@WAvdBeek
Copy link
Collaborator

I thought oneDM would not define products.

@gerickson
Copy link
Author

@WAvdBeek, you are correct that OneDM is not defining products; however, the syntax must be able to cover a product or product-like construct if OneDM is to meet the expectation that other ecosystems that do have and do define products can use the syntax and tooling to supplant their own, internal tooling and syntax.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Parking Lot WDL Related to Weave and the Weave Data Language and the ability for ODM SDF to losslessly express WDL.
Projects
None yet
Development

No branches or pull requests

3 participants