Schemas¶
Replaces data to load with any object with same name in “mentioned”.
Remove field that may have been used to link objects to
Opinion
text.
Make a specified field a list if it isn’t already a list.
This will repeat an operation that already happened if
expand_anchor_shorthand()
was already called inload_holdings()
.
Nest fields used for
SelectorSchema
model.If the fields are already nested, they need not to be moved.
The fields can only be moved into a “selector” field with a dict value, not a “selectors” field with a list value.
Create pint quantity object from text.
See pint tutorial
- Parameters
quantity – when a string is being parsed for conversion to a
Predicate
, this is the part of the string after the equals or inequality sign.- Return type
- Returns
a Python number object or a
Quantity
object created with pint.UnitRegistry.
Convert quantity to string if it’s a pint ureg.Quantity object.
Prepare
RawFact
to load, replacing name references with full objects.Unlike the
name_index.collect_mentioned()
function, this function can’t add any entries to the “mentioned” name index (due to limitations in the Marshmallow serialization library). That means all shorthand references to factors need to have been expanded before using the schema to load new objects.
Preprocess data before selecting from among the linked schema options.
To be replaced by a function that would have used the @pre_load decorator, if it was available for OneOfSchema objects.
Returns name of object schema
- Return type
Find the Marshmallow schema for an AuthoritySpoke object.
- Return type
Schema