-
Notifications
You must be signed in to change notification settings - Fork 1
Repo API: Node IDs #31
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
Comments
Originally posted by @dslmeinte in #46 (comment) I strongly agree ids should be strings, it's more about the limitations we set on them.
|
Assumptions
Allowed charactersArguments for limiting to small set (e.g. ASCII):
Arguments for big set (e.g. UTF-8):
Arguments for excluded characters:
Proposed allowed characters
Compatible with Base64url variant Namespace separator character
|
How to use fully qualified names as IDsA fully qualified name (FQN) is often used in programming languages to uniquely identify an element, e.g. C# class Base64url encodingBase64 is a mechanism to encode arbitrary data in 64 characters that can be safely transmitted by its carrier (e.g. traditional e-mail). In the url variant, the 64 characters used are exactly the allowed characters for IDs in LIonWeb. Thus, we can encode and decode anything (including FQNs) to/from an id without loss. Mapping tableKeep a map (aka dictionary) between fqns and randomly created ids. Hash functionFeed the fqn to a hash function, and use the output as id. We can combine a mapping table with hashed fqns to achieve stable ids (without additional storage) and bi-directional lookup. |
Namespace vs. id-spaceWe prefer the term id-space. People might be less tempted to use names as ids if we avoid the term name at all in this context. Also, namespaces are very often hierarchical, whereas our id-space is not. |
Do we need to define separator char?No. If required, each application can use their own representation. Examples:
|
Once we look into versioning/branching (#26), we need to amend this decision w.r.t. ids of nodes across branches. |
If this is ready for closing, can we make the choices we are making explicit here? |
I updated the description of this issue, it should reflect the choices. |
Ok, tnx, I was looking at the last comment to find the final choices. |
Closing as accepted, because there's no objection. |
I would add that the ID must not be empty |
Each LIonWeb node has an internal node id. The node id represents the identity of that node. This means:
Valid characters
ids can only contain these symbols:
a
..z
A
..Z
0
..9
_
-
This is the same charater set as Base64url variant.
Representation
ids are represented by a string, containing only valid characters (as defined above).
An id string is NOT padded, also not by whitespaces.
An id string does NOT contain any terminating symbols (compared to some BASE64 variants); this does not affect internal representation in a specific implementation language, e.g. C-style
\0
-terminated strings.Scope
Node ids MUST be unique within their id-space.
Id-space
An id-space is a realm that guarantees the uniqueness of all ids within.
Typically, this means one node repository instance.
An id-space has an id as defined above.
Uniqueness of id-space ids is out of scope of LIonWeb specification.
In LIonWeb (the protocol), id-spaces are NOT hierarchical.
An implementation might chose to use hierarchical id-spaces internally.
Identification
A node can be identified relative to its id-space by the node's id.
To globally identify a node, we use the combination of the id-space id and the node id.
For now, we don't consider the global case (see #25).
Thus, we use only the node id in LIonWeb protocol.
(This issue description has been updated to reflect the consolidated decision on node ids.)
The text was updated successfully, but these errors were encountered: