Profile Registry & Loader
Profile registry, conformance detection, and CDIF document loading helpers.
- class dartfx.cdif.registry.ProfileInfo(key, uris, model_class, schema_path, frame_path, shacl_path, description)[source]
Bases:
objectRegistered CDIF profile metadata and associated Pydantic + RDF root model.
- Parameters:
key (str)
uris (tuple[str, ...])
model_class (type[CdifBaseModel] | None)
schema_path (str)
frame_path (str)
shacl_path (str)
description (str)
- key: str
- uris: tuple[str, ...]
- model_class: type[CdifBaseModel] | None
- schema_path: str
- frame_path: str
- shacl_path: str
- description: str
- class dartfx.cdif.registry.ProfileRegistry[source]
Bases:
objectRegistry mapping CDIF profile keys and URIs to Pydantic + RDF models.
- list_profiles()[source]
Return all registered profiles in canonical order.
- Return type:
list[ProfileInfo]
- get(key_or_uri)[source]
Look up a profile by short key (e.g.
'discovery') or URI.- Parameters:
key_or_uri (str)
- Return type:
- declared_profiles(data)[source]
Return known CDIF profiles explicitly declared via
schema:subjectOf.dcterms:conformsTo.- Parameters:
data (dict[str, Any] | CdifBaseModel)
- Return type:
list[ProfileInfo]
- detect(data)[source]
Detect CDIF profiles declared or implied by a JSON-LD dict or model instance.
- Parameters:
data (dict[str, Any] | CdifBaseModel)
- Return type:
list[ProfileInfo]
- select_model(profiles)[source]
Choose the most specific
CdifBaseModelclass covering all detected profiles.- Parameters:
profiles (list[ProfileInfo])
- Return type:
- dartfx.cdif.registry.detect_profiles(data)[source]
Detect CDIF profiles declared or implied by a document or model instance.
- Parameters:
data (dict[str, Any] | CdifBaseModel)
- Return type:
list[ProfileInfo]
- dartfx.cdif.registry.get_profile(key_or_uri)[source]
Look up a CDIF profile by key or URI from the default registry.
- Parameters:
key_or_uri (str)
- Return type: