timetoshare.tables.anchors#

From MatchClaims to AlignmentAnchors and potential MatchStamps.

The reference derivation of the format: small and exact, for conformance, not for speed. It reads a MatchClaim table the checks accept.

  • The belief filter selects the rows. Without a believer nothing is filtered; for a believer, a row is kept when its state for the believer is one of the states beliefs names (timetoshare.BELIEF_STATES): the believer’s belief in it ("true", "unlikely", "false"), or "undecided" where the believer holds none. The default keeps every state but "false". Actors compare as the IRIs they stand for under a JSON-LD context (timetoshare.expand_iri()), so a compact and an absolute IRI of one actor name the same actor; an actor that expands to nothing compares as written. Where a row holds beliefs of one believer under two spellings (which the table check refuses only under the manifest’s context), its state is the most critical of them: "false", then "unlikely", then "true".

  • A synchronous MatchClaim gives the anchor of its start_anchor and, if it has one, of its end_anchor, whatever its sides: two events, an event and CHUNK, or CHUNK on both (a CHUNK side gives its coordinate and no event); NOMATCH and conceptual MatchClaims give none. Two anchors are the same when both coordinates are equal, compared exactly on the two timelines’ axes, whichever side each stands on.

  • A potential MatchStamp is one connected set of coordinates under the unique anchors.

class timetoshare.tables.anchors.AlignmentAnchor(coordinates)[source]#

Bases: object

Two coordinates of two timelines, in sorted order: no metadata.

class timetoshare.tables.anchors.PotentialMatchStamp(coordinates, alignment_anchors, match_claims)[source]#

Bases: object

The coordinates one chain of anchors joins, sorted, with the anchors joining them and the MatchClaims stating those, each sorted.

class timetoshare.tables.anchors.TimelineCoordinate(timeline_id, value)[source]#

Bases: object

A coordinate of a timeline: its ID and the exact value on its axis.

A timeline’s coordinates share one unit and one number type (the checks hold it), so the value alone tells two of them apart.

timetoshare.tables.anchors.alignment_anchors(table, believer=None, beliefs=('true', 'undecided', 'unlikely'), *, context=None)[source]#

The unique anchors of the rows the filter keeps, sorted, each with the sorted IDs of the MatchClaims stating it.

timetoshare.tables.anchors.believed_rows(table, believer=None, beliefs=('true', 'undecided', 'unlikely'), *, context=None)[source]#

The rows the belief filter keeps, by index.

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

  • believer (str | None) – The actor whose beliefs filter, an IRI (compact or absolute); None keeps every row.

  • beliefs (Collection[Literal['true', 'undecided', 'unlikely', 'false']]) – The states kept (timetoshare.BELIEF_STATES), a collection; empty keeps no row for a believer.

  • context (Mapping[str, Any] | None) – The JSON-LD context (the manifest’s @context) whose prefixes expand compact IRIs, the believer’s and the actors’ alike; None declares no prefix.

Raises:

ValueError – If beliefs is a single string or names a word that is none of timetoshare.BELIEF_STATES (timetoshare.check_belief_filter()).

timetoshare.tables.anchors.potential_matchstamps(table, believer=None, beliefs=('true', 'undecided', 'unlikely'), *, context=None)[source]#

The potential MatchStamps of the rows the filter keeps, sorted by their first coordinate.