|
| 1 | +# Integrating DANDI Metadata Models Across the Ecosystem |
| 2 | + |
| 3 | +**DANDI metadata models** are defined as |
| 4 | +[Pydantic models](https://github.com/dandi/dandi-schema/blob/master/dandischema/models.py) |
| 5 | +in [**dandischema**](https://github.com/dandi/dandi-schema) and transformed into |
| 6 | +[JSON schemas](https://github.com/dandi/schema). **Both** representations, |
| 7 | +the original Pydantic definitions and JSON schemas, are used across the DANDI ecosystem. |
| 8 | +The diagram below outlines how these two representations are integrated into various |
| 9 | +components, including the CLI, the backend/API, and the web interface. |
| 10 | + |
| 11 | +For more information, follow the links in the diagram to the respective repositories and files. |
| 12 | + |
| 13 | + |
| 14 | +``` mermaid |
| 15 | +--- |
| 16 | +config: |
| 17 | + layout: dagre |
| 18 | +--- |
| 19 | +flowchart TD |
| 20 | + subgraph subGraph0["<a href=https://github.com/dandi/dandi-schema>dandi/dandischema</a>"] |
| 21 | + dandi_pydantic@{ label: "<a href=\"https://github.com/dandi/dandi-schema/blob/master/dandischema/models.py\">dandi/dandischema::models.py</a><br>(Pydantic models)" } |
| 22 | + dandi_validate@{ label: "<a href=\"https://github.com/dandi/dandi-schema/blob/c3007768e002c9f51ea37b5e6b3628f7f7f20943/dandischema/metadata.py#L195\">dandi/dandischema::validate()</a><br>(Validation helper)" } |
| 23 | + dandi_json_runtime["Latest JSON Schema models"] |
| 24 | + end |
| 25 | + subgraph subGraph1["<a href=https://github.com/dandi/dandi-archive>dandi/dandi-archive</a>"] |
| 26 | + dandi_archive_db[("PostgresDB")] |
| 27 | + dandi_archive_backend@{ label: "<a href=\"https://api.dandiarchive.org\">api.dandiarchive.org</a><br>(Backend/API)" } |
| 28 | + dandi_archive_frontend@{ label: "<a href=\"https://www.dandiarchive.org\">www.dandiarchive.org</a><br>(Frontend/Web UI)" } |
| 29 | + meditor["Meditor<br>(vjsf-based web form)"] |
| 30 | + dandi_archive_validate[/"Celery task to validate<br>dandiset and asset metadata"/] |
| 31 | + end |
| 32 | +
|
| 33 | + %% nodes |
| 34 | + dandi_cli@{ label: "<a href=\"https://github.com/dandi/dandi-cli\">dandi-cli</a><br>(Python client lib and CLI)" } |
| 35 | + ci@{ label: "<a href=\"https://github.com/dandi/dandi-schema/blob/master/.github/workflows/release.yml\">GitHub CI</a>" } |
| 36 | + dandi_json@{ label: "<a href=\"https://github.com/dandi/schema\">dandi/schema</a><br>(Versions of JSON Schema models)" } |
| 37 | +
|
| 38 | + %% edges |
| 39 | + dandi_pydantic -- Used by --> dandi_cli & dandi_validate & ci |
| 40 | + dandi_pydantic -- Used for generating --> dandi_json_runtime |
| 41 | + dandi_json_runtime -- Used by --> dandi_validate |
| 42 | + ci -- Generates<br> JSON Schema models<br> per model release --> dandi_json |
| 43 | + dandi_json -- Used by (for any versions) --> dandi_validate |
| 44 | + dandi_json -- Used by --> dandi_archive_frontend |
| 45 | + dandi_validate -- Used by --> dandi_archive_validate |
| 46 | + dandi_archive_backend -- Schedules --> dandi_archive_validate |
| 47 | + dandi_archive_backend <---> dandi_archive_db |
| 48 | + dandi_cli -- Extracts and uploads<br>metadata for assets --> dandi_archive_backend |
| 49 | + dandi_archive_frontend -- Generates --> meditor |
| 50 | + web_input["User input through web form"] -- Restricted by --> meditor |
| 51 | + meditor -- Stores user inputs through --> dandi_archive_backend |
| 52 | + dandi_archive_validate -- Records validation status --> dandi_archive_db |
| 53 | +
|
| 54 | + %% styles |
| 55 | + dandi_json@{ shape: docs} |
| 56 | + dandi_cli@{ shape: rect} |
| 57 | + ci@{ shape: rect} |
| 58 | + web_input@{ shape: manual-input} |
| 59 | + dandi_pydantic@{ shape: rect} |
| 60 | + dandi_validate@{ shape: rect} |
| 61 | + dandi_json_runtime@{ shape: doc} |
| 62 | + dandi_archive_backend@{ shape: rect} |
| 63 | + dandi_archive_frontend@{ shape: rect} |
| 64 | +``` |
0 commit comments