Graph libraries
The JavaScript and Python libraries offer the same operations and give the same answers. A test holds both to the list below.
The operations
| Operation | JavaScript | Python | Takes | Gives |
|---|---|---|---|---|
read | read | gql_profile.Store.apply | a data block's text | nothing; the graph is added to the store |
world | worldFromStore | graph_rules.World.from_store | a store | each graph by name, ready for the rules |
header | header | gql_profile.header | a block's text | the graph's name and the block's kind: data, schema, query, changeset or excerpt |
tokens | tokens | gql_profile.tokens | a block's text | every token: kind, text, line, as written, and where it ends |
check_syntax | checkSyntax | gql_profile.check_syntax | a block's text | nothing when the block is in the profile, else the ProfileError (returned, not raised) |
canon | canon | graph_rules.canon | a graph, as worldFromStore / World.from_store gives it | the graph's canonical hash, 64 lower-case hex digits (requirements/graph-spec-canonical.md) |
jcs | jcs | graph_rules.jcs | a value | its RFC 8785 JSON text |
hash16 | hash16 | graph_rules.hash16 | a value | the first 16 hex digits of the SHA-256 of its RFC 8785 JSON |
basis_hash | basisHash | graph_rules.basis_hash | a thing's properties; the property names read, comma-separated | the short hash of only those properties |
named | named | graph_rules.named | a hash's digits | the digits with their algorithm's name in front (requirements/hashes.md) |
is_named | isNamed | graph_rules.is_named | a value | whether it is a hash that names its algorithm |
changeset_header | changesetHeader | graph_rules.changeset_header | a change set's text | its header fields, or nothing when it has none |
check_changeset | checkChangeset | graph_rules.check_changeset | the base graphs; a change set's text; the type matrix (optional) | the rules' verdicts, the change set read, and a problem if it was refused |
check | check | graph_rules.check | a world; a graph's name; the type matrix (optional) | a verdict for each rule: its name, whether it holds, and why |
section20 | section20 | graph_rules.section20 | a graph, as worldFromStore / World.from_store gives it; the rule switches (optional) | a verdict for each certainty rule |
paths_rules | pathsRules | graph_rules.paths_rules | a graph, as worldFromStore / World.from_store gives it | a verdict for each path and altitude rule |
completeness | completeness | graph_rules.completeness | a graph, as worldFromStore / World.from_store gives it; today's date (optional) | the gaps found, by kind |
project | project | graph_rules.project | a graph, as worldFromStore / World.from_store gives it | the graph's blocks and links as plain data |
rebuild | rebuild | graph_rules.rebuild | a graph's name; its blocks; its links | the graph's text, written from them |
projects_back | projectsBack | graph_rules.projects_back | a graph, as worldFromStore / World.from_store gives it; its name | whether projecting and rebuilding gives the graph back |
lens_buckets | lensBuckets | graph_rules.lens_buckets | a graph, as worldFromStore / World.from_store gives it; a lens rule | which bucket each thing falls in, or nothing without a rule |
How a problem is reported
Raised as: ProfileError.
A problem code is never reused, so a code you stored always means what it meant.