UmweltDocs
Reference/Queries/canon
canonquerysince 0.1

The Facts visible at a position: the narrator’s read of what is true.

Request
umwelt call story.umw canon '{
  "projectId": "ball",
  "filter": { "predicate": "stole" }
}'
Request
const result = await client.canon({ projectId: 'ball', filter: { predicate: 'stole' } });
Request
var result = engine.Canon(new CanonPayload
{
    ProjectId = "ball",
    Filter = new CanonFilter { Predicate = "stole" },
});
Response
{
  "items": [
    {
      "kind": "fact",
      "id": "theft",
      "projectId": "ball",
      "timelineId": "main",
      "eventId": "scene-1",
      "claim": {
        "subject": "bob",
        "predicate": "stole",
        "object": { "kind": "entity", "id": "necklace" },
        "polarity": true,
        "qualifiers": {}
      },
      "position": { "tick": 1 },
      "provenance": { "origin": { "kind": "human" } },
      "recordedAt": 2
    }
  ]
}

Payload

FieldTypeDescription
projectIdrequiredstringThe project to read.
atAtdefault {}Where to read: tick, an optional axis, and asOfVersion. Defaults to the latest.
filterCanonFilterdefault {}Narrows the list: subject, predicate, and object (an entity id).
pagePagedefault {"limit":100}How many items to return (limit, 1 to 1000) and where to continue (cursor, the nextCursor of the previous page).
timelineIdstringdefault "main"The timeline to read.

Result

FieldTypeDescription
itemsalwaysRecord[]Active Facts, in story order.
nextCursorstringMore Facts follow; pass it as page.cursor.

Rules

Canon is nobody’s knowledge. A Fact listed here does not make anyone hold it. Ask holds for a holder.

Only active Facts. A Fact retracted or superseded before the position is left out; read earlier to see it.

Errors

VALIDATION_FAILEDThe payload is malformed, or the page limit is outside 1 to 1000.
NOT_FOUNDThe project or timeline does not exist, or the draft read was purged.
INVALID_STATEThe timeline read is a draft that was promoted. details.promotedInto names the timeline to read instead.
HANDSHAKE_REQUIREDOver the protocol, hello was not sent first.

Every code is listed in Errors.

See also

Was this page helpful?