SignalK / specification

Signal K is a JSON-based format for storing and sharing marine data from different sources (e.g. nmea 0183, 2000, seatalk, etc)
Other
91 stars 68 forks source link

Identity in Delta Messages #155

Open tkurki opened 8 years ago

tkurki commented 8 years ago

When we used raw mmsi and self-assigned alphanumeric ids as keys in the vessels array the context in delta was in a format like vessels.12345679, with period as the delimiter, denoting path in the full tree.

Now with more structured identities (uuid, mmsi, url) period as the delimiter is not sufficient, as urls typically contain periods.

I suggest the following

{
  "branch": "vessels",
  "id": "urn:mrn:imo:mmsi:230099999",
  "updates": [...]
}

This should clear up the delimiter issue, save a few bytes and make things explicit. All paths in the delta message are rooted at the two part path formed by branch and identity from the root.

Comments?

rob42 commented 8 years ago

The example above solves the problem of dots as delimiter but I dont like dropping the self. It makes self a special case rather than an alias as it is now.

I also think we should use the existing context rather than id, as the change in language may confuse adopters, and 'id' is not specific to the vessels uuid as context has become. Thus we get minimal change, but the same benefits.

We can just add branch. So the example above becomes:

{
  "branch": "vessels",
  "context": "urn:mrn:imo:mmsi:230099999",
  "updates": [...]
}

In some cases the branch is implicit in the context, eg urn:mrn:imo:mmsi:230099999 must be a vessel (ignoring shore stations for now), but thats not always going to work out, and takes resources to check, so always including branch is a good idea IMHO