Collection
- class Collection(*, identifier: str, name: str, description: Annotated[str, MinLen(min_length=30)], resources: Annotated[list[str | CollectionAnnotation], MinLen(min_length=1)], contributors: Annotated[list[Attributable], MinLen(min_length=1)], maintainers: Annotated[list[Author] | None, MinLen(min_length=1)] = None, logo: str | None = None, organizations: Annotated[list[Organization] | None, MinLen(min_length=1)] = None, context: str | None = None, references: list[str] | None = None, keywords: list[str] | None = None, mappings: list[Reference] | 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.
Get annotated prefixes.
Get prefixes.
has_organization(reference)Check if there is an organization with a given ROR.
Check if there is an organization with a given ROR.
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.
- as_context_jsonld() Mapping[str, Mapping[str, str]][source]
Get the JSON-LD context from a given collection.