Collection
- class Collection(*, identifier: str, name: str, description: Annotated[str, MinLen(min_length=30)], resources: Annotated[list[str], MinLen(min_length=1)], authors: Annotated[list[Author], MinLen(min_length=1)], organizations: Annotated[list[Organization] | None, MinLen(min_length=1)] = None, context: str | None = None, references: list[str] | None = None)[source]
Bases:
BaseModelA collection of resources.
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
Attributes Summary
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
Methods Summary
add_triples(graph)Add triples to an RDF graph for this collection.
Get the JSON-LD context from a given collection.
Get the JSON-LD context as a string from a given collection.
Get the prefix map for a given collection.
Attributes Documentation
- model_config = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
Methods Documentation
- add_triples(graph: rdflib.Graph) None[source]
Add triples to an RDF graph for this collection.
- Parameters:
graph – An RDF graph
- Returns:
The RDF node representing this collection using a Bioregistry IRI.