# AUTO-GENERATED by dartfx.cdif.codegen — DO NOT EDIT MANUALLY.
"""CDIF Manifest profile extending Core with package schema:hasPart resources and archive parts."""
from __future__ import annotations
from typing import Annotated, Any, ClassVar
from pydantic import Field
from dartfx.cdif.models._base import CdifBaseModel
from dartfx.cdif.models.common import CdifConcept, LanguageTaggedValue, ManifestPart
from dartfx.cdif.models.profiles.core import CdifCoreDataset
from dartfx.cdif.namespaces import SCHEMA
from dartfx.rdf.pydantic import RdfProperty
[docs]
class CdifManifestMixin(CdifBaseModel):
"""
Profile module for packages: the resources that make up a dataset and where to retrieve each of them. Marks the
catalog record as conformant to the CDIF manifest spec (https://w3id.org/cdif/manifest/1.1) and declares
schema:hasPart in the two places a package needs it — on the Dataset, for parts that are independently accessible
at their own addresses, and on a schema:distribution item, for component files inside an archive (ZIP, etc.) that
have no address of their own. Both part shapes carry schema:about, so a part that describes another — a codebook,
a data dictionary, a metadata sidecar — can say which one. The base schema:distribution anyOf [DataDownload,
WebAPI] contributed by cdifCore is preserved — this BB only adds property constraints, no new anyOf branch.
(Merged from the previous cdifProfile/cdifArchive BB, which held only the $defs for ArchivePart; everything now
lives here.)
"""
has_part: Annotated[ManifestPart | list[ManifestPart] | None, RdfProperty(SCHEMA.hasPart)] = Field(
default=None,
alias="schema:hasPart",
description=(
"Component resources of a package whose parts are independently accessible, each with its own "
"distribution. Parts may differ in content type, format and data structure. For component files "
"inside an..."
),
)
[docs]
class CdifManifestDataset(CdifCoreDataset, CdifManifestMixin):
"""CDIF Manifest profile extending Core with package schema:hasPart resources and archive parts."""
rdf_type: ClassVar[Any] = [SCHEMA.Dataset]
cdif_profile_uri: ClassVar[str | None] = "https://w3id.org/cdif/manifest/2.0"
cdif_required_fields: ClassVar[tuple[str, ...]] = (
"@id",
"@type",
"@context",
"schema:name",
"schema:identifier",
"schema:dateModified",
"schema:subjectOf",
)
cdif_any_of_required: ClassVar[tuple[tuple[str, ...], ...]] = (
(
"schema:license",
"schema:conditionsOfAccess",
),
(
"schema:url",
"schema:distribution",
),
)
CdifManifestMixin.model_rebuild()
CdifManifestDataset.model_rebuild()
__all__ = ["CdifConcept", "CdifManifestDataset", "CdifManifestMixin", "LanguageTaggedValue"]