# big-map/battinfo architecture

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

- Interactive diagram: https://gitdiagram.com/big-map/battinfo
- Repository: https://github.com/big-map/battinfo

## Overview

BattINFO is a battery-metadata library, CLI, and web application for authoring records, validating them, exporting semantic Linked Data, and publishing them. Its documented user path runs from cell or workspace authoring through local persistence to publication; it also supports parameter and material records, BPX interoperability, and web-based create, validate, convert, and publish experiences. The graph preserves these product branches while distinguishing the documented workflow from relationships visible in the sampled source index. Unsampled implementations are represented only where the README establishes their capability.

Main entry points: [`src/battinfo/api/_records.py`](https://github.com/big-map/battinfo/blob/main/src/battinfo/api/_records.py) (Record store API), [`src/battinfo/bundle.py`](https://github.com/big-map/battinfo/blob/main/src/battinfo/bundle.py) (Record models), [`src/battinfo/_workspace.py`](https://github.com/big-map/battinfo/blob/main/src/battinfo/_workspace.py) (Authoring workspace), [`src/battinfo/publication.py`](https://github.com/big-map/battinfo/blob/main/src/battinfo/publication.py) (Publication)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_authoring["Authoring and records"]
  node_workspace["Authoring workspace<br/>[_workspace.py]"]
  node_record_models["Record models<br/>[bundle.py]"]
  node_entity_catalog["Record types and identity<br/>[entities.py]"]
  node_materials["Materials and electrodes<br/>[materials.py]"]
  node_record_api["Record store API<br/>[_records.py]"]
  node_parameter_api["Parameter-set API<br/>[_parameters.py]"]
  node_persistence["JSON persistence<br/>[_jsonio.py]"]
  node_record_index[("Record index<br/>[_record_index.py]")]
end

subgraph group_semantics["Validation and semantics"]
  node_validation["Validation policy and reports<br/>[core.py]"]
  node_semantic_validation["Semantic validation<br/>[semantic.py]"]
  node_jsonld_transform["JSON-LD transformation<br/>[json_to_jsonld.py]"]
  node_jsonld["JSON-LD export<br/>[jsonld.py]"]
end

subgraph group_interop["Interoperability"]
  node_ingest["Data ingestion<br/>[ingest.py]"]
  node_bpx["BPX import and export<br/>[bpx.py]"]
  node_converter["Format conversion<br/>[converter.py]"]
end

subgraph group_delivery["Publishing and web"]
  node_publication["Publication<br/>[publication.py]"]
  node_registry["Registry API<br/>[_records.py]"]
  node_web_create["Web authoring<br/>[page.tsx]"]
  node_web_validate["Web validation<br/>[page.tsx]"]
  node_web_convert["Web conversion<br/>[page.tsx]"]
  node_web_publish["Web publishing<br/>[page.tsx]"]
end

node_user(("Battery data author"))
node_local_store[("Local workspace files")]
node_external_registry(("BattINFO registry"))
node_zenodo(("Zenodo"))

node_user -->|"authors records"| node_workspace
node_user -->|"creates cell spec"| node_record_models
node_workspace -->|"authors records"| node_record_models
node_workspace -->|"uses record operations"| node_record_api
node_workspace -->|"uses record types"| node_entity_catalog
node_record_api -->|"uses models"| node_record_models
node_record_api -->|"uses identity rules"| node_entity_catalog
node_record_api -->|"validates records"| node_validation
node_parameter_api -->|"uses models"| node_record_models
node_parameter_api -->|"resolves materials"| node_materials
node_record_api -->|"reads and writes"| node_persistence
node_record_api -->|"indexes records"| node_record_index
node_workspace -->|"saves records"| node_local_store
node_record_api -->|"stores records"| node_local_store
node_record_models -->|"exports as Linked Data"| node_jsonld_transform
node_jsonld -->|"uses transformation"| node_jsonld_transform
node_jsonld_transform -->|"uses record definitions"| node_entity_catalog
node_record_api -->|"checks semantics"| node_semantic_validation
node_semantic_validation -->|"reports issues"| node_validation
node_user -->|"imports data"| node_ingest
node_bpx -->|"maps BPX records"| node_record_models
node_user -->|"exchanges BPX"| node_bpx
node_user -->|"converts data"| node_converter
node_user -->|"publishes records"| node_publication
node_publication -->|"publishes records"| node_external_registry
node_publication -.->|"supports deposits"| node_zenodo
node_user -->|"authors online"| node_web_create
node_user -->|"validates online"| node_web_validate
node_user -->|"converts online"| node_web_convert
node_user -->|"publishes online"| node_web_publish

click node_workspace "https://github.com/big-map/battinfo/blob/main/src/battinfo/_workspace.py"
click node_record_models "https://github.com/big-map/battinfo/blob/main/src/battinfo/bundle.py"
click node_entity_catalog "https://github.com/big-map/battinfo/blob/main/src/battinfo/entities.py"
click node_materials "https://github.com/big-map/battinfo/blob/main/src/battinfo/materials.py"
click node_record_api "https://github.com/big-map/battinfo/blob/main/src/battinfo/api/_records.py"
click node_parameter_api "https://github.com/big-map/battinfo/blob/main/src/battinfo/api/_parameters.py"
click node_persistence "https://github.com/big-map/battinfo/blob/main/src/battinfo/_jsonio.py"
click node_record_index "https://github.com/big-map/battinfo/blob/main/src/battinfo/_record_index.py"
click node_validation "https://github.com/big-map/battinfo/blob/main/src/battinfo/validate/core.py"
click node_semantic_validation "https://github.com/big-map/battinfo/blob/main/src/battinfo/validate/semantic.py"
click node_jsonld_transform "https://github.com/big-map/battinfo/blob/main/src/battinfo/transform/json_to_jsonld.py"
click node_jsonld "https://github.com/big-map/battinfo/blob/main/src/battinfo/jsonld.py"
click node_ingest "https://github.com/big-map/battinfo/blob/main/src/battinfo/ingest.py"
click node_bpx "https://github.com/big-map/battinfo/blob/main/src/battinfo/interop/bpx.py"
click node_converter "https://github.com/big-map/battinfo/blob/main/src/battinfo/interop/converter.py"
click node_publication "https://github.com/big-map/battinfo/blob/main/src/battinfo/publication.py"
click node_registry "https://github.com/big-map/battinfo/blob/main/src/battinfo/api/_records.py"
click node_web_create "https://github.com/big-map/battinfo/blob/main/web/app/create/page.tsx"
click node_web_validate "https://github.com/big-map/battinfo/blob/main/web/app/validate/page.tsx"
click node_web_convert "https://github.com/big-map/battinfo/blob/main/web/app/convert/page.tsx"
click node_web_publish "https://github.com/big-map/battinfo/blob/main/web/app/publish/page.tsx"

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_workspace,node_record_models,node_entity_catalog,node_materials,node_record_api,node_parameter_api,node_persistence,node_record_index toneBlue
class node_validation,node_semantic_validation,node_jsonld_transform,node_jsonld,node_local_store toneAmber
class node_ingest,node_bpx,node_converter toneMint
class node_publication,node_registry,node_web_create,node_web_validate,node_web_convert,node_web_publish toneRose
class node_user,node_external_registry,node_zenodo toneIndigo
```

## Components

### Authoring and records

- [Authoring workspace](https://github.com/big-map/battinfo/blob/main/src/battinfo/_workspace.py): `src/battinfo/_workspace.py`
- [Record models](https://github.com/big-map/battinfo/blob/main/src/battinfo/bundle.py): `src/battinfo/bundle.py`
- [Record types and identity](https://github.com/big-map/battinfo/blob/main/src/battinfo/entities.py): `src/battinfo/entities.py`
- [Materials and electrodes](https://github.com/big-map/battinfo/blob/main/src/battinfo/materials.py): `src/battinfo/materials.py`
- [Record store API](https://github.com/big-map/battinfo/blob/main/src/battinfo/api/_records.py): `src/battinfo/api/_records.py`
- [Parameter-set API](https://github.com/big-map/battinfo/blob/main/src/battinfo/api/_parameters.py): `src/battinfo/api/_parameters.py`
- [JSON persistence](https://github.com/big-map/battinfo/blob/main/src/battinfo/_jsonio.py): `src/battinfo/_jsonio.py`
- [Record index](https://github.com/big-map/battinfo/blob/main/src/battinfo/_record_index.py): `src/battinfo/_record_index.py`

### Validation and semantics

- [Validation policy and reports](https://github.com/big-map/battinfo/blob/main/src/battinfo/validate/core.py): `src/battinfo/validate/core.py`
- [Semantic validation](https://github.com/big-map/battinfo/blob/main/src/battinfo/validate/semantic.py): `src/battinfo/validate/semantic.py`
- [JSON-LD transformation](https://github.com/big-map/battinfo/blob/main/src/battinfo/transform/json_to_jsonld.py): `src/battinfo/transform/json_to_jsonld.py`
- [JSON-LD export](https://github.com/big-map/battinfo/blob/main/src/battinfo/jsonld.py): `src/battinfo/jsonld.py`

### Interoperability

- [Data ingestion](https://github.com/big-map/battinfo/blob/main/src/battinfo/ingest.py): `src/battinfo/ingest.py`
- [BPX import and export](https://github.com/big-map/battinfo/blob/main/src/battinfo/interop/bpx.py): `src/battinfo/interop/bpx.py`
- [Format conversion](https://github.com/big-map/battinfo/blob/main/src/battinfo/interop/converter.py): `src/battinfo/interop/converter.py`

### Publishing and web

- [Publication](https://github.com/big-map/battinfo/blob/main/src/battinfo/publication.py): `src/battinfo/publication.py`
- [Registry API](https://github.com/big-map/battinfo/blob/main/src/battinfo/api/_records.py): `src/battinfo/api/_records.py`
- [Web authoring](https://github.com/big-map/battinfo/blob/main/web/app/create/page.tsx): `web/app/create/page.tsx`
- [Web validation](https://github.com/big-map/battinfo/blob/main/web/app/validate/page.tsx): `web/app/validate/page.tsx`
- [Web conversion](https://github.com/big-map/battinfo/blob/main/web/app/convert/page.tsx): `web/app/convert/page.tsx`
- [Web publishing](https://github.com/big-map/battinfo/blob/main/web/app/publish/page.tsx): `web/app/publish/page.tsx`

### Other components

- **Battery data author**
- **Local workspace files**
- **BattINFO registry**
- **Zenodo**

## Connections

- Battery data author → Authoring workspace: authors records (evidence: `README.md`)
- Battery data author → Record models: creates cell spec (evidence: `README.md`)
- Authoring workspace → Record models: authors records (evidence: `src/battinfo/_workspace.py`)
- Authoring workspace → Record store API: uses record operations (evidence: `src/battinfo/_workspace.py`)
- Authoring workspace → Record types and identity: uses record types (evidence: `src/battinfo/_workspace.py`)
- Record store API → Record models: uses models (evidence: `src/battinfo/api/_records.py`)
- Record store API → Record types and identity: uses identity rules (evidence: `src/battinfo/api/_records.py`)
- Record store API → Validation policy and reports: validates records (evidence: `src/battinfo/api/_records.py`)
- Parameter-set API → Record models: uses models (evidence: `src/battinfo/api/_parameters.py`)
- Parameter-set API → Materials and electrodes: resolves materials (evidence: `src/battinfo/api/_parameters.py`)
- Record store API → JSON persistence: reads and writes (evidence: `src/battinfo/api/_records.py`)
- Record store API → Record index: indexes records (evidence: `src/battinfo/api/_records.py`)
- Authoring workspace → Local workspace files: saves records (evidence: `README.md`)
- Record store API → Local workspace files: stores records (evidence: `README.md`)
- Record models → JSON-LD transformation: exports as Linked Data (evidence: `README.md`)
- JSON-LD export → JSON-LD transformation: uses transformation (evidence: `src/battinfo/jsonld.py`)
- JSON-LD transformation → Record types and identity: uses record definitions (evidence: `src/battinfo/transform/json_to_jsonld.py`)
- Record store API → Semantic validation: checks semantics (evidence: `src/battinfo/api/_records.py`)
- Semantic validation → Validation policy and reports: reports issues (evidence: `src/battinfo/validate/semantic.py`)
- Battery data author → Data ingestion: imports data (evidence: `README.md`)
- BPX import and export → Record models: maps BPX records (evidence: `src/battinfo/interop/bpx.py`)
- Battery data author → BPX import and export: exchanges BPX (evidence: `src/battinfo/interop/bpx.py`)
- Battery data author → Format conversion: converts data (evidence: `README.md`)
- Battery data author → Publication: publishes records (evidence: `README.md`)
- Publication → BattINFO registry: publishes records (evidence: `README.md`)
- Publication → Zenodo: supports deposits
- Battery data author → Web authoring: authors online (evidence: `README.md`)
- Battery data author → Web validation: validates online (evidence: `README.md`)
- Battery data author → Web conversion: converts online (evidence: `README.md`)
- Battery data author → Web publishing: publishes online (evidence: `README.md`)
