w3c / automotive-bg

21 stars 25 forks source link

Add complex inline structures to the viwi protocol #59

Open wzr1337 opened 7 years ago

wzr1337 commented 7 years ago

For some use cases it might be needed to allow complex data structures in addition to primitives

(see automotive-bg/rsi/protocol/)

anawhj commented 7 years ago

In the RSI protocol document, author specifies the graph interface where all leaf nodes seems to have a primitive value (int, string, etc.). I wonder the primitives you mentioned is same as the primitive value for the leaf nodes I mentioned.

In general, the leaf nodes could have a value as a nested object within a JSON format while I guess you want to make the leaf nodes have a value like a inline string with complex structure. Am I right? I'd like to see a use case to understand why the complex data structures with inline need.

wzr1337 commented 7 years ago

@anawhj You are partially right. I want to nest complex JSON structures in leaf node properties.

E.g. PlayerObject:

{
  "id": "01065B9A-6908-48E0-9D2E-914160480826",
  "name": "Player One",
  "uri": "/media/players/01065B9A-6908-48E0-9D2E-914160480826",
  "offset": 1234,
  "artist": {
    "name": "P!nk",
    "birthday": {
      "month": 9,
      "day": 8,
      "year": 1979
    }
  }
}

In this example, I want to group the artist name with additional information. The birthday is again a substructure.

I still want to handle the complex sturcture as "like primitive", as you will not be able to access birthday or name directly, nor filter nor any other complex operation. It would just be a well structured "BLOB" of data, Events will fire when it changes.. regardless of changes in "name" or "birthday".

I will publish a concrete Pull-Request before Thursday this week.

wzr1337 commented 7 years ago

Just opened the PR referenced above: https://github.com/w3c/automotive-bg/pull/67