- 1 About
- 2 Context Data Model Requirements
- 3 Higgins API Requirements
- 4 Current EntityId Definition in Context Data Model 1.0
- 5 Proposed Changes in Context Data Model 1.1
- 6 Still Under Discussion
Context Data Model Requirements
In terms of the underlying graph model, following is a summary of the abstract requirements based on recent threads on the email list (~2008-09). Please post a note if you disagree with any of the following:
- An Entity is a node in the graph described by the Higgins Context Data Model. The CDM needs a consistent way of representing arcs referencing that node.
- There MAY be 0..n such arcs referencing the node. (0 is possible for blank nodes.)
- An arc MAY theoretically be represented as either:
- A unique identifier (single-part key).
- A set of Attributes of that Entity (multi-part key) - none of which itself is required to be a unique identifier. --Paul.socialphysics.org 14:16, 17 September 2008 (UTC): Even if we do move to having 0..1 (canonical) EntityId plus 0..n synonyms I disagree that we can support this second option as a first class "arc" --doing so would place impossible burdens on future versions of IdAS that will be capable of "deep" (graph) operations instead of today's shallow queries. In other words IdAS itself will be able to "walk the arcs" to respond to a query. So whereas WITHIN a Context developers may think of arcs implemented by multi-part keys they should expect no support for these links from IdAS itself.
- If the arc is represented as a unique identifier:
- It MUST be a Contextually Unique ID (CUID), i.e., locally unique within the Context.
- It MAY be globally unique identifier (GUID) (note that all GUIDs are by definition CUIDs provided that the Context recognizing them as IDs).
- With regard to mutability:
- At least one identifier for an Entity in a Context SHOULD be immutable, i.e., serve as a persistent reference to the Entity within that Context (forever).
- However because Higgins does not control Contexts or Context policies, the CDM must be prepared that an identifier for an Entity MAY be mutable, i.e., may be reassigned in that Context to reference a different Entity.
Higgins API Requirements
Following are the key design decisions we need to make. We are posting votes as they are made in email. Feel free post your votes/comments directly (with your wiki signature).
Q1: Unique Identifier vs. Attribute Set
- Jim: Yes - it must be a CUID or GUID.
- David: No - I prefer a multi-part key where the parts of the key might also be unique in a context. An example is a EntityID made up of a uniqueName, uniqueId, nativeName, nativeId. Any part of the of the Entity ID could be used to identify the object.
- Drummond: Abstain - Single-part IDs are easier, but multi-part keys are useful too.
- Tony: No.
- Tom: Yes - it must be a CUID or GUID.
- Paul: Yes - it must be a CUID or a GUID. With the synonyms proposal (see below) we can give David the multi-part keys he needs (each key-part is a synonym)
Q2: Representation of an EntityId as a Unique Identifier
If an EntityId is a unique identifier, should this be represented as:
- Jim: #2
- David: #2
- Drummond: #2
- Tony: #2
- Tom: #2
- Paul: #2
What is the cardinality of EntityId? (The answer may depend on the answer to #2.)
- 1 (whose value may be null)?
- None of the above?
- Jim: Abstain - I tend to want simple.
- David: #1 or #2 - 0..1 if the EntityId is mutlipart as in Q1. 0..n if it is a string, and then it needs a type.
- Drummond: #2 or #3 - For comparison's sake, you need to always get the same identifier value. But there should also be a way to get all synonyms.
- Tony: #1
- Tom: Abstain - +1 to Jim's feedback.
- Paul: #2 unless I see a real world use case that requires #1. Presuming such a use-case exists, I can't see any alternative to having 0..1 "canonical" EntityId AND 0..n synonyms. There must be a way to link the synonyms together--the (preferably immutable) canonical EntityId is the way to do this. I don't see how you can have a data model 0..n ids that are all perfectly equal. The most natural thing in the CDM model would be to have 0..1 EntityId and then define an Attribute type in CDM called "synonym" and have all these "other" ids be higgins:synonyms or Context-defined sub-attributes of this
Is the EntityID of an Entity immutable?
- Jim: Yes - I believe it must be as soon as we start tying policy to EntityIDs. Either that, or we need to require a way to ensure referential integrity for places where EntityIDs are stored in policy statements.
- David: Depends - My vote on Q1 was multipart where the decomposition could contain both mutable (uniqueName) and immutable (uniqueId) parts. They both have their use cases. If the EntityID is a string, then 1..n is needed to accomodate mutable, immutable types and if the id can be used in other protocols (compatability with legacy systems).
- Drummond: Depends - Both immutable and mutable SHOULD be possible. Best practice is to assign 1 immutable in any context and then allow 0..n synonyms (mutable or immutable). But Higgins does not control contexts so it seems like it must be open to either. However there should be a way to ask for an immutable identifier, or ask if an given identifier is mutable.
- Tony: No position yet.
- Tom: Yes - +1 to Jim's position.
- Paul: In the case where we have 0..1 EntityId I'd say #1 (yes). If we have 0..1 EntityId plus 0..n synonyms then I'd say only the entityID must be immutable, the 0..n synonyms may be mutable
Current EntityId Definition in Context Data Model 1.0
The entityId parameter to the getEntity method on IContext interface:
- Is of type [need info here].
- Has cardinality 0..1
- MUST be Context-unique; MAY be globally unique.
- Is always exposed as an Attribute.
- Exposes no information about mutability.
Proposed Changes in Context Data Model 1.1
#1: Not Require EntityId to be Exposed as an Attribute
The proposed change is to make EntityId OPTIONAL to expose as an Attribute. Contexts that do not want to expose the EntityId can omit it from the list of Attributes for an Entity. Note: if the EntityId is mutable, it SHOULD be exposed as an Attribute so it can be modified.
#2: Add getEntityIdsMutable Method
#3: Add getIdentifiers Method
The proposed change is to add a getIdentifiers() method on IEntity that returns all Identifiers for an Entity (0..n). By definition all such identifiers would be synonyms of the EntityId, even if the EntityId was not among the values returned.
--Paul 14:09, 17 September 2008 (UTC): Presuming that a valid use case can be made for 0..n synonyms in addition to the 0..1 canonical EntityId then this method makes sense (although I think it should only return the synonyms and leave getEntityId to return our usual 0..1 EntityId. Personally I think of it as a convenience method to get all of the values of the "higgins:synonym" Attribute --and that higgins:synonym Attributes are just regular Attributes and discoverable as such.
Still Under Discussion
#4: Multi-Part Keys
The proposal is to keep it simple by requiring multi-part keys to be serialized into a composite identifier, which can then be used as an inherent EntityId or exposed as an Identifiers value.
--Paul 14:10, 17 September 2008 (UTC): I don't see why each key-part can't be a synonym Attribute and thus we don't have to complicate our model by adding "multi-part" literal values