# nationalgalleryofart/opendata architecture

> Architecture diagram of the GitHub repository nationalgalleryofart/opendata, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-08). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/nationalgalleryofart/opendata
- Repository: https://github.com/nationalgalleryofart/opendata

## Overview

This repository publishes the National Gallery of Art’s collection data as downloadable CSVs, with records for artworks and artists plus related collection information. Its principal workflow is extracting data from SQL Server, formatting it to match the published CSV conventions, and writing files to the data directory. The README also describes identifiers and image references as dataset capabilities; image files themselves are not included. The source excerpt shows the extractor’s structure and some table queries, but not every query or the full output-writing flow, so the graph keeps those relationships at the dataset level.

Main entry points: [`data`](https://github.com/nationalgalleryofart/opendata/tree/main/data) (Downloadable CSV dataset), [`scripts/extract_opendata.py`](https://github.com/nationalgalleryofart/opendata/blob/main/scripts/extract_opendata.py) (CSV extractor), [`data/objects.csv`](https://github.com/nationalgalleryofart/opendata/blob/main/data/objects.csv) (Artwork records), [`data/constituents.csv`](https://github.com/nationalgalleryofart/opendata/blob/main/data/constituents.csv) (Artist records)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_extract["Extraction"]
  node_extractor["CSV extractor"]
end

subgraph group_collection["Collection records"]
  node_objects["Artwork records<br/>[objects.csv]"]
  node_constituents["Artist records<br/>[constituents.csv]"]
  node_locations["Locations<br/>[locations.csv]"]
end

subgraph group_relationships["Related records"]
  node_object_details["Artwork details"]
  node_object_constituents["Artwork artists"]
  node_object_terms["Artwork terms<br/>[objects_terms.csv]"]
  node_historical["Historical data"]
  node_text_entries["Text entries"]
  node_identifiers["Alternative identifiers"]
  node_images["Published image references"]
end

subgraph group_publication["Open data"]
  node_csv_dataset["Downloadable CSV dataset"]
end

node_researchers(("Researchers and public"))
node_sqlserver[("Collection SQL Server")]

node_sqlserver -->|"provides source data"| node_extractor
node_extractor -->|"writes CSVs"| node_csv_dataset
node_csv_dataset -->|"supports research"| node_researchers
node_objects -->|"included in"| node_csv_dataset
node_constituents -->|"included in"| node_csv_dataset
node_locations -->|"included in"| node_csv_dataset
node_object_details -->|"included in"| node_csv_dataset
node_object_constituents -->|"included in"| node_csv_dataset
node_object_terms -->|"included in"| node_csv_dataset
node_historical -->|"included in"| node_csv_dataset
node_text_entries -->|"included in"| node_csv_dataset
node_identifiers -->|"included in"| node_csv_dataset
node_images -->|"includes references"| node_csv_dataset

click node_extractor "https://github.com/nationalgalleryofart/opendata/blob/main/scripts/extract_opendata.py"
click node_objects "https://github.com/nationalgalleryofart/opendata/blob/main/data/objects.csv"
click node_constituents "https://github.com/nationalgalleryofart/opendata/blob/main/data/constituents.csv"
click node_locations "https://github.com/nationalgalleryofart/opendata/blob/main/data/locations.csv"
click node_object_details "https://github.com/nationalgalleryofart/opendata/blob/main/data/objects_dimensions.csv"
click node_object_constituents "https://github.com/nationalgalleryofart/opendata/blob/main/data/objects_constituents.csv"
click node_object_terms "https://github.com/nationalgalleryofart/opendata/blob/main/data/objects_terms.csv"
click node_historical "https://github.com/nationalgalleryofart/opendata/blob/main/data/objects_historical_data.csv"
click node_text_entries "https://github.com/nationalgalleryofart/opendata/blob/main/data/objects_text_entries.csv"
click node_identifiers "https://github.com/nationalgalleryofart/opendata/blob/main/data/alternative_identifiers.csv"
click node_images "https://github.com/nationalgalleryofart/opendata/blob/main/data/published_images.csv"
click node_csv_dataset "https://github.com/nationalgalleryofart/opendata/tree/main/data"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_extractor toneBlue
class node_objects,node_constituents,node_locations,node_sqlserver toneAmber
class node_object_details,node_object_constituents,node_object_terms,node_historical,node_text_entries,node_identifiers,node_images toneMint
class node_csv_dataset toneRose
class node_researchers toneIndigo
```

## Components

### Extraction

- [CSV extractor](https://github.com/nationalgalleryofart/opendata/blob/main/scripts/extract_opendata.py): `scripts/extract_opendata.py`

### Collection records

- [Artwork records](https://github.com/nationalgalleryofart/opendata/blob/main/data/objects.csv): `data/objects.csv`
- [Artist records](https://github.com/nationalgalleryofart/opendata/blob/main/data/constituents.csv): `data/constituents.csv`
- [Locations](https://github.com/nationalgalleryofart/opendata/blob/main/data/locations.csv): `data/locations.csv`

### Related records

- [Artwork details](https://github.com/nationalgalleryofart/opendata/blob/main/data/objects_dimensions.csv): `data/objects_dimensions.csv`
- [Artwork artists](https://github.com/nationalgalleryofart/opendata/blob/main/data/objects_constituents.csv): `data/objects_constituents.csv`
- [Artwork terms](https://github.com/nationalgalleryofart/opendata/blob/main/data/objects_terms.csv): `data/objects_terms.csv`
- [Historical data](https://github.com/nationalgalleryofart/opendata/blob/main/data/objects_historical_data.csv): `data/objects_historical_data.csv`
- [Text entries](https://github.com/nationalgalleryofart/opendata/blob/main/data/objects_text_entries.csv): `data/objects_text_entries.csv`
- [Alternative identifiers](https://github.com/nationalgalleryofart/opendata/blob/main/data/alternative_identifiers.csv): `data/alternative_identifiers.csv`
- [Published image references](https://github.com/nationalgalleryofart/opendata/blob/main/data/published_images.csv): `data/published_images.csv`

### Open data

- [Downloadable CSV dataset](https://github.com/nationalgalleryofart/opendata/tree/main/data): `data`

### Other components

- **Researchers and public**
- **Collection SQL Server**

## Connections

- Collection SQL Server → CSV extractor: provides source data (evidence: `scripts/extract_opendata.py`)
- CSV extractor → Downloadable CSV dataset: writes CSVs (evidence: `scripts/extract_opendata.py`)
- Downloadable CSV dataset → Researchers and public: supports research (evidence: `README.md`)
- Artwork records → Downloadable CSV dataset: included in (evidence: `README.md`)
- Artist records → Downloadable CSV dataset: included in (evidence: `README.md`)
- Locations → Downloadable CSV dataset: included in (evidence: `README.md`)
- Artwork details → Downloadable CSV dataset: included in (evidence: `README.md`)
- Artwork artists → Downloadable CSV dataset: included in (evidence: `README.md`)
- Artwork terms → Downloadable CSV dataset: included in (evidence: `README.md`)
- Historical data → Downloadable CSV dataset: included in (evidence: `README.md`)
- Text entries → Downloadable CSV dataset: included in (evidence: `README.md`)
- Alternative identifiers → Downloadable CSV dataset: included in (evidence: `README.md`)
- Published image references → Downloadable CSV dataset: includes references (evidence: `README.md`)
