Metadata-Version: 2.4
Name: fairscape-models
Version: 1.2.3
Summary: Fairscape pydantic models
Home-page: https://github.com/fairscape/fairscape_models
Author: Justin Niestroy
Author-email: Justin Niestroy <jniestroy@gmail.com>
License-Expression: Apache-2.0
Project-URL: Homepage, https://github.com/fairscape/fairscape_models
Classifier: Operating System :: OS Independent
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: pydantic>=2.5
Requires-Dist: pymongo
Requires-Dist: typing
Requires-Dist: mongomock
Requires-Dist: pyyaml>=6.0.3
Requires-Dist: importlib_resources; python_version < "3.9"
Provides-Extra: schema-tabular
Requires-Dist: frictionless<6.0,>=5.0; extra == "schema-tabular"
Requires-Dist: pyarrow>=14; extra == "schema-tabular"
Requires-Dist: pandas; extra == "schema-tabular"
Provides-Extra: schema-hdf5
Requires-Dist: h5py; extra == "schema-hdf5"
Provides-Extra: schema-signal
Requires-Dist: wfdb; extra == "schema-signal"
Provides-Extra: schema-image
Requires-Dist: pydicom; extra == "schema-image"
Provides-Extra: schema-infer
Requires-Dist: frictionless<6.0,>=5.0; extra == "schema-infer"
Requires-Dist: pyarrow>=14; extra == "schema-infer"
Requires-Dist: pandas; extra == "schema-infer"
Requires-Dist: h5py; extra == "schema-infer"
Requires-Dist: wfdb; extra == "schema-infer"
Requires-Dist: pydicom; extra == "schema-infer"
Dynamic: author
Dynamic: home-page
Dynamic: license-file
Dynamic: requires-python

# fairscape_models

Pydantic models that define the canonical data shape for Fairscape RO-Crate releases. This package is the **source of truth**: the JSON Schemas, TypeScript types, and the EVI OWL/RDFS vocabulary published with the Fairscape profile are all generated from the classes in `fairscape_models/`.

## What's in here

| Path | What it is |
|---|---|
| `fairscape_models/*.py` | Pydantic class definitions: `Dataset`, `Software`, `MLModel`, `Computation`, `Annotation`, `Experiment`, `Schema`, `Sample`, `Instrument`, `Patient`, `ModelCard`, `AnnotatedComputation`, `AnnotatedEvidenceGraph`, `ROCrateMetadataElem`, `ROCrateV1_2`, … |
| `fairscape_models/conversion/` | Crosswalks: Datasheet-for-Datasets (LinkML), Croissant / Croissant-RAI 1.0. |
| `json-schemas/` | Per-class JSON Schemas, generated by `scripts/generate_json_schemas.py`. |
| `typescript-types/` | TypeScript `.d.ts` declarations, generated by `scripts/generate_ts_types.py`. |
| `js/` | JavaScript bindings. |
| `profiles/evi-vocabulary.ttl` | OWL/RDFS vocabulary for the EVI namespace, generated by `scripts/generate_profile.py`. Contains the class hierarchy, property domains/ranges, and `owl:Restriction` cardinality blocks. |
| `profiles/profile.ttl` | W3C PROF manifest for the Fairscape profile (see below). |
| `tests/` | pytest suite. Test fixtures under `tests/test_rocrates/` are real conforming crates. |

## Profile

This package implements the **Fairscape Release RO-Crate Profile v0.1**:

- Profile URI: <https://w3id.org/fairscape/profile/0.1>
- Specification: <https://fairscape.github.io/profile/0.1/>
- PROF manifest: [`profiles/profile.ttl`](profiles/profile.ttl)
- EVI vocabulary: [`profiles/evi-vocabulary.ttl`](profiles/evi-vocabulary.ttl)

Every crate produced from the `ROCrateMetadataElem` model declares `dct:conformsTo: https://w3id.org/fairscape/profile/0.1` on its Root Data Entity. This is the conformance signal — the Root entity's `@type` stays `["Dataset", "https://w3id.org/EVI#ROCrate"]` and never includes `"Profile"`. (Only the hand-authored Profile Crate published at the profile URI is `Profile`-typed.)

## Regenerating derived artifacts

```bash
python scripts/generate_json_schemas.py
python scripts/generate_ts_types.py
python scripts/generate_profile.py profiles/evi-vocabulary.ttl
```

## Tests

```bash
pytest
```
