tilie_server.claim_columns#

The columns of a checked MatchClaim table, in the editor’s encoding.

The repository’s decisions/0029-match-claim-columns.md fixes the arrays and the encoding of a value; decisions/0030-match-claims-answer.md names the arrays of the answer. Every array is little-endian. The module needs numpy, pyarrow and timetoshare, which timetoalign brings in; the route imports it only when a request needs it.

tilie_server.claim_columns.SAFE = 9007199254740992#

Below this magnitude an int64 is a double exactly, so the IEEE quotient of two of them is the correctly rounded quotient.

tilie_server.claim_columns.Arrays#

Named arrays in the answer’s order: name, bytes, number of entries.

alias of list[tuple[str, bytes, int]]

tilie_server.claim_columns.axis_timelines(table, manifest)[source]#

The timelines the table names, sorted by ID, and each side’s numbers.

Parameters:
  • table (Table) – A MatchClaim table the checks accept against manifest.

  • manifest (Mapping[str, Any]) – The manifest, IDs bare.

Returns:

[{"id", "number_type"}], the number type of the manifest’s timeline (the checks hold every cell to it), and per row the index of side A’s and of side B’s timeline in that list.

Return type:

tuple[list[dict[str, str]], ndarray, ndarray]

tilie_server.claim_columns.value_column(anchors, side, number_types)[source]#

One value column: per row the position, numerator and denominator.

An int value is its integer over 1, a fraction value its lowest terms, each with the double nearest it (ties to even, as Python’s float); a float value is its double, -0.0 written 0.0, over 0/0. A row without the anchor holds zeros, which are not read.

Parameters:
  • anchors (StructArray) – The anchor column (null where a row has no such anchor).

  • side (str) – "a" or "b".

  • number_types (ndarray) – Per row the number type of the side’s timeline.

Return type:

tuple[ndarray, ndarray, ndarray]

tilie_server.claim_columns.manifest_bundle(manifest)[source]#

The manifest as timetoalign reads it, without MatchClaims.

Parameters:

manifest (Mapping[str, Any]) – The manifest as its file writes it (IDs #id).

Raises:

Refusal – 422 with timetoalign’s message if it refuses the manifest, at the path the refusal names (a rule of TimeToShare’s validators names the place in the manifest it breaks), else at [].

Return type:

AlignmentBundle

tilie_server.claim_columns.actor_context(manifest)[source]#

The JSON-LD context under which timetoalign compares the actors of the manifest’s MatchClaims (its belief_context).

Parameters:

manifest (Mapping[str, Any]) – The manifest, IDs bare.

Raises:

Refusal – As manifest_bundle().

Return type:

dict[str, Any] | None

tilie_server.claim_columns.row_beliefs(table, context)[source]#

Every row’s beliefs: its own, or the file’s where the file states them (the checks refuse a table stating both).

Parameters:
Returns:

The actors, each the IRI timetoalign compares it as (two spellings of one IRI are one actor), sorted by code point, and three arrays: per row the offset of its first belief (rows + 1 entries, the last the number of beliefs), per belief its actor’s index among the actors and its word’s index in BELIEFS, both in the row’s order.

Return type:

tuple[list[str], list[tuple[str, bytes, int]]]

tilie_server.claim_columns.columns_of(table, manifest)[source]#

The header’s members and the arrays of a checked MatchClaim table.

Parameters:
  • table (Table) – A MatchClaim table the checks accept against manifest.

  • manifest (Mapping[str, Any]) – The manifest, IDs bare.

Returns:

rows, timelines, actors (row_beliefs()) and beliefs (the belief words, a belief’s index naming its word), and the arrays in the answer’s order.

Raises:

Refusal – As actor_context().

Return type:

tuple[dict[str, Any], list[tuple[str, bytes, int]]]