Skip to content

Commit 20f7635

Browse files
docs(dataset): sync documentation from dataset@v1.4.0
1 parent 8909936 commit 20f7635

2 files changed

Lines changed: 64 additions & 10 deletions

File tree

docs/changelog-dataset.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file.
44

55
This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html) and [Conventional Commits](https://www.conventionalcommits.org/).
66

7+
## 1.4.0 (2025-12-28)
8+
9+
* feat: add full data validation script and a guide for contributing vehicle data ([47503d8](https://github.com/open-ev-data/open-ev-data-dataset/commit/47503d8))
10+
* chore: add documentation sync workflow for GitHub Pages ([52d5932](https://github.com/open-ev-data/open-ev-data-dataset/commit/52d5932))
11+
* chore: update OpenEV Data logo in README ([c68f49c](https://github.com/open-ev-data/open-ev-data-dataset/commit/c68f49c))
12+
713
## 1.3.0 (2025-12-27)
814

915
* fix(dockerignore): exclude SQL dump from Docker context ([4a0e590](https://github.com/open-ev-data/open-ev-data-dataset/commit/4a0e590))

docs/dataset/CONTRIBUTING_VEHICLES.md

Lines changed: 58 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,8 @@ Variants are for configurations with material differences (battery size, chargin
247247

248248
## Step 5: Validate Your Changes
249249

250+
The validation system has three levels:
251+
250252
### Quick Syntax Check
251253

252254
Validates JSON syntax only:
@@ -255,29 +257,75 @@ Validates JSON syntax only:
255257
npm run validate
256258
```
257259

260+
### Schema Validation
261+
262+
Validates directory structure and JSON schema (no Docker required):
263+
264+
```bash
265+
npm run validate:schema
266+
```
267+
268+
This validates:
269+
270+
**Structure Rules**:
271+
- Each model directory must contain `base.json`
272+
- Each year directory must contain `{model}.json`
273+
- Variant files must be named `{model}_{variant}.json`
274+
- No other files allowed in model directory
275+
276+
**Schema Rules**:
277+
- All required fields present after merge
278+
- No extra fields (only fields defined in schema.json allowed)
279+
- Field values match expected types and constraints
280+
258281
### Full Validation
259282

260-
Validates the complete merge pipeline and all required fields:
283+
Validates everything including the Rust ETL pipeline:
261284

262285
```bash
263286
npm run validate:full
264287
```
265288

266-
This command:
267-
1. Loads all vehicle files from `src/`
268-
2. Merges layers (base.json + year + variant)
269-
3. Validates each canonical vehicle
270-
4. Reports errors with affected vehicle count
289+
This runs schema validation first, then the ev-etl Docker binary for complete compilation testing.
271290

272291
**Expected output for valid data**:
273292

274293
```
275-
Loaded 27 vehicle files
276-
Merged into 13 vehicles
277-
Validation complete: 13 valid, 0 invalid
294+
=== OpenEV Data Validation ===
295+
296+
Step 1: Validating directory structure...
297+
Structure validation passed.
298+
299+
Step 2: Validating merged vehicles against schema.json...
300+
Found 13 vehicles to validate.
301+
All 13 vehicles passed schema validation.
302+
303+
=== Validation Complete ===
278304
```
279305

280-
**If validation fails**, the output will indicate which vehicles have errors.
306+
**Example error output** (missing required field):
307+
308+
```
309+
SCHEMA ERRORS: 1 vehicle(s) have errors.
310+
311+
File: src/byd/dolphin/2024/dolphin.json
312+
Type: year_base
313+
Errors:
314+
- /: must have required property 'sources'
315+
```
316+
317+
**Example error output** (invalid file name):
318+
319+
```
320+
STRUCTURE ERRORS: 1 issue(s) found.
321+
322+
src/byd/dolphin/2024/wrong_name.json
323+
Invalid file name. Variants must be named dolphin_<variant>.json
324+
```
325+
326+
### IDE Real-Time Validation
327+
328+
VS Code, Cursor, and compatible editors show validation errors while you edit. Look for red squiggly lines under fields with issues.
281329

282330
---
283331

0 commit comments

Comments
 (0)