{"id":35621581,"url":"https://github.com/linkml/linkml-tutorial-2025","last_synced_at":"2026-01-05T07:00:07.654Z","repository":{"id":322502142,"uuid":"1089087375","full_name":"linkml/linkml-tutorial-2025","owner":"linkml","description":null,"archived":false,"fork":false,"pushed_at":"2025-11-04T21:13:33.000Z","size":902,"stargazers_count":0,"open_issues_count":5,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-11-04T21:19:26.594Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/linkml.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-11-03T21:41:40.000Z","updated_at":"2025-11-04T21:13:16.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/linkml/linkml-tutorial-2025","commit_stats":null,"previous_names":["linkml/linkml-tutorial-2025"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/linkml/linkml-tutorial-2025","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linkml%2Flinkml-tutorial-2025","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linkml%2Flinkml-tutorial-2025/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linkml%2Flinkml-tutorial-2025/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linkml%2Flinkml-tutorial-2025/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/linkml","download_url":"https://codeload.github.com/linkml/linkml-tutorial-2025/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linkml%2Flinkml-tutorial-2025/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28214808,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2026-01-05T02:00:06.358Z","response_time":57,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-01-05T07:00:04.057Z","updated_at":"2026-01-05T07:00:07.642Z","avatar_url":"https://github.com/linkml.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ca href=\"https://github.com/dalito/linkml-project-copier\"\u003e\u003cimg src=\"https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/copier-org/copier/master/img/badge/badge-grayscale-inverted-border-teal.json\" alt=\"Copier Badge\" style=\"max-width:100%;\"/\u003e\u003c/a\u003e\n\n# LinkML Tutorial 2025\n\nThis repository demonstrates LinkML schema development for modeling plant tissue sample metadata. It serves as a training resource for learning key LinkML features including data modeling, validation, and artifact generation.\n\n## About This Project\n\nThis project implements a **PlantTissueSample** schema that captures comprehensive metadata for plant tissue samples, including:\n\n- **Sample identification and container information** (tubes, plates, well locations)\n- **Taxonomic classification** using NCBI Taxonomy IDs\n- **Biological characteristics** (ploidy levels, tissue types, cultivar/strain information)\n- **Collection metadata** (timestamps, sample sizes, tissue descriptions)\n- **Environmental context** using ENVO (Environment Ontology) terms\n- **Geospatial information** (depth, elevation)\n- **Plant anatomy** using Plant Ontology (PO) terms\n\n## Key LinkML Features Demonstrated\n\nThis tutorial showcases important LinkML modeling patterns:\n\n### 1. **Ontology Integration**\n- Uses standard biomedical ontologies (ENVO, PO, PATO, NCBITaxon)\n- Demonstrates semantic mappings with `meaning`, `exact_mappings`, and `slot_uri`\n- Shows `reachable_from` for dynamic enumeration from ontology hierarchies\n\n### 2. **Data Validation**\n- Required vs. optional fields\n- Enumerated values with controlled vocabularies\n- Pattern constraints (e.g., plate well positions: `^[A-H][1-9][0-2]?$`)\n- Type ranges (string, integer, float, datetime, uriorcurie)\n- Multivalued slots for multiple ontology term annotations\n\n### 3. **Schema Components**\n- **Classes**: PlantTissueSample with identifier and metadata slots\n- **Enumerations**: SampleContainerEnum, PloidyEnum with PATO mappings\n- **Dynamic Enumerations**: NCBITaxonEnum and TissueTypeEnum using `reachable_from`\n- **Slots**: Field definitions with descriptions, constraints, and semantic annotations\n\n## Learning Objectives\n\nBy exploring this repository, you will learn how to:\n\n1. **Define LinkML schemas** with classes, slots, and enumerations\n2. **Integrate ontologies** for semantic interoperability\n3. **Add validation constraints** (required fields, patterns, ranges)\n4. **Generate artifacts** (Python classes, Pydantic models, JSON Schema)\n5. **Create test data** (valid and invalid examples)\n6. **Validate data** using linkml-validate\n7. **Document schemas** with auto-generated documentation\n\n## Documentation Website\n\n[https://linkml.github.io/linkml-tutorial-2025](https://linkml.github.io/linkml-tutorial-2025)\n\n## Repository Structure\n\n* [docs/](docs/) - mkdocs-managed documentation\n  * [elements/](docs/elements/) - generated schema documentation\n* [examples/](examples/) - Examples of using the schema\n* [project/](project/) - project files (these files are auto-generated, do not edit)\n* [src/](src/) - source files (edit these)\n  * [linkml_tutorial_2025](src/linkml_tutorial_2025)\n    * [schema/](src/linkml_tutorial_2025/schema) -- LinkML schema\n      (edit this)\n    * [datamodel/](src/linkml_tutorial_2025/datamodel) -- generated\n      Python datamodel\n* [tests/](tests/) - Python tests\n  * [data/](tests/data) - Example data\n\n## Getting Started\n\n### Prerequisites\n- Python 3.9+\n- [just](https://github.com/casey/just/) command runner\n- [uv](https://docs.astral.sh/uv/) package manager\n\n### Quick Start\n\n```bash\n# Clone the repository\ngit clone https://github.com/linkml/linkml-tutorial-2025.git\ncd linkml-tutorial-2025\n\n# Install dependencies\nuv sync\n\n# Run tests\njust test\n\n# Validate example data\nuv run linkml-validate -s src/linkml_tutorial_2025/schema/linkml_tutorial_2025.yaml \\\n  -C PlantTissueSample tests/data/valid/PlantTissueSample-001.yaml\n\n# Generate artifacts (Python, Pydantic, JSON Schema, etc.)\njust gen-project\n```\n\n## Example Data\n\nThe repository includes example data to demonstrate validation:\n\n### Valid Examples (`tests/data/valid/`)\n- **PlantTissueSample-001.yaml** - Complete valid sample with all required fields\n\n### Invalid Examples (`tests/data/invalid/`)\n- **PlantTissueSample-missing-required.yaml** - Missing required fields (strain_variety_cultivar, ncbi_taxonomy_id, tissue)\n- **PlantTissueSample-bad-range.yaml** - Invalid enum values and type mismatches\n- **PlantTissueSample-pattern-violation.yaml** - Pattern constraint violations (plate location, sample size format)\n\nRun validation to see error messages:\n```bash\nlinkml-validate -s src/linkml_tutorial_2025/schema/linkml_tutorial_2025.yaml \\\n  -C PlantTissueSample tests/data/invalid/PlantTissueSample-missing-required.yaml\n```\n\n## Developer Tools\n\nThere are several pre-defined command-recipes available.\nThey are written for the command runner [just](https://github.com/casey/just/). To list all pre-defined commands, run `just` or `just --list`.\n\n### Common Commands\n- `just test` - Run all tests and generate artifacts\n- `just gen-project` - Generate Python datamodels, JSON Schema, etc.\n- `just docs-serve` - Serve documentation locally\n\n## Credits\n\nThis project uses the template [linkml-project-copier](https://github.com/dalito/linkml-project-copier) published as [doi:10.5281/zenodo.15163584](https://doi.org/10.5281/zenodo.15163584).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flinkml%2Flinkml-tutorial-2025","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flinkml%2Flinkml-tutorial-2025","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flinkml%2Flinkml-tutorial-2025/lists"}