Open tkurki opened 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
When we used raw mmsi and self-assigned alphanumeric ids as keys in the
vessels
array thecontext
in delta was in a format likevessels.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
self
delta messages must omit the context, making it possible to distinguishself
messages by the absence of identity. Saves a few bytes also.vessels
is the default and should be omittedThis 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?