From 84bfcf4e62a6d13b4862546395ad6550e9be410e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=98=8E=E5=AF=9F?= Date: Mon, 16 Mar 2026 11:14:24 +0800 Subject: [PATCH] fix: add additionalProperties:false to schema, clean 4 files with non-standard fields - Remove non-schema fields from china-lcd-association, dosm, bank-of-england-statistics, unfpa-urbanization - Add additionalProperties: false to datasource-schema.json - All 260 data source files pass validation Closes #61 --- firstdata/schemas/datasource-schema.json | 70 +++++++++++++++---- firstdata/sources/countries/asia/dosm.json | 9 --- .../europe/bank-of-england-statistics.json | 43 +----------- .../demographics/unfpa-urbanization.json | 21 +----- .../electronics/china-lcd-association.json | 1 - 5 files changed, 59 insertions(+), 85 deletions(-) diff --git a/firstdata/schemas/datasource-schema.json b/firstdata/schemas/datasource-schema.json index 29b67b4..a57a194 100644 --- a/firstdata/schemas/datasource-schema.json +++ b/firstdata/schemas/datasource-schema.json @@ -20,12 +20,18 @@ "type": "string", "description": "Unique identifier (lowercase, hyphen-separated)", "pattern": "^[a-z0-9-]+$", - "examples": ["china-nbs", "worldbank-open-data", "hkex"] + "examples": [ + "china-nbs", + "worldbank-open-data", + "hkex" + ] }, "name": { "type": "object", "description": "Data source name in multiple languages", - "required": ["en"], + "required": [ + "en" + ], "properties": { "en": { "type": "string", @@ -40,7 +46,9 @@ "description": { "type": "object", "description": "Detailed description of the data source", - "required": ["en"], + "required": [ + "en" + ], "properties": { "en": { "type": "string", @@ -63,7 +71,10 @@ "description": "Direct URL to data access page (not organization homepage - should point to data query/download interface)" }, "api_url": { - "type": ["string", "null"], + "type": [ + "string", + "null" + ], "format": "uri", "description": "API documentation or endpoint URL. Set to null if no API is available." }, @@ -80,10 +91,19 @@ ] }, "country": { - "type": ["string", "null"], + "type": [ + "string", + "null" + ], "description": "ISO 3166-1 alpha-2 country code. Only use this field when the data source clearly belongs to a specific country AND geographic_scope is 'national' or 'subnational'. MUST be null when geographic_scope is 'global' or 'regional'.", "pattern": "^[A-Z]{2}$", - "examples": ["CN", "US", "HK", "JP", null] + "examples": [ + "CN", + "US", + "HK", + "JP", + null + ] }, "domains": { "type": "array", @@ -93,15 +113,29 @@ }, "minItems": 1, "examples": [ - ["finance", "economics"], - ["health", "social"], - ["environment", "climate"] + [ + "finance", + "economics" + ], + [ + "health", + "social" + ], + [ + "environment", + "climate" + ] ] }, "geographic_scope": { "type": "string", "description": "Geographic coverage level", - "enum": ["global", "regional", "national", "subnational"] + "enum": [ + "global", + "regional", + "national", + "subnational" + ] }, "update_frequency": { "type": "string", @@ -124,8 +158,17 @@ }, "minItems": 1, "examples": [ - ["gdp", "经济增长", "economic-growth"], - ["ipo", "招股书", "prospectus", "上市公司"] + [ + "gdp", + "经济增长", + "economic-growth" + ], + [ + "ipo", + "招股书", + "prospectus", + "上市公司" + ] ] }, "data_content": { @@ -148,5 +191,6 @@ } } } - } + }, + "additionalProperties": false } diff --git a/firstdata/sources/countries/asia/dosm.json b/firstdata/sources/countries/asia/dosm.json index ebe424a..c69d787 100644 --- a/firstdata/sources/countries/asia/dosm.json +++ b/firstdata/sources/countries/asia/dosm.json @@ -28,15 +28,6 @@ "household income & expenditure" ], "update_frequency": "irregular", - "data_formats": [ - "CSV", - "JSON", - "Parquet" - ], - "contact": { - "email": "info@dosm.gov.my", - "phone": "+60 3-8885 7000" - }, "data_content": { "en": [ "Economic Statistics - GDP, manufacturing output, industrial production, wholesale & retail trade, services sector, construction, mining & quarrying", diff --git a/firstdata/sources/countries/europe/bank-of-england-statistics.json b/firstdata/sources/countries/europe/bank-of-england-statistics.json index 78747a7..eeeddea 100644 --- a/firstdata/sources/countries/europe/bank-of-england-statistics.json +++ b/firstdata/sources/countries/europe/bank-of-england-statistics.json @@ -18,35 +18,7 @@ "economics", "monetary_policy" ], - "organization": { - "name": { - "en": "Bank of England", - "zh": "英格兰银行" - }, - "type": "central_bank", - "country": "GB" - }, "geographic_scope": "national", - "data_access": { - "methods": [ - "web_download", - "database_query", - "api" - ], - "formats": [ - "CSV", - "Excel", - "JSON" - ], - "requires_registration": false - }, - "temporal_coverage": { - "start_year": null, - "coverage_notes": { - "en": "Historical time series with varying start dates depending on data series", - "zh": "历史时间序列数据,起始日期因数据系列而异" - } - }, "data_content": { "en": [ "Money and lending statistics", @@ -74,13 +46,6 @@ ] }, "update_frequency": "daily", - "update_frequency_notes": { - "en": "Varies by dataset: Daily (exchange rates, SONIA), Weekly (money markets), Monthly (lending, deposits), Quarterly (detailed breakdowns)", - "zh": "因数据集而异:每日(汇率、SONIA)、每周(货币市场)、每月(信贷、存款)、每季度(详细分类)" - }, - "support": { - "email": "BEEDSQueries@bankofengland.co.uk" - }, "tags": [ "central bank", "中央银行", @@ -110,11 +75,5 @@ "reserves", "储备", "BoE" - ], - "metadata": { - "last_verified": "2026-03-04", - "data_portal_url": "https://www.bankofengland.co.uk/boeapps/database/", - "statistical_releases_url": "https://www.bankofengland.co.uk/news/statistics", - "research_datasets_url": "https://www.bankofengland.co.uk/statistics/research-datasets" - } + ] } diff --git a/firstdata/sources/international/demographics/unfpa-urbanization.json b/firstdata/sources/international/demographics/unfpa-urbanization.json index 71b8c59..f053d79 100644 --- a/firstdata/sources/international/demographics/unfpa-urbanization.json +++ b/firstdata/sources/international/demographics/unfpa-urbanization.json @@ -81,24 +81,5 @@ "性别平等", "青少年", "adolescents" - ], - "organization": { - "name": { - "zh": "联合国人口基金", - "en": "United Nations Population Fund" - }, - "abbreviation": "UNFPA", - "type": "international_organization" - }, - "access": { - "requires_registration": false, - "cost": "free" - }, - "formats": ["PDF", "HTML", "Excel"], - "related_links": { - "unfpa_china": "https://china.unfpa.org/zh-Hans", - "world_urbanization_prospects": "https://population.un.org/wup/", - "publications": "https://www.unfpa.org/publications", - "china_publications": "https://china.unfpa.org/zh-Hans/publications" - } + ] } diff --git a/firstdata/sources/sectors/C-manufacturing/electronics/china-lcd-association.json b/firstdata/sources/sectors/C-manufacturing/electronics/china-lcd-association.json index da00a95..c6cf468 100644 --- a/firstdata/sources/sectors/C-manufacturing/electronics/china-lcd-association.json +++ b/firstdata/sources/sectors/C-manufacturing/electronics/china-lcd-association.json @@ -1,5 +1,4 @@ { - "$schema": "https://firstdata.org/schemas/firstdata-v2.json", "id": "china-lcd-association", "name": { "en": "China Optoelectronic Display Association - Liquid Crystal Division (CODA)",