pub.techne.draft.query

A query over indexed records, as data: sent inline to pub.techne.draft.query.listRecords or countRecords, or published as a record in an app's own repo and run by its URI, so what an app reads is public. The platform runs it only over what the caller may read: every query is scoped to the viewer by the platform (public records not hidden; permissioned records the caller's own, or in a space whose read policy admits the caller now and not an act the reach limit withholds for its author: a held share or circle add), so there is no operator for access. Values that start with `$` are parameters: `$viewer` (the caller: compared with a DID, it matches any DID of the caller's person now, every account linked with the signed-in one, or only the signed-in DID while a sign-in method of one of them is frozen) and `$now` (the instant of the call) are filled by the platform, any other the caller passes in `params`; a published query is a template. Each record type declares which of its fields fill the shared roles in its `{collection}.query` document; a type with none is still listable by the roles every record has (`type`, `author`, `space`, `subject`, `written`, `uri`). Before running, the platform checks that every top-level `any` branch is driven by an index and refuses, naming the branch, if not. A feed is a query plus the signals it asks for plus its `weights`, which only the client applies. Draft tier.

Details · record, key any
Kindrecord
Record keyany
Authoritydraft.techne.pub
Commit rev3n3iob7p3ko2u
Indexed

Record

record · key any

Properties

any

array

Branches, each naming its own view, for a list that reads curated records of one kind and records as written of another in one request (a feed of curated events and beacons). A record that matches two branches comes once. Instead of `where` and `view`.

  • minLength: 1
  • maxLength: 8
itemsref
Reference

createdAt

string · datetime

curated

boolean

Deprecated: `view` replaced it. It has no default. Accepted beside `view` only when it agrees (true with `curated`, false with `asWritten`); alone, it is refused like a missing view, except from Beacon builds from before views through 2027-03-01, where true or absent reads unscoped branches curated and false reads every branch as written.

held

boolean

Only the signed-in caller's own permissioned records that the reach limit holds back from the people they would reach (each marked `held`; a held act, a share or a circle add, is answered to its author alone). No public record answers; an anonymous caller gets none.

  • default: false

limit

integer

The page size when the call names none.

  • minimum: 1
  • maximum: 500
  • default: 50

order

string

Exactly one thing to order by: a role (`written`, newest first; `start` or `end`, soonest first), a measure named by `as` (a `near` distance, nearest first; a `matches` rank, best first), or `shuffle` (one deterministic order per `seed`: the same seed answers the same order on every call and across pages; a shuffle sorts all its query matches, so every branch must be driven at its top by a `near` or by an author, space, subject, URI or reference with `is`/`in`). Ties break on the record URI. Default `written`. Ordering by a role lists only records that have it; a measure orders only a query with one branch (two branches could give one record two numbers).

  • maxLength: 64

seed

string

The seed of `order: shuffle`, a literal or a parameter (`$seed`); required with it and refused without it.

  • minLength: 1
  • maxLength: 256

signals

array

Numbers the platform attaches to each result from data the client does not have. They never filter.

  • maxLength: 8
itemsref
Reference

view

string

Which public records the branches of `where` read: `curated` (the commons' listed records: one curated record per thing, merged from its sources by a curator the commons root trusts, moderated, not hidden; an event only inside the supported areas) or `asWritten` (every public record as its author wrote it: each source copy and the curated record, not hidden, not superseded). Required with `where`, never beside `any` (each branch names its own there): there is no default. `curated` on a branch whose `type` names a type no curator covers is refused with NotCurated, naming the type. A permissioned record is read the same way in both views (it is never curated). Beacon builds from before views, which name none, are answered with the old default through 2027-03-01 (the last day).

  • maxLength: 16
  • knownValues: curated | asWritten

weights

array

For a feed: how the client combines measures and signals into one rank. The platform never reads them.

  • maxLength: 16
itemsref
Reference

What to select; with `view`. Give `where` or `any`, not both.

Reference

#branch

object

One branch of a query's `any`: its view and what it selects. A `where` whose top is itself an `any` makes one branch of each child, all in this view.

Properties

view

requiredstring

This branch's view: as the query's `view`.

  • maxLength: 16
  • knownValues: curated | asWritten

where

requiredref
Reference

#closeness

object

Graph hops from `from` (only `$viewer` today) to the result's author over the viewer-scoped graph walk: 0 for the viewer's own records (any DID of the viewer's person now); absent when the walk does not reach the author, and for an anonymous caller.

Properties

from

requiredstring
  • maxLength: 64

#condition

object

One operator and its value. A string value starting with `$` is a parameter.

Properties

after

string

An RFC-3339 instant, or a parameter (`$now`); strictly after.

  • maxLength: 64

as

string

The name of the number an operator produces (`near`: metres away; `matches`: rank), in letters, digits, `.`, `_` and `-`. Default `<role>.<operator>`.

  • maxLength: 64

before

string

An RFC-3339 instant, or a parameter (`$now`); strictly before.

  • maxLength: 64

covers

string

On `location`: a point (`<latitude>,<longitude>`, an H3 cell, or a `$param`) that a stated area contains.

  • maxLength: 64

followed

boolean

With `in` or `covers`: also match a record through the subject its type declares (a receipt through its recipient), one hop.

in

array

Any of these values; each is a value or a `$param` (a param holding a list adds all its values). On `location`: the areas (at most 8).

  • maxLength: 100
itemsstring
  • maxLength: 2048

is

string
  • maxLength: 2048

kind

string

With `in` or `covers`: the kind of stated location to match (`serves`, `registered`, ...). Default `at` (is at).

  • maxLength: 64

matches

string

Words the text must hold (all of them); the last word may be the start of a word, as typed so far. Produces a rank, best first.

  • maxLength: 256

near

ref
Reference

#has

object

`has`: some public record the caller may read (not hidden, not a hidden or suspended account's, not across a block) names this record through the role `via`, by this record's own author when `by` is `author`, and matches `where`. One index probe per record the branch reads; it narrows a branch and never drives one. It counts as one condition, plus one for each leaf in `where`. A `has` inside a `has` is refused.

Properties

by

string

`author`: only a record in this record's own author's repo. Any other value is refused.

  • maxLength: 16
  • knownValues: author

via

requiredstring

The other record's role that holds this record's AT-URI: a URI role every record has other than its own `uri` (today only `subject`).

  • maxLength: 64

What the other record also matches: `type` and/or `author` conditions (`is` or `in`), one alone or several under one `all`.

Reference

#near

object

Properties

point

requiredstring

`<latitude>,<longitude>` in degrees, or an H3 cell index of any resolution (its centre is the point), or a parameter (`$here`).

  • maxLength: 64

within

requiredstring

A radius such as `100m` or `5km`, at most 50km.

  • maxLength: 16

#node

object

One node of the `where` tree: exactly one property. `all` (every child holds), `any` (at least one holds; at the top level each child is a branch the platform runs on its own index), `not` (a list of one node that must not hold; it narrows and never drives a branch), `has` (some other record names this one; it narrows and never drives a branch), or a leaf naming one role with one condition. A leaf that produces a number (`near`, `matches`) is allowed only at the top of a branch.

Properties

all

array
  • maxLength: 16
itemsref
Reference

any

array
  • maxLength: 8
itemsref
Reference

The DID whose repo holds the record. Operators: is, in.

Reference

The record's category, one exact token (declared per type; a place's Overture `categories.primary`, e.g. `park`). Compared whole, never as a substring. Operators: is, in. It narrows a branch and never drives one.

Reference

end

ref

When it ends (declared per type; a type may assume a duration when the end is not stated, and then a start at a midnight in its own stated offset, never the reader's zone, runs at least to the next midnight in that offset, a day). Operators: before, after.

Reference

has

ref

Some public record the caller may read names this one through the role `via`. Under `not`, none does (an anti-join).

Reference

Where it is. Operators: near (declared per type: a point or cell within a radius, never an area); in (a list of up to 8 areas, each the AT-URI of an area record (a type whose query document declares `extent`; placeV2 today) or a `$param`: a stated location whose centre lies in one of them); covers (a point: an area the record states, such as one it serves, that contains the point). in and covers read every stated location (any type with a location or a subject), take `kind` and `followed`, are allowed only at the top of a branch, and give each record `matched`, the locations that matched (entry, kind, asserter, source; at most 8). They match public records only: the index they read holds public records, so a permissioned record never matches them (near does). In the curated view only the author's own locations and claims by writers the commons root endorses count, with the precedence rerun over them; as written every claim is weighed. A read whose `near` or `covers` point or `in` area lies outside this operator's coverage, or names an area not held here, is answered with `notServedHere`.

Reference

not

array

One node that must not hold.

  • minLength: 1
  • maxLength: 1
itemsref
Reference

AT-URIs it names in the fields its type declares, which may include its subject; a DID is named as its repo AT-URI `at://{did}`. Operators: is (names this one), in (names any of these).

Reference

The space a permissioned record counts in (at://{authority}/{spaceType}/{skey}); a public record is in none. Operators: is, in.

Reference

When the thing the record describes begins (declared per type). Operators: before, after.

Reference

The record the record is about (its indexed subject). Operators: is, in.

Reference

text

ref

Its words (declared per type). Operator: matches.

Reference

type

ref

The record's collection NSID. Operators: is, in.

Reference

uri

ref

The record's own AT-URI. Operators: is, in.

Reference

When the record was indexed. Operators: before, after.

Reference

#roles

queryRoleCatalog

The shared roles, as data: what each role is, the operators it takes, the index column that drives it, and the order it lists in. Kinds: `nsid`, `did`, `space`, `uri`, `uris` (a list of AT-URIs), `micros`, `instant`, `location`, `text`, and `token` (one exact string, compared whole: never a substring). `every` roles are on every record; the others are filled per type by its `{collection}.query` document. A new role is one generic column and its index, added once for every type, and goes through review like a new space policy.

#signal

object

One server-side signal: exactly one kind, and the name it is attached under.

Properties

as

string

Default: the signal's kind.

  • maxLength: 64
Reference

#weight

object

Properties

name

requiredstring

A measure or signal name.

  • maxLength: 64

weight

requiredstring

A decimal, as a string.

  • maxLength: 32

Similar lexicons

semantic match

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

  • The platform's generic list query: one page of the records a pub.techne.draft.query names, in its order. Every record is read through the platform's one read path, whatever the query says: no record of a hidden or suspended account is answered, nor, to a signed-in caller, another's record across a block either way (the caller blocked its author, or its author blocked the caller); a public record also leaves out anything moderation holds back (a trusted verdict or `!takedown`); a permissioned rec

  • Records by URI, as listRecords answers them: the query `{"view": "asWritten", "where": {"uri": {"in": uris}}}`, as written (a read scoped to named records), each only if the caller may read it. A URI the caller may not read, or that names nothing, is left out: as in every generic read, that includes a record whose author is blocked either way with a signed-in caller (see `includeBlockedByMe`), or whose account is hidden or suspended. In the order asked. With `curated`, each URI answers as the cu

  • How many records a pub.techne.draft.query names: the records listRecords would answer for it (the same read path, the platform's `decide` on every record answered as written or permissioned, and a curated `location` `in`/`covers` match settled again over the locations the curated view trusts), each once, so the count is what paging the list to its end would answer. The count stops at 1000 (`capped`). The query's `order`, `limit` and `signals` are ignored, so a record without the role a list is o

  • Up to 12 generic reads in one call. Each step is a pub.techne.draft.query.listRecords call (a list step) or a pub.techne.draft.query.getRecords call (a get step) and answers exactly as that method would for the same caller. A step runs once the steps it binds to have answered (at most 4 at once); the answer does not depend on which finished first. A binding, a string `$<step>.<output>` in a list step's `params` or among a get step's `uris`, stands for that output over the earlier step's records,