Skip to content

Use array for data model #12

Open
Open
@brianorwhatever

Description

@brianorwhatever

I’d like to propose defining the CEL data model as an array rather than a single JSON object. Here’s why:

  1. Event Log Use Cases: Many use cases I envision treat CEL as an event log, which is inherently sequential. Arrays naturally represent an ordered list of events, making the data easier to parse and verify as a chronological record.

  2. Abstraction from JSONL: It doesn’t have to be JSONL, it could be a top level array in JSON, but if we represent the data model as an array, then JSONL can easily and effectively be abstracted into array-like entries. This approach maintains simplicity while allowing compatibility with streaming or line-delimited formats.

  3. Top-Level Properties as Events: Any properties that might otherwise be placed at the top level (such as previousLog) can be inserted as events that follow the same parsing and verification logic. This consistency reduces complexity, since implementers only need to handle a single, well-defined structure (the array).

  4. Clarity and Consistency: By focusing on an array-based model, we keep the spec uncluttered and aligned with the predominant need for event logging. Objects that include additional top-level fields introduce more overhead and potential confusion when verifying or parsing data.

For reference, please see: #3 and decentralized-identity/didwebvh#160 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions