Skip to content

followthemoney.schema.Schema

A type definition for a class of entities that have certain properties.

Schemata are arranged in a multi-rooted hierarchy: each schema can have multiple parent schemata from which it inherits all of their properties. A schema can also have descendant child schemata, which, in turn, add further properties. Schemata are usually accessed via the model, which holds all available definitions.

description property

A longer description of the semantics of the schema.

edge_label property

Description label for edges derived from entities of this schema.

label property

User-facing name of the schema.

matchable_schemata property

Return the set of schemata to which it makes sense to compare with this schema. For example, it makes sense to compare a legal entity with a company, but it does not make sense to compare a car and a person.

plural property

Name of the schema to be used in plural constructions.

sorted_properties property

All properties of the schema in the order in which they should be shown to the user (alphabetically, with captions and featured properties first).

source_prop property

The entity property to be used as an edge source when the schema is considered as a relationship.

target_prop property

The entity property to be used as an edge target when the schema is transformed into a relationship.

temporal_end property

The entity properties to be used as the end when representing the entity in a timeline.

temporal_end_props property

The entity properties to be used as the end when representing the entity in a timeline.

temporal_start property

The entity properties to be used as the start when representing the entity in a timeline.

temporal_start_props property

The entity properties to be used as the start when representing the entity in a timeline.

__eq__(other)

Compare two schemata (via hash).

can_match(other) cached

Check if an schema can match with another schema.

generate(model)

While loading the schema, this function will validate and load the hierarchy, properties, and flags of the definition.

get(name)

Retrieve a property defined for this schema by its name.

is_a(other) cached

Check if the schema or one of its parents is the same as the given candidate other.

to_dict()

Return schema metadata, including all properties, in a serializable form.

validate(data)

Validate a dictionary against the given schema. This will also drop keys which are not valid as properties.