timetoshare.tables.checks#

The checks of the MatchClaim table and the Projections table.

Each *_problems function lists every problem it finds, the table’s own first, then row by row; each check_* function raises the first as a TableError. A table may hold columns its type does not declare; they are kept and never checked.

exception timetoshare.tables.checks.TableError(problem)[source]#

Bases: ValueError

A table breaks a rule; problem is the first problem found.

class timetoshare.tables.checks.TableProblem(code, row, column, message)[source]#

Bases: object

One problem of a table: its code, its row (None for the whole table), the path of its column and its message.

timetoshare.tables.checks.check_match_claims(table, manifest=None)[source]#

Raise TableError for the first problem of a MatchClaim table.

timetoshare.tables.checks.check_projections(table, manifest=None)[source]#

Raise TableError for the first problem of a Projections table.

timetoshare.tables.checks.check_succession(old, new)[source]#

Raise TableError for the first breach of the succession rule.

timetoshare.tables.checks.match_claim_problems(table, manifest=None)[source]#

Every problem of a MatchClaim table, checked against a manifest (as read from its file, IDs written #) where one is given.

A MatchClaim’s ID is unique in the table, which belongs to one manifest. An actor holds one belief in a row; against a manifest, actors are compared as the IRIs they stand for under its @context, so a compact and an absolute IRI of one actor are one actor, else as written.

timetoshare.tables.checks.projection_problems(table, manifest=None)[source]#

Every problem of a Projections table, checked against a manifest (as read from its file, IDs written #) where one is given.

A Projection’s ID is unique in the package, as every event’s: two timelines never both hold projection_1.

timetoshare.tables.checks.row_provenance(table)[source]#

The provenance of every row of a checked MatchClaim table: its own, or the file’s where the row states none.

timetoshare.tables.checks.succession_problems(old, new)[source]#

Every breach of the succession rule by new written over old.

Both are checked MatchClaim tables. A MatchClaim is its ID alone; a column the type does not declare takes no part. Every MatchClaim of old is in new, and its row has the same value in every column but provenance; a coordinate is the same when its unit, number type and exact value are, so 2/4 and 1/2 are one coordinate. The rows of new are reported by their index in new.