Skip to content

Commit 22d914d

Browse files
committed
doc: Add documentation for DANDI models
This documentation is not about the specifics of the models themselves, but how they are defined, transformed, and used in DANDI's ecosystem.
1 parent 9ecf515 commit 22d914d

File tree

2 files changed

+59
-0
lines changed

2 files changed

+59
-0
lines changed

docs/21_models.md

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

mkdocs.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ nav:
4747
- DANDI CLI and Python API: https://dandi.readthedocs.io
4848
- Developer Guide:
4949
- Project Structure: "20_project_structure.md"
50+
- DANDI Models: "21_models.md"
5051
- Notes: "40_development.md"
5152
- REST API Swagger: https://api.dandiarchive.org/swagger
5253
- REST API Redoc: https://api.dandiarchive.org/redoc

0 commit comments

Comments
 (0)