Schemas¶
Marshmallow schemas for loading AuthoritySpoke objects from JSON.
Base schema for classes that can be cross-referenced by name in input JSON.
Replace data to load with any object with same name in “mentioned”.
Verify that type field is correct and then get rid of it.
Make a specified field a list if it isn’t already a list.
Expand data if it was just a name reference in the JSON input.
Make AuthoritySpoke object out of whatever data has been loaded.
Schema for Decision citations in CAP API response.
Load citation.
- Return type
CaseCitation
Schema for Opinions, of which there may be several in one Decision.
Schema for decisions retrieved from Caselaw Access Project API.
Convert quantity to string if it’s a pint ureg.Quantity object.
Schema for statements, separate from any claim about their truth or who asserts them.
Find any reference to a quantity in the content text.
Reduce the number of possible symbols to represent comparisons.
Schema for Entities, which shouldn’t be at the top level of a FactorGroup.
Schema for Facts, which may contain arbitrary levels of nesting.
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.
Make Fact.
- Return type
Schema for an object that may embody a statement.
Make Exhibit.
- Return type
Schema for a document to link Allegations to.
Schema for an Allegation of a Fact.
Schema for an Exhibit and a reference to the Fact it would support.
Schema that directs data to “one of” the other schemas.
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.
Return name of object schema.
- Return type
Schema for Procedure; does not require separate FactorSequence schema.
“FactorSchema, many=True” is an equivalent of a FactorSequence.
Handle omission of brackets around single item.
Schema for Holding; can also hold Procedure fields.
Prepare to load Rule.
Make AuthoritySpoke object out of whatever data has been loaded.
Schema for Holding; can also hold Rule and Procedure fields.
Nest fields inside “rule” and “procedure”, if not already nested.
Find the Marshmallow schema for an AuthoritySpoke object.
- Return type
Schema