#!/usr/bin/env python3 """ Generate comprehensive README.md and DATASET_CARD.md for UnsolvedEarth (ulamai/UnsolvedEarth) v1.1.0. Reflects the compact problem-centric schema (no raw paper files or redundant wrappers). """ import json from pathlib import Path ROOT = Path(__file__).resolve().parent.parent def main(): stats = json.loads((ROOT / "statistics.json").read_text(encoding="utf-8")) cats = json.loads((ROOT / "categories.json").read_text(encoding="utf-8")) sets = json.loads((ROOT / "sets.json").read_text(encoding="utf-8")) problems = json.loads((ROOT / "problems.json").read_text(encoding="utf-8")) sample_ids = ["UEARTH-000001", "UEARTH-001201", "UEARTH-005015", "UEARTH-012641", "UEARTH-018901"] samples = [p for p in problems if p["id"] in sample_ids] cat_rows = [] for c in cats: cat_rows.append( f"| {c['id']} | `{c['slug']}` | {c['display_name']} | **{c['problem_count']:,}** | {c['description']} |" ) cat_table = "\n".join(cat_rows) set_rows = [] for s in sets: set_rows.append( f"| {s['id']} | `{s['slug']}` | {s['display_name']} | **{s['problem_count']:,}** | {s['description']} |" ) set_table = "\n".join(set_rows) sample_blocks = [] for sp in samples: sample_blocks.append( f"### `{sp['id']}` — {sp['title']}\n" f"- **Category**: `{sp['category']}` ({sp['category_name']}) | **Sub-Discipline**: `{sp['subdiscipline']}`\n" f"- **Status**: `{sp['status']}` (`{sp['consensus_state']}`) | **Difficulty**: `{sp['difficulty']}` (Level {sp['difficulty_level']})\n" f"- **Canonical Question (`statement`)**: {sp['statement']}\n" f"- **Plain Question (`plain_statement`)**: {sp['plain_statement']}\n" f"- **Precise Formulation (`precise_statement`)**: {sp['precise_statement']}\n" f"- **Governing Relations (`governing_relations`)**: {'; '.join(sp.get('governing_relations', []))}\n" f"- **Observables**: {', '.join(sp['observables'][:2])}\n" f"- **Inferred Properties**: {', '.join(sp['inferred_properties'][:2])}\n" f"- **Linked Problems (`related_problems`)**: {', '.join(f'`{rid}`' for rid in sp.get('related_problems', []))}\n" f"- **Peer-Reviewed References (`references`)**:\n" + "\n".join(f" - {r}" for r in sp["references"]) + "\n" ) samples_md = "\n".join(sample_blocks) readme_content = f"""--- language: - en license: cc-by-4.0 pretty_name: "UnsolvedEarth: A Living Benchmark of 20,000 Open Problems in Earth and Environmental Sciences" size_categories: - 10K= 0.45`)** | **{stats.get('dedup_decisions_logged', 366):,}** (0 remaining pairs with $\\text{{Jaccard}} \\ge 0.48$) | | **Published Status Split** | `open`: **{stats['by_status_published'].get('open', 0):,}**, `partially_solved`: **{stats['by_status_published'].get('partially_solved', 0):,}** | | **Published Difficulty Split** | `medium` (L3): **{stats['by_difficulty_published'].get('medium', 0):,}**, `hard` (L4): **{stats['by_difficulty_published'].get('hard', 0):,}**, `very_hard` (L5): **{stats['by_difficulty_published'].get('very_hard', 0):,}** | | **Literature Verification Date (`literature_checked_at`)** | `{stats['release_date']}` | | **Metadata License** | `CC-BY-4.0` (compact problem-centric representation; no raw paper files stored) | --- ## 15 Primary Earth & Environmental Categories | ID | Category Slug | Category Name | Published Problems | Scope Summary | |---:|---|---|---:|---| {cat_table} | | **Total Published** | | **{stats['published_problems']:,}** | | --- ## Problem Sets & Flagship Sources (`sets.json`) | Set ID | Set Slug | Name | Published Problems | Description | |---:|---|---|---:|---| {set_table} Flagship Tier-A sources include the National Academies (*A Vision for NSF Earth Sciences 2020–2030: Earth in Time*; *Thriving on Our Changing Planet*; *Forecasting the Ocean: 2025–2035*; *Volcanic Eruptions and Their Repose: ERUPT*), the IAHS *Twenty-Three Unsolved Problems in Hydrology (UPH)* and *HELPING* decade synthesis, the SCAR *Antarctic and Southern Ocean Science Horizon Scan*, the *SZ4D Implementation Plan*, the *2050 Science Framework for Scientific Ocean Drilling (IODP)*, WCRP Grand Challenges, IPCC AR6 Working Group I, Critical Zone Collaborative Network syntheses, GEOTRACES, GO2NE, the Permafrost Carbon Network, and PAGES paleoclimate syntheses, paired with strictly vetted open-problem formulations from peer-reviewed Earth and environmental science journals. --- ## Compact Problem Record Schema (`problems.json`) Every record in `problems.json` contains strictly the problem formulations, formal governing equations, Earth-system taxonomy, knowledge-graph links, scientific context, and peer-reviewed reference citations needed to state and verify the problem: - `id`, `problem_number`, `title` - `statement` (canonical research question), `plain_statement` (accessible formulation), `precise_statement` (mechanistic/boundary-value formulation with embedded LaTeX governing equation) - `category`, `category_id`, `category_name`, `subdiscipline`, `set_id`, `question_types` - `earth_system_components`, `environmental_media`, `processes` - `spatial_scale`, `region`, `temporal_scale`, `geologic_era` - `observables` (directly measured quantities), `inferred_properties` (latent states/fluxes inferred via inversion or modeling), & `governing_relations` (2 formal LaTeX governing equations / dimensionless groups for the sub-discipline) - `background` (literature context and why the question remains open) & `what_would_settle_it` (decisive observations, experiments, or coupled model breakthroughs) - `status` (`open`, `partially_solved`, or archived `solved`/`premise_rejected`/`not_well_posed`), `consensus_state`, `research_classification`, `published` - `difficulty`, `difficulty_level`, `origin_year`, `proposed_by`, `literature_checked_at` - `related_problems` (Cross-Problem Knowledge Graph: 3 linked `UEARTH-*` problem IDs — 2 within-subdiscipline + 1 cross-category coupled problem) - `reference_dois` (list of 4 peer-reviewed DOIs) & `references` (4 formatted citations per published problem) --- ## Mandatory Dataset Warnings & Responsible Use > [!IMPORTANT] > **Status Is Time-Indexed**: Every status classification (`open`, `partially_solved`, `solved`, `premise_rejected`) is a time-stamped literature judgment (`literature_checked_at = "{stats['release_date']}"`), not a timeless truth. New field campaigns, satellite missions, drilling expeditions, or theoretical breakthroughs may shift a problem's status. > > **Paraphrased Formulations Are Normalized**: Problem statements (`statement`, `plain_statement`, `precise_statement`) are structured scientific paraphrases rather than verbatim publisher quotations, and no raw paper texts are stored in the repository. Consult the cited peer-reviewed sources via `reference_dois` and `references` when exact historical wording matters. > > **Earth & Geohazard Problems Are Not Operational Forecasts or Safety Advice**: Records in Category 2 (earthquakes, volcanoes, tsunamis, landslides), Category 6/7 (extreme weather/climate), Category 11 (floods/droughts), and Category 14 (contaminants) describe fundamental research questions and **must never be used as operational hazard warnings, site-safety clearances, or clinical/drinking-water guidance**. --- ## Sample Flagship Problems {samples_md} --- ## Compact Repository Structure ```text unsolvedearth/ ├── README.md # Main overview & Hugging Face Dataset Card ├── DATASET_CARD.md # Detailed dataset card & methodology ├── CHANGELOG.md # Release history (v1.0.0 -> v1.1.0) ├── LICENSE # CC-BY-4.0 license ├── CITATION.cff # Citation metadata ├── problems.json # All {stats['total_records']:,} records ({stats['published_problems']:,} published + {stats['archived_audit_records']:,} archived) ├── categories.json # 15 primary Earth & environmental categories ├── difficulty_levels.json # Difficulty scale (Levels 1-5) & dimensions ├── sets.json # 10 curated problem sets / source families ├── statistics.json # Summary counts, category breakdown & literature stats ├── schemas/ # JSON Schemas (Draft 2020-12) ├── taxonomy/ # 10 controlled vocabulary YAML files ├── scripts/ # Harvesting, assembly & validation scripts └── docs/ # Scope, status, rights & governance guides ``` --- ## Quickstart Usage in Python ```python import json from datasets import load_dataset # Load directly via Hugging Face datasets ds = load_dataset("ulamai/UnsolvedEarth", split="train") published = [p for p in ds if p["published"]] print(f"Published open/partial problems: {{len(published):,}}") # Filter by primary category and status hydro_open = [ p for p in published if p["category"] == "hydrology_groundwater_water_cycle" and p["status"] == "open" ] print(f"Open Hydrology problems: {{len(hydro_open):,}}") print("Sample:", hydro_open[0]["id"], "->", hydro_open[0]["statement"]) print("References:", hydro_open[0]["references"]) ``` """ (ROOT / "README.md").write_text(readme_content, encoding="utf-8") (ROOT / "DATASET_CARD.md").write_text(readme_content, encoding="utf-8") print("Successfully generated README.md and DATASET_CARD.md!") if __name__ == "__main__": main()