Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
112 commits
Select commit Hold shift + click to select a range
68cd8d4
cleanup code base
komed3 Apr 30, 2026
6cf125c
update / install packages
komed3 Apr 30, 2026
bbd8aa7
prep. structure
komed3 Apr 30, 2026
8573d86
localization enums
komed3 Apr 30, 2026
84fd12e
bump vers. 0.7.0
komed3 Apr 30, 2026
1d85d41
implement reworked measurement uncertainty
komed3 Apr 30, 2026
917d6fb
declare primitives
komed3 Apr 30, 2026
75f287f
prepare factory type
komed3 Apr 30, 2026
4085128
create reference registry
komed3 Apr 30, 2026
a151d92
define data fields for BibTeX references
komed3 Apr 30, 2026
d00b895
define reference helper types
komed3 Apr 30, 2026
f3a54d4
we'll use building blocks for reference types
komed3 Apr 30, 2026
8a8be8a
implement all reference types
komed3 Apr 30, 2026
c78e245
Update reference.ts
komed3 Apr 30, 2026
7e4ba90
add reference union type
komed3 Apr 30, 2026
f0d584d
implement modifier types
komed3 Apr 30, 2026
eb23993
add missing reference registry types
komed3 Apr 30, 2026
bf0888c
define person registry entry
komed3 Apr 30, 2026
4379213
implement orgs
komed3 Apr 30, 2026
ff77a4d
implement org registry infrastructure
komed3 Apr 30, 2026
df436af
fix imports
komed3 Apr 30, 2026
191782f
Update person.ts
komed3 Apr 30, 2026
92cf38f
define weblinks utility type
komed3 Apr 30, 2026
d094704
implement utility types
komed3 Apr 30, 2026
b2f73d7
Update factory.ts
komed3 Apr 30, 2026
030d75d
implement blob enums
komed3 Apr 30, 2026
1f60a62
implement blob registry
komed3 Apr 30, 2026
49eef59
mount registries to main DB type
komed3 Apr 30, 2026
3f9f7b2
Create enum/registry/unit.ts
komed3 Apr 30, 2026
1f06cde
include config folder
komed3 Apr 30, 2026
84b5e15
declare dimension vector + unit config
komed3 Apr 30, 2026
156e3a6
describe units
komed3 Apr 30, 2026
87874c7
SI dimensions + prefixes
komed3 Apr 30, 2026
53ff302
export quantities and valid units / prep. prefixable symbols
komed3 Apr 30, 2026
121713a
describe units and phys. quantities
komed3 Apr 30, 2026
2d0661a
implement unit registry
komed3 Apr 30, 2026
ee2f703
Update index.ts
komed3 Apr 30, 2026
f6a5711
fix schema generator path
komed3 Apr 30, 2026
b986f16
we'll need a second unit type file to prevent circular refs
komed3 Apr 30, 2026
756073a
fix unit config
komed3 Apr 30, 2026
ed9c0ce
declare value types
komed3 Apr 30, 2026
7989863
implement conditional fields (phys. context)
komed3 Apr 30, 2026
7479016
implement reaction collection
komed3 Apr 30, 2026
3318094
declare missing reaction enums
komed3 Apr 30, 2026
87d37cb
declare element symbol enum
komed3 Apr 30, 2026
2c60ee4
declare domain IDs
komed3 Apr 30, 2026
bebf5cb
implement property types
komed3 Apr 30, 2026
230df9c
now we can import the PropertyWrapper type
komed3 Apr 30, 2026
552b6b2
implement abundance collection
komed3 Apr 30, 2026
8397eef
add descriptive + generic collection
komed3 Apr 30, 2026
46eb14b
rename ts file
komed3 Apr 30, 2026
7d0f103
add identification info
komed3 Apr 30, 2026
ab98f5d
add media collection (working with blobs)
komed3 Apr 30, 2026
8d188dc
describe formula collection
komed3 Apr 30, 2026
f319890
add composition collection for descriping composed substances
komed3 Apr 30, 2026
538f3af
implement history collection
komed3 Apr 30, 2026
58605da
add generic event
komed3 Apr 30, 2026
5256af8
describe atomic data (for elements)
komed3 Apr 30, 2026
15578cf
implement safety enums
komed3 Apr 30, 2026
9dbdef4
add safety collection
komed3 Apr 30, 2026
60d8aa2
add chemistry enums
komed3 Apr 30, 2026
3c3122d
Update reaction.ts
komed3 Apr 30, 2026
a7617fc
add chemistry collection
komed3 Apr 30, 2026
b5a6ab4
implement complex physics model
komed3 Apr 30, 2026
c7f9c04
far the most complex collection: typing nuclear data from IAEA 1:1
komed3 Apr 30, 2026
dffa2d0
move enum files for better structure
komed3 Apr 30, 2026
00cc3f9
fix import order
komed3 Apr 30, 2026
337728a
declare abstract substance domain types
komed3 Apr 30, 2026
deecd1e
describe the element domain
komed3 Apr 30, 2026
40f06f5
implement missing form collection wrapper
komed3 Apr 30, 2026
3ba69d0
connect element domain to DB type
komed3 Apr 30, 2026
8cea7ba
DB will NOT have schema anymore
komed3 Apr 30, 2026
3a4ef95
no schema means better TS ;)
komed3 Apr 30, 2026
3c12fed
update some files
komed3 Apr 30, 2026
a72826d
validate
komed3 Apr 30, 2026
51fea00
Merge branch 'master' into final-rework
komed3 Apr 30, 2026
11bb0b9
implement mineral domain
komed3 Apr 30, 2026
53ad3e3
add mixtures
komed3 Apr 30, 2026
fe1d52c
implement compound domain
komed3 Apr 30, 2026
d54e016
declare nuclide classification
komed3 Apr 30, 2026
ab9bf29
implement nuclide collection
komed3 Apr 30, 2026
f41b3dc
describe autogen. nuclide index
komed3 Apr 30, 2026
c070509
implement types for autogen. decay chains
komed3 Apr 30, 2026
47c6691
mount nuclide data to DB type
komed3 Apr 30, 2026
d2b3a48
Update README.md
komed3 Apr 30, 2026
6a1210a
declare package exports
komed3 Apr 30, 2026
fc067b1
describe element enums
komed3 Apr 30, 2026
0a1e88a
describe chemical enums
komed3 Apr 30, 2026
c98499d
add more comments
komed3 Apr 30, 2026
ba5b2fa
update enums
komed3 Apr 30, 2026
9990d4c
describe enums for domains
komed3 Apr 30, 2026
23e9628
add scientific comments
komed3 Apr 30, 2026
8d9ed94
update blob enums
komed3 Apr 30, 2026
afa01a1
update system enums
komed3 Apr 30, 2026
228ed02
Update condition.ts
komed3 Apr 30, 2026
0c7a7ff
update base types / add comments
komed3 Apr 30, 2026
6bf4864
add comments
komed3 Apr 30, 2026
75f445f
update registries
komed3 Apr 30, 2026
3fc11f4
add comments for collections
komed3 Apr 30, 2026
1290fc1
Update structure.ts
komed3 Apr 30, 2026
3f173c7
update collections
komed3 Apr 30, 2026
a648001
add comments to collections
komed3 Apr 30, 2026
3b19228
min fixes
komed3 Apr 30, 2026
36be524
Update chemistry.ts
komed3 Apr 30, 2026
4809e57
add comments
komed3 Apr 30, 2026
5c2640d
Update nuclear.ts
komed3 Apr 30, 2026
385be96
Update physics.ts
komed3 Apr 30, 2026
5841927
describe multiple domains
komed3 Apr 30, 2026
176b1fc
Update substance.ts
komed3 Apr 30, 2026
89602dc
add comments for element domain
komed3 Apr 30, 2026
2b6d012
Update index.ts
komed3 Apr 30, 2026
e3336ff
Update nuclide.ts
komed3 Apr 30, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,5 @@ jobs:
- name: Install Dependencies
run: npm ci

- name: Generate Schema
run: npm run schema

- name: Publish Package to npm
run: npm publish
12 changes: 1 addition & 11 deletions .github/workflows/validate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:

jobs:
validate:
name: Type Safety & Schema
name: Type Safety
runs-on: ubuntu-latest

steps:
Expand All @@ -26,13 +26,3 @@ jobs:

- name: Type Check
run: npm run lint

- name: Generate Schema
run: npm run schema

- name: Upload Schema Artifact
uses: actions/upload-artifact@v7
with:
name: schema
path: src/schema.json
if-no-files-found: error
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
node_modules/
src/
docs/
29 changes: 14 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,35 +2,34 @@

[![npm version](https://img.shields.io/npm/v/@pseinfo/database-schema?style=flat-square)](https://npmjs.com/@pseinfo/database-schema)
[![License: MIT](https://img.shields.io/badge/License-MIT-blue?style=flat-square)](https://github.com/pseinfo/database-schema/blob/master/LICENSE)
[![Schema](https://img.shields.io/badge/Schema-JSON-blue?style=flat-square)](https://unpkg.com/@pseinfo/database-schema/src/schema.json)

Strict TypeScript definitions and JSON Schema for structured representation of chemical elements, minerals, nuclides, mixtures, and compounds used by the [periodic table database](https://github.com/pseinfo/database).
Strict TypeScript definitions for structured representation of chemical elements, minerals, nuclides, mixtures, and compounds used by the [periodic table database](https://github.com/pseinfo/database).

Visit [technical documentation](https://pseinfo.github.io/database-schema) for in-depth insights into the schema architecture.

## Schema Architecture

The `@pseinfo/database-schema` is designed as a modular, five-tier architecture that ensures both strict type safety and scientific flexibility.

1. **Abstract layer:** Defines the fundamental behavior of scientific data, including measurements, uncertainties, and experimental conditions.
2. **Collection layer:** Aggregates properties into thematic modules such as atomic physics, thermodynamics, and crystallographic analysis.
3. **Data layer:** Provides the "raw" scientific content (e.g., `ElementData`), designed for manual maintenance without system-generated metadata.
4. **Entity layer:** Enriches the data with automated `@metadata` (hashes, timestamps, versions) to create complete database records (e.g., `Element`).
5. **Registry layer:** Composes these entities into global dictionaries (e.g., `ElementEntity`), providing a unified structure consistent across all domains.
1. **Abstract layer:** Defines the fundamental behavior of scientific data, including measurements, uncertainties, and experimental conditions.
2. **Collection layer:** Aggregates properties into thematic modules such as atomic physics, thermodynamics, and crystallographic analysis.
3. **Data layer:** Provides the "raw" scientific content (e.g., `ElementData`), designed for manual maintenance without system-generated metadata.
4. **Entity layer:** Enriches the data with automated `@metadata` (hashes, timestamps, versions) to create complete database records (e.g., `Element`).
5. **Domain layer:** Composes these entities into global dictionaries (e.g., `ElementDomain`), providing a unified structure consistent across all domains.

## Scientific Property Model

A central principle of the schema is the encapsulation of data within a robust **property model**. Instead of documenting values as isolated primitives, every measurement is treated as a multidimensional object. This includes the quantitative value itself—supporting single points, arrays, or coupled numeric ranges—the specific scientific unit linked to a global registry, and the associated experimental metadata.

Experimental conditions like temperature and pressure are natively supported as context for every property, while a citation system ensures that every data point can be traced back to its original reference in the scientific literature.

## Blob, Unit & Reference Registries
## Registries

The schema promotes data integrity through centralized registries for physical quantities, media blobs, and academic references. The **unit registry** provides a strictly typed framework for dimensions and prefixes, ensuring that physical properties like molar mass or magnetic susceptibilities are always represented with correct SI-compliant symbols.
The schema promotes data integrity through centralized registries for physical quantities, media blobs, academic references, organizations and people.

**Blobs** handle the storage of large media files (e.g., crystallographic structures, spectral data) in a way that is decoupled from the core database, allowing for efficient management and retrieval without bloating the primary data records.
The **unit registry** provides a strictly typed framework for dimensions and prefixes, ensuring that physical properties always represented with correct SI-compliant symbols. **Blobs** handle the storage of large media files (e.g., structure files, spectral data) in a way that is decoupled from the core database, allowing for efficient management and retrieval without bloating the primary data records. The **reference registry** manages the bibliography of the entire database, allowing for a deduplicated and verifiable chain of custody for all scientific information.

Complementing this, the **reference registry** manages the bibliography of the entire database, allowing for a deduplicated and verifiable chain of custody for all scientific information.
**Person** and **organization registries** maintain the metadata of scientists and institutions involved in discovery, research, and data curation, providing a historical and social context for the scientific data.

## Database Entities

Expand All @@ -50,9 +49,9 @@ Using these factories, developers benefit from:
Example:

```typescript
import type { ElementFactory } from '@pseinfo/database-schema/types/entity/element';
import { ElementSymbol } from '@pseinfo/database-schema/enum/element';
import { EntityType } from '@pseinfo/database-schema/enum/util';
import type { ElementFactory } from '@pseinfo/database-schema/model/domain/element';
import { ElementSymbol } from '@pseinfo/database-schema/enum/science/element';
import { DomainType } from '@pseinfo/database-schema/enum/system/domain';

export default ( {
type: EntityType.ELEMENT,
Expand All @@ -72,7 +71,7 @@ export default ( {

## Package

The package provides the complete set of TypeScript definitions and JSON Schema for Draft-07 compliance, allowing for runtime validation in heterogeneous environments.
The package provides the complete set of TypeScript definitions, allowing for validation checks in heterogeneous environments.

Developers have access to the full suite of internal enums, utility types, and the high-level structural model, enabling the integration of chemical data into specialized applications with absolute structural certainty.

Expand Down
Loading