OLML Stage 1: Data Model and Processing Specification

Stage 1 specification · v0.1

1. Scope and document status

OLML stands for Object-Linking Memory Language. It represents physical or digital Objects, selected context called Memories, and explicit Links between them.

This document specifies the current Stage 1 design. It defines a simple portable package and the operations needed to create, read, edit, save, import, and find it. It also defines optional recognition bindings and saved-state comparison.

The publication consists of OLML Core v0.1, this Stage 1 specification, and the completed browser MVP v0.1. The MVP is an implementation of an earlier subset of the design. Section 10 lists relevant differences.

“Required” in this document means required by this specification. It does not mean that every requirement is already enforced by the MVP.

This is the specification for Stage 1, version 0.1. Later versions may extend or revise it. Its scope is the data model, package requirements, and processing behavior. Exact serialization and state-calculation profiles are separate implementation contracts; this version does not define every byte-level rule. Clients must use compatible contracts to exchange data and compare hashes reliably. Section 9 provides an illustrative package example.

2. Terms and relationships

Term Meaning
Object A physical or digital thing that the context concerns.
Object record The digital representation of an Object, including its identifier and title.
Memory Selected digital context about an Object. It can include notes, stories, instructions, event records, and references to different media.
Memory record The identified record containing that context and any asset references.
Link An explicit pair of Object and Memory identifiers. It records their association.
Collection A group of Memories about one Object, organized for a purpose.
Package The portable .olml file carrying the records and any bundled resources.
Memory Asset An attachment or digital resource used by a Memory. It may be bundled or externally referenced.
Object Marker An optional recognition definition with a method, required value or reference evidence, and binding to an Object identifier.
State hash A digest calculated from specified recorded inputs. It represents covered state, not continuing identity.
Client Software that performs one or more OLML operations.
Library Locally adopted records, package data, state hashes, and lookup information. See Section 5.2 for what it retains.
Object Hub A view of available Collections for one Object. It is derived from Library data.

An Object record does not contain the physical thing itself. A Memory can be text-only. A Link is a relationship between records; it need not be a web address.

The general model allows a Memory to concern more than one Object. Each association has its own explicit pair. Stage 1 uses a narrower package shape:

Stage 1 package with one Object, one Collection, explicit Links to one or more Memories, required state hashes, detailed Memory fields, and optional marker methods and assets.

Figure 1. The Stage 1 package brings the records and their connections together. Object and Memory titles are required. Markers and assets are optional. The physical Object is represented by its record; it is not contained in the file.

There are no duplicate Link pairs or unresolved endpoints in a valid simple package. A separate link.id is not required.

For example, microscope O1 can have Collection C1, “Maintenance,” in package P1. It can also have Collection C2, “Experiment notes,” in package P2. Both packages use O1. Collections organize context; they do not enforce permissions.

3. Identity and reuse

Stage 1 uses four kinds of persistent identifier:

Field Identifies
object.id The continuing Object represented by the record.
memory.id A continuing Memory record.
collection.id A continuing grouping of Memories.
olml.id A continuing package across edits and ordinary copies.

The client generates identifiers for new entities. A kind-prefixed UUID is one possible implementation. Short IDs such as O1 and M1 are used here only for explanation.

Titles are display text. They are not identity keys. Renaming an Object, Memory, or Collection preserves its identifier.

Operation Identity rule
Create a new Object Generate a new Object ID.
Create a package and Collection for a known Object Reuse the Object ID. Generate new package and Collection IDs.
Add a new Memory Generate a new Memory ID.
Reuse the same continuing Memory in another Collection Keep its Memory ID. Record the appropriate Link.
Edit, copy, import, or export an existing package Preserve continuing IDs.
Change covered content Update saved state on save. Do not replace identity merely because state changed.

One actual Object is intended to use one Object ID. Two separately entered records may still refer to the same physical thing. Stage 1 does not define automatic detection or reconciliation of that mistake.

Reusing a Memory ID expresses continuing identity. It does not implement automatic propagation across all copies. Different packages may contain different saved states of the same Memory. A client can report that difference under compatible calculation rules. It must not infer an authoritative winner from the ID alone.

Editing a Memory updates the saved copy in the package being edited. Stage 1 does not automatically distribute that change to every other package or client using the same Memory ID. Updating the locally adopted Library record also does not rewrite independently retained disk files.

Removing a Link is a different operation. It removes an association in that Collection; it does not by itself delete the Memory from another Collection or file. Reuse of an ID and propagation of edits are separate behaviors. A workflow for exporting and importing standalone Memory blocks remains a later extension.

4. Package records and resources

4.1 Required and optional data

Data Stage 1 rule
Package ID Required; generated for a new package.
Object record Exactly one; ID and title required. Description optional.
Collection record Exactly one; ID required. Title and description optional.
Memory records One or more; each has an ID and title. Note, time, place, and assets are optional.
Links Exactly one pair from the package's Object to each included Memory.
State values Required for the Object, each Memory, the Collection, and the package.
Object Markers Optional. Every included definition needs complete method-specific data and an Object binding.
Memory Assets Optional. Included resources need the applicable location and resource information.

An absent Collection title is displayed as collection.id. That fallback does not make the identifier a title or state hash.

A Collection record is the data structure containing collection.id and any Collection title or description. The app generates the ID. The user can enter a title and description. Together, those fields form the record; there is no separate input field named “Collection record.” Object and Memory records use the same idea: each is a group of fields describing that entity.

4.2 Container

The portable package is a ZIP archive with exactly one root olml.json. That JSON file describes the records, relationships, references, and state declarations. Bundled resources occupy declared paths in the archive.

JSON is the syntax used to write the structured records. The .olml file is the portable package containing olml.json and any bundled media files. A standalone JSON file does not include those separate bundled files. Renaming a .json file to .olml does not create the specified package.

microscope.olml
  olml.json
  assets/
    calibration.jpg

The Object, Collection, and Memory records live in the JSON data. They are not separate files in this example.

4.3 Bundled and external assets

A bundled asset has a package-relative path. Its record can also include a display name, media type, size, or digest. The corresponding bytes travel inside the ZIP.

An external asset has a recorded location, such as a URL. The reference travels with the package. The remote bytes need not.

A package can mix both forms. A Memory may use a bundled image and an externally hosted video. Resource content and its recorded path, URL, type, or size belong to the same asset layer.

A Reader resolves bundled paths inside the package. Missing declared bytes are a package defect. An unsupported media codec is a rendering limitation. These cases should be distinguishable.

For external content, the Reader can request and display the resource when available and supported. Otherwise, it presents the recorded URL. The Memory and its Link remain available.

State processing covers the external-reference information recorded in the package. It does not fetch remote bytes to verify their contents. Replacement of a remote video behind an unchanged URL is outside this comparison.

A Memory record in olml.json has a required ID and title, optional note, time and place, and optional media references to bundled bytes or external content.

Figure 2. A Memory record and an attached file are different parts of the package. Bundled files travel with it. External references travel as recorded addresses; the remote files remain outside.

5. Optional markers and lookup

5.1 Complete binding

An Object Marker contains three parts:

  1. The recognition method.
  2. The value or reference evidence required by that method.
  3. A complete binding to object.id.

A package can omit all markers. No default QR code is inserted to fill that omission. Direct creation, reading, and editing remain valid.

If the author adds a marker, its data must be complete. Recording only the word “NFC” does not provide a usable binding.

Method Example input or evidence How it reaches the Object ID
QR A recorded value, ordinarily the Object ID in this design. Decode the value and use its binding.
Barcode An object-specific value or a known value binding. Decode the value and use its binding.
NFC A recorded tag value. Read the value and use its binding.
Image reference A reference image or supported visual evidence. Match the evidence and use its binding.
Visible text / OCR Recorded expected text. Read and match the text, then use its binding.
Object reference or tracking Prepared evidence supported by a recognition engine. Match the reference and use its binding.

These are supported design routes, not a claim that the MVP implements every recognizer. Each route needs an appropriate adapter and usable evidence. A single photograph is not assumed to be a complete three-dimensional object model.

Multiple markers can bind to the same Object ID. This does not convert their evidence formats into one another. A client needs support for the method it uses.

For the QR path, the client generates the value and QR image. The user saves and deploys the image. Reprinting the same Object-ID value does not create a new Object. The printed image need not be byte-identical to the earlier image.

A copied label or repeated visual feature can appear on several physical items. Matching a stored binding does not prove unique physical identity.

5.2 What the Library retains

The Library holds the data adopted by the local client. Its role includes storage, state comparison, and lookup. It is not just the scan route.

Retained data Purpose
Object, Memory, and Collection records, with their IDs and Links Keep the locally adopted information and its relationships.
Object, per-Memory, Collection, and package state hashes, with their calculation profile Compare the covered data in an incoming package with the locally adopted data.
Available package data, bundled asset bytes, and included marker evidence Support reading and later processing without retrieving those bytes from the original provider.
External resource references Retain recorded addresses and resource information. Remote bytes are not automatically archived.
Lookup indexes Find the Object binding and the available packages or Collections for an Object.

A successful import parses and validates a package and adds the accepted data to the Library. Merely selecting a file does not complete import. An unresolved conflict can prevent acceptance. Saving an accepted edit updates the relevant locally adopted records and state values.

The Library keeps the saved data and its state hashes. A hash alone cannot reconstruct the content. Retaining current state does not mean retaining every historical version or a restorable archive of every earlier package.

5.3 Recognition, lookup, and display

Recognition and display use the Library's retained data. The complete route involves several components:

Observation
    ↓ Recognition adapter: decode a value or match reference evidence
Recognition result
    ↓ Resolver: use a recorded binding
Object ID
    ↓ Library: find available packages and Collections
Selected package
    ↓ Reader: follow explicit Links
Linked Memories and supported content

The Library supports this route with indexes from method/value or matched reference to Object ID, from Object ID to available package and Collection IDs, and from package ID/state to obtainable data. The adapter recognizes, the Resolver maps, the Library locates, and the Reader displays.

An independent scan first attempts to obtain an Object ID. Package lookup begins after that step succeeds. After successful import, lookup for that package's own Object ID has at least the newly imported package available.

Result Handling
No Object ID can be obtained Report recognition or mapping failure.
Object ID obtained; no package found Report no available package and prompt for import.
One package found Select that package.
Several packages found Show Collection titles, or Collection IDs when titles are absent. Let the user choose.

The Reader then follows explicit Links in the selected package. Recognition failure and an empty package lookup are different outcomes.

Stage 1 also permits an accessible Library outside the reading client. Its basic role is to obtain packages, build an Object-ID index, and answer queries. Authentication, hosting policy, and public discovery are not specified here.

6. Processing operations

The following are functional roles. One application may perform all of them.

Role Responsibility
Writer Create or edit records and serialize a package.
Reader Parse records, follow Links, and present supported content.
Validator Check structure, references, and applicable state information.
Recognition adapter Decode an observation or match supported evidence.
Resolver Map the observation result through a binding to an Object ID.
Library Keep available data, support lookup, and retain locally adopted state.

6.1 Create

  1. Establish an Object and Collection. Reuse known identity where appropriate.
  2. Generate IDs for the new entities.
  3. Obtain the Object title and at least one titled Memory.
  4. Record the Link from the Object to each Memory.
  5. Add optional descriptions, event information, assets, or complete markers.
  6. Validate required data, Links, and applicable resource references.
  7. Calculate and record component and package state.
  8. Save the package and provide an export.

Creation has no previously saved state. It does not use the unchanged-existing-file save gate.

6.2 Read directly

The Reader obtains a package or an accessible result containing its records. It parses the Object, Memories, and Link endpoints. It resolves those endpoints and presents the associated content.

This route requires no sensor, marker, or prior Collection-selection screen.

6.3 Edit and save

The Writer parses the existing package and preserves its continuing IDs. It edits understood fields and relationships.

During editing, it compares current records with saved records. Save is unavailable while there is no recorded difference. A retained whitespace change counts as a change. Restoring the saved records removes the difference.

The user can discard unsaved edits. Discard preserves the original saved records and state.

When the user requests Save, the Writer validates the changed records and references. Included markers receive conditional validation. On success, it calculates and records affected component and package state, saves, and provides export. Failed validation returns the user to editing.

Adding, changing, or removing marker data changes Object data. Saving that change updates the affected Object and package state. Unsaved changes do not update saved state.

6.4 Validation and safe editing

A client checks the declared format version and locates one root manifest. It rejects unsafe or ambiguous archive paths, including traversal and duplicate normalized paths. It checks record IDs, Link endpoints, duplicate pairs, and declared bundled dependencies.

Missing optional markers are valid. Incomplete included markers are not. The absence of an optional asset is different from a declared bundled asset whose bytes are missing.

A client can support reading without supporting every rendering or recognition method. Structural validity, resource availability, recognition capability, and state comparability are separate results.

For safe exchange, a client retains the original record tree and untouched resource bytes where possible. It applies edits only to data it understands and can safely rewrite. It preserves unknown optional data when safe. If an unknown field affects required meaning or references, the client provides read-only access or an explicit incompatibility or information-loss report.

This is a preservation requirement for the design. It is not a claim that arbitrary clients can safely edit arbitrary future extensions.

7. Saved state

7.1 Identity and state are separate

Saved state is the recorded data at a save. State hashes fingerprint specified parts of that data. They do not replace entity identifiers, indicate whether a save succeeded, or mean that a conflict exists. A conflict can arise later when comparable states for the same package ID differ.

State Intended coverage
objectStateHash Covered Object data, including any marker definitions, evidence, and bindings.
Values in memoryStateHashes Covered data for each Memory and its asset information. Bundled resources contribute byte digests.
collectionStateHash Covered Collection data and Link membership.
packageStateHash The aggregate covered package state.

These are coverage descriptions. A complete calculation profile must identify the exact fields and byte rules.

Creation save records state. Saving an actual edit records the updated state. An implementation can recompute unchanged components as well; identical inputs under the same rules yield identical values.

7.2 Calculation example

One concrete approach is:

  1. Select the covered fields and resource information.
  2. Include digests of bundled resource bytes where applicable.
  3. Order fields and sets deterministically.
  4. Serialize the selected data as UTF-8 bytes.
  5. Apply SHA-256 to produce component values.
  6. Combine the component values in a specified order to calculate package state.

Derived state values are excluded from their own inputs. External resources contribute recorded reference information, not fetched remote bytes.

SHA-256 supplies a concrete example. Comparable results also require compatible input selection, ordering, serialization, and coverage. Choosing the same hash algorithm is insufficient on its own.

A calculation profile must specify absent versus empty fields, array ordering, and extension handling. These byte-level rules are outside this version's scope. Clients must agree on a profile before treating their hashes as comparable.

7.3 Example changes

Saved edit Expected effect under the stated coverage
Change M1's note M1 and package state change. Unchanged components retain their values.
Change an Object Marker binding Object and package state change.
Change the Collection title Collection and package state change.
Change an external URL recorded for M1 M1 and package state change.
Replace remote content behind an unchanged URL No detected change from that replacement alone.
Deliver the same assembled package again No new state from delivery alone.

A hash does not establish authorship, ownership, permission, or factual truth. Equal values concern only the covered inputs under compatible rules.

The existing parentPackageStateHash field is distinct from current content state. It is not a complete history. Fork identity, parent selection, and merge rules are outside this version's scope. Initial creation does not require inventing a nonexistent parent state.

8. Import conflicts and local acceptance

The local conflict workflow is triggered by opening or importing a file. It is not a separate command for manually choosing two arbitrary files.

  1. Read the incoming package identity and recorded state.
  2. Look for a Library record with the same olml.id.
  3. Check whether the states use compatible calculation rules and coverage.
  4. Compare compatible state values.
  5. Prompt for a local choice when they differ.
  6. Update or retain the Library record according to that choice.

Incompatible state profiles are reported as not comparable. They are not treated as evidence of equal or different content. A client may recompute state to validate a declaration. Recalculation is not mandatory for every recorded-state comparison and does not create a separate baseline-state field.

The user's choice means “use this version here.” It does not establish global authority. The client does not select a winner from timestamp order or hash values and does not merge automatically.

Sibling Collections share an Object ID but have separate package IDs. That relationship alone does not create a same-package conflict. Shared Object or Memory IDs can still carry differing component states; those differences must not be confused with the ordinary Collection choice.

Saving or exporting updates the Library in the local embodiment. It does not automatically overwrite an older disk file. A browser download request also does not prove that the user replaced that file.

Different Object descriptions across packages

Two packages may use the same Object ID but contain different Object descriptions. The local Library keeps displaying its currently adopted description. On first encounter, this is the first description accepted into the Library.

When another package contains a different description for that Object ID, the client notifies the user. This check applies even when the packages have different olml.id values. The user can keep the Library description, adopt the incoming description as the Library's main description, or leave the difference unresolved.

Adopting a description updates the local Library record. It does not rewrite the other packages or files on disk. If the difference remains unresolved, opening the conflicting file again shows the warning again.

For example, P1 contains O1's maintenance records and P2 contains O1's experiment notes. If the Library first accepts O1's description from P1, it displays that description when P2 is opened. If P2 contains a different description, the client shows the difference and offers the local choice. The two Collections remain separate.

This rule provides a local choice. Stage 1 does not synchronize Object descriptions across packages or define a central authority for them.

9. Worked package example

This example describes microscope O1, Collection C1, and two Memories. M1 is text-only. M2 refers to a bundled calibration photo. The optional QR marker binds to O1.

This example illustrates the specified records and relationships. It uses short IDs and placeholders for the version, profile, and hashes, so it is not an importable test file. Its top-level integrity placement follows the design example; the MVP uses an envelope under olml.integrity. This example does not establish a complete serialization contract.

{
  "olml": {
    "id": "Olml:P1",
    "version": "example-version"
  },
  "collection": {
    "id": "Collection:C1",
    "title": "Microscope maintenance"
  },
  "object": {
    "id": "Object:O1",
    "title": "Lab microscope A",
    "description": "White microscope at bench 3"
  },
  "memories": [
    {
      "id": "Memory:M1",
      "title": "Setup",
      "note": "Use the blue calibration slide."
    },
    {
      "id": "Memory:M2",
      "title": "Calibration record",
      "note": "Photo from the calibration session.",
      "assets": ["assets/calibration.jpg"]
    }
  ],
  "links": [
    {"object": "Object:O1", "memory": "Memory:M1"},
    {"object": "Object:O1", "memory": "Memory:M2"}
  ],
  "assets": [
    {
      "path": "assets/calibration.jpg",
      "mediaType": "image/jpeg",
      "external": false
    }
  ],
  "objectMarkers": [
    {
      "markerType": "qr",
      "object": "Object:O1",
      "markerEvidence": {
        "type": "generated-qr",
        "value": "Object:O1"
      }
    }
  ],
  "integrity": {
    "profile": "example-profile",
    "objectStateHash": "sha256:...",
    "memoryStateHashes": {
      "Memory:M1": "sha256:...",
      "Memory:M2": "sha256:..."
    },
    "collectionStateHash": "sha256:...",
    "packageStateHash": "sha256:..."
  }
}

The Writer includes assets/calibration.jpg in the archive. A Reader resolves both Links to O1 and displays the two Memories. It can do so without scanning the QR code.

For marker-free creation, the author omits the marker data before saving. The Writer calculates Object and package state from the remaining covered inputs. Removing a marker from an existing package also requires updating saved state.

If M1's instruction changes, its Memory ID remains Memory:M1. On save, its state and the aggregate package state change. A later import of a different comparable state for Olml:P1 triggers the local conflict choice.

A second Collection for O1 receives its own Collection and package IDs. The Library can then offer both Collections for the same microscope.

10. MVP v0.1 and implementation compatibility

The browser MVP v0.1 is completed. It provides package authoring, import/export, a local Library, and state processing under its named calculation profile. It also includes QR/barcode and OCR scan paths. Runtime capability depends on the browser and required libraries. Stored image-reference data is not an implemented image recognizer or an AR display.

The current exchange workflow uses the OLML Web App MVP. It can export and import packages supported by that implementation. Exchange with an independently developed Reader has not been demonstrated. This specification alone does not yet provide every serialization and hash-calculation rule needed to reproduce the MVP's behavior.

The following distinctions matter when using the MVP alongside this design:

Area Stage 1 design MVP v0.1 implementation
Collection identity Separate collection.id and olml.id. The existing package shape uses package-level grouping without the separate Collection ID.
Marker omission Marker-free creation and direct reading are valid. The export readiness check requires a complete marker.
Memory titles Every Memory has a title. The export readiness check tests for at least one titled Memory.
Save gate Existing-file Save requires a recorded change; retained whitespace counts. Some inputs are trimmed. The inspected export path does not explicitly enforce the full unchanged-file gate.
State profile Exact compatible coverage and serialization are needed. Uses olml-semantic-state-v1-draft-2. This is the implementation's profile identifier, not the status of this specification.
Recognition Optional methods share the Object-ID lookup route. Implemented scan routes and stored marker types cover only part of the design.

These differences describe the scope of the initial implementation. They do not change the Stage 1 rules or turn completion of MVP v0.1 into completion of every later design requirement.

Implementations use this specification for the Stage 1 model and behavior. Cross-client interoperability also requires an agreed schema, a versioned calculation profile, and compatible method-specific evidence formats. This version does not prescribe those contracts in full. Shared test fixtures and independent-client round trips should check preserved IDs, Links, resources, optional data, and comparable state values. These are validation tasks, not results claimed by this document.

Stage 1 does not specify automatic synchronization, duplicate-Object reconciliation, branch merging, permission inheritance, signature attribution, or a public registry protocol. Programmatic create, edit, read, and lookup operations fit the component model. A deployed agent interface, MCP server, or skill is outside this publication.

The bounded design remains usable without those extensions: create identified records, record explicit Links, save a portable package, read it directly or find it through an optional marker, and handle differing imported state through a local user choice.

Resolver

OLML Resolver Web is a browser-local prototype for creating, editing, reading, importing, and exporting .olml files. Its local Library belongs to the current browser origin.

Use the MemoryPackage sample data to try the package workflow, then refer to the README in the app folder for setup and use instructions.

Open the Resolver App