at.tensei.mapping

One source collection → user-shaped output (§4.1). Also defines the field, expression and presentation types that at.tensei.pipeline refers to.

Repository @tensei.at did:plc:7fk7ea7vlnlpzgy225x66vro namespace authority
Details · record, key tid
Kindrecord
Record keytid
Authoritytensei.at
Indexed

Showing version bafyreig2bpqv37ks53qr7dslaoedhmgbnquum5yndxhmp7iabxrsxpxrse. Show the latest

Record

record · key tid

Properties

createdAt

string

When the mapping was created: a datetime as §3.1 reads one, which accepts forms atproto's `datetime` format does not, so the format is not declared.

guards

array

§5 predicate leaves over source paths (§4.1); no all/any/not groups.

itemsref
Reference

Present on an adopted copy: the exact version copied (§1.3). Attribution and update-check input; execution never reads it.

Reference

For a standalone preview and to keep a migrated draft's choices; a pipeline's own presentation is authoritative after downstream edits (§3.8). Its entries must name fields in slots.

Reference
Reference

slots

requiredunknown

The output fields: an object keyed by field names the user chooses, any non-empty name and not limited to a preset's, each value a #mappingField. The lexicon language has no map type, so the names and values are stated here rather than declared.

source

requiredstring · nsid

The NSID of the collection this mapping reads, and the only place its field names appear.

version

requiredinteger

The document version. A document without one is the Phase-2 fixed-preset form, which is migrated explicitly to version 1 (§8.3) and never published as it is.

  • const: 1

viewType

string

The built-in preset this mapping started from, as attribution only. It never adds, limits or requires a field (§3.8).

  • enum: review | bookmark

#fieldDefinition

object

A field's declared type and authored requiredness (§3.1). `required` is always written; validation supplies no default.

Properties

required

requiredboolean

type

requiredref
Reference

#fieldType

object

A declared output type (§3.1). `namespace` is required when `kind` is key and names the key namespace (§3.6).

Properties

kind

requiredstring
  • enum: text | text[] | number | bool | datetime | uri | did | ref | media | score | key | json
Reference

#guard

object

A §5 leaf. `field` is a §4.2 source path. `value` is a scalar (a string, a finite number or a boolean; never null or an object), or for in/notIn an array of scalars, and is absent for exists/notExists; the lexicon language has no type for a scalar of any kind, so `value` is not declared.

Properties

field

requiredstring
  • minLength: 1

op

requiredref
Reference

#keyNamespace

string
  • enum: isbn | olwork | goodreads | hive | tmdb | url

#mappingExpression

object

A source-mapping expression (§4.3): path {path}, constant {value}, operation {op, inputs, args?} or lookup {input, from, to}. Not stated by the lexicon: which properties each kind requires; `value`, any JSON value; `args`, whose count and types each operation fixes (a string separator for split, join and concat, a string find and replacement for replace, an optional string format for parseDate, a finite non-zero divisor for divide, none otherwise); the input count (one, or one or more for coalesce and concat); §4.2 path syntax; and a nesting depth of at most 64 levels.

Properties

from

ref
Reference
Reference

inputs

array
itemsref
Reference

kind

requiredstring
  • enum: path | constant | operation | lookup

op

ref
Reference

path

string
  • minLength: 1

to

ref
Reference

#mappingField

object

One output field of a mapping (§4.1): a #fieldDefinition plus how this source fills it. An unmapped field has no `expr`. `confidence`, a number from 0 to 1, is proposal metadata; the lexicon language has no non-integer number type, so it is not declared.

Properties

by

string
  • enum: constraint | name | stats | model | human

expr

ref
Reference

required

requiredboolean

type

requiredref
Reference

#normalization

object

Source-specific input normalization (§4.1), not part of the shared field type. A mapped score field needs {kind: score, scale}, a mapped media field {kind: media, mediaKind}, and canonical {namespace} belongs on a uri field only. `scale` is {min, max}, finite numbers with min < max; the lexicon language has no non-integer number type, so they are not declared.

Properties

kind

requiredstring
  • enum: score | media | canonical

mediaKind

string
  • enum: blob | url
Reference
Reference

#operationName

string

§4.3's closed list of operations. A new operation is a spec change, not an extension point.

  • enum: split | join | wrap | first | trim | lower | replace | divide | parseDate | coalesce | concat

#origin

object

The original record an independent copy was made from (§1.3, §8.3).

Properties

cid

requiredstring · cid

The CID of the exact version copied. The `cid` format accepts any spelling of a CID; the validator accepts only the form atproto writes: version 1, in base32, over a SHA-256 digest.

uri

requiredstring · at-uri

The record copied. Not stated by the lexicon, and enforced by the validator: exactly at://<DID>/<collection NSID>/<record key>, with a DID rather than a handle for its authority.

#predicateOp

string

§5's closed list of operators.

  • enum: eq | ne | lt | lte | gt | gte | contains | notContains | startsWith | matches | exists | notExists | in | notIn

#presentation

object

How the output is shown (§3.8); it never changes data or requiredness. Entries are unique by `field`, each names a field of the shape it presents, and `display` is allowed on a score field only.

Properties

fields

requiredarray
itemsref
Reference

layout

requiredstring
  • enum: list | table | review | bookmark

#presentationField

object

Properties

display

string
  • enum: stars5 | stars10 | percent | raw

field

requiredstring
  • minLength: 1

label

string

visible

requiredboolean

#scale

object

A source's score scale (§3.4): {min, max}, finite numbers with min < max, not declared because they need not be integers.

#schemaPin

object

The schema version the mapping was written against (§4.1, §11). Not stated by the lexicon, and enforced by the validator: `nsid` is the mapping's `source`; a published pin has `cid` and no `hash`, an inferred one `hash` and no `cid`.

Properties

cid

string · cid

A published pin's version: the CID of the lexicon record. The `cid` format accepts any spelling of a CID; the validator accepts only the form atproto writes: version 1, in base32, over a SHA-256 digest.

hash

string

An inferred pin's version: `sha256:` and 64 lowercase hex digits, a form the lexicon language cannot state.

  • minLength: 1

nsid

requiredstring · nsid

provenance

requiredstring
  • enum: published | inferred

When the version was resolved: a datetime as §3.1 reads one, which accepts forms atproto's `datetime` format does not, so the format is not declared.

Similar lexicons

semantic match

Lexicons whose schemas describe something close to this one. Check them before publishing a new one that overlaps.

  • A Tensei pipeline, version 1 (spec §6, §7): source nodes reading through mappings, downstream nodes over the fields the user authored, and one output. Shapes on wires are derived from the graph, never stored. The atproto data model has integers only, so a number in the record is an integer written as it is, or any other number as an at.tensei.mapping#fixedPoint, the value times 10⁶ (spec §1.5). Where the lexicon language cannot state a rule the version-1 validator enforces, the property is left