{"id":19388867,"url":"https://github.com/linkml/linkml-tutorial","last_synced_at":"2025-04-23T23:31:51.799Z","repository":{"id":59997994,"uuid":"537241547","full_name":"linkml/linkml-tutorial","owner":"linkml","description":null,"archived":false,"fork":false,"pushed_at":"2024-08-13T06:41:17.000Z","size":1980,"stargazers_count":7,"open_issues_count":0,"forks_count":1,"subscribers_count":12,"default_branch":"main","last_synced_at":"2025-04-02T22:33:06.529Z","etag":null,"topics":["linkml","tutorial"],"latest_commit_sha":null,"homepage":"https://linkml.github.io/linkml-tutorial/","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}},"created_at":"2022-09-15T23:45:10.000Z","updated_at":"2024-12-28T20:44:21.000Z","dependencies_parsed_at":"2024-06-24T18:33:27.141Z","dependency_job_id":"c76b67f7-b1dc-4b73-8a7b-3ac81e43d783","html_url":"https://github.com/linkml/linkml-tutorial","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linkml%2Flinkml-tutorial","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linkml%2Flinkml-tutorial/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linkml%2Flinkml-tutorial/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linkml%2Flinkml-tutorial/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/linkml","download_url":"https://codeload.github.com/linkml/linkml-tutorial/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250532137,"owners_count":21446125,"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","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":["linkml","tutorial"],"created_at":"2024-11-10T10:13:55.018Z","updated_at":"2025-04-23T23:31:49.616Z","avatar_url":"https://github.com/linkml.png","language":"Python","readme":"# LinkML Tutorial 1: Introduction to LinkML\n\nThis is a repository that walks through the LinkML modeling language, helpful LinkML command line tools, and \nautomatic schema documentation generation. The main branch of this repository has the resulting\nstructure of a LinkML project that follows the tutorial to its completion.  If you want to walk through\nthe tutorial step by step, or refer back to a section of the tutorial at a later time, you can \ncheck out the stepped branches as needed.\n\nFor example, if you wanted to see the schema and infrastructure as it looks before implementing enumerations, \nyou could refer to the `step_5_validation` branch.\n\nFor reference, the available sections are:\n\n### Section 1: Setting up a LinkML project from scratch \n\n![1-cookiecutter.jpg](tutorial_slides%2F1-cookiecutter.jpg)\n![2-cookiecutter.jpg](tutorial_slides%2F2-cookiecutter.jpg)\n![3-cookiecutter.jpg](tutorial_slides%2F3-cookiecutter.jpg)\n![4-cookiecutter.jpg](tutorial_slides%2F4-cookiecutter.jpg)\n![5-cookiecutter.jpg](tutorial_slides%2F5-cookiecutter.jpg)\n\n- [step_0_basic_project_creation](https://github.com/linkml/linkml-tutorial/tree/step_0_basic_project_creation)\n\n\n### Section 2: Developing a model, validating the model with test data\n![1a-modeling.jpg](tutorial_slides%2F1a-modeling.jpg)\n![1-modeling.jpg](tutorial_slides%2F1-modeling.jpg)\n\n- [step_1_model_components](https://github.com/linkml/linkml-tutorial/tree/step_1_model_components)\n- [step_2_classes_and_slots](https://github.com/linkml/linkml-tutorial/tree/step_2_classes_and_slots)\n- [step_3_hierarchies](https://github.com/linkml/linkml-tutorial/tree/step_3_hierarchies)\n- [step_4_mappings_and_uris](https://github.com/linkml/linkml-tutorial/tree/step_4_mappings_and_uris)\n- [step_5_validation](https://github.com/linkml/linkml-tutorial/tree/step_5_validation)\n- [step_6_enumerations](https://github.com/linkml/linkml-tutorial/tree/step_6_enumerations)\n\n\n\n### Section 3: Checking the model for best practices (linting)\n- [step_7_linting](https://github.com/linkml/linkml-tutorial/tree/step_7_linting)\n![1-linting.jpg](tutorial_slides%2F1-linting.jpg)\n![1-validation.jpg](tutorial_slides%2F1-validation.jpg)\n![1a-modeling.jpg](tutorial_slides%2F1a-modeling.jpg)\n\n\n### Section 4: Generating model documentation\n![1-doc.jpg](tutorial_slides%2F1-doc.jpg)\n![2-doc-details.jpg](tutorial_slides%2F2-doc-details.jpg)\n![3-doc-varieties.jpg](tutorial_slides%2F3-doc-varieties.jpg)\n![4-doc-reststop.jpg](tutorial_slides%2F4-doc-reststop.jpg)\n\n- [step_8_documentation](https://github.com/linkml/linkml-tutorial/tree/step_8_documentation)\n\n### Section 5: Schemasheets\n![1-schemasheets.jpg](tutorial_slides%2F1-schemasheets.jpg)\n![2-schemasheets.jpg](tutorial_slides%2F2-schemasheets.jpg)\n![3-schemasheets.jpg](tutorial_slides%2F3-schemasheets.jpg)\n![4-schemasheets.jpg](tutorial_slides%2F4-schemasheets.jpg)\n![5-schemasheets.jpg](tutorial_slides%2F5-schemasheets.jpg)\n![6-schemasheets.jpg](tutorial_slides%2F6-schemasheets.jpg)\n\n- [step_9_schemasheets](https://github.com/linkml/linkml-tutorial/tree/schemasheets)\n\n\n## Website\n\n* [https://linkml.github.io/linkml-tutorial](https://linkml.github.io/linkml-tutorial)\n\n## Repository Structure\n\n* [src/data/examples/](src/data/examples/Person-001.yaml) - example data\n* [project/](project/) - project files (do not edit these)\n* [src/](src/) - source files (edit these)\n    * [linkml_tutorial](src/linkml_tutorial)\n        * [schema](src/linkml_tutorial/schema) -- LinkML schema (edit this)\n* [datamodel](src/linkml_tutorial/datamodel) -- Generated python datamodel\n* [tests](tests/) - python tests\n\n## Developer Documentation\n\nUse the `make` command to generate project artifacts:\n\n- `make all`: make everything\n- `make deploy`: deploys site\n\nTo validate, create a poetry virtual environment, install the dependencies of this tutorial, and then\nrun the tests and/or linkml-validate.\n\n```bash\npoetry install\npoetry run linkml-validate -s src/linkml_tutorial/schema/linkml_tutorial.yaml src/data/examples/Person-001.yaml --target-class PersonCollection\npoetry run linkml-validate -s src/linkml_tutorial/schema/linkml_tutorial.yaml src/data/examples/Animal-001.yaml --target-class AnimalCollection\n```\n\n```bash\nmake test\n```\n\nTo generate documentation locally (requires mkdocs):\n\n```bash\nmake testdoc\n```\nand navigate to `http://127.0.0.1:8000/linkml-tutorial/`\n\nTo convert the test data from YAML to JSON, run:\n\n```bash\npoetry run linkml-convert -s src/linkml_tutorial/schema/linkml_tutorial.yaml -t json src/data/examples/Animal-001.yaml --target-class AnimalCollection\npoetry run linkml-convert -s src/linkml_tutorial/schema/linkml_tutorial.yaml -t json src/data/examples/Person-001.yaml --target-class PersonCollection\n```\n\nTo convert the test data from YAML to RDF, run:\n\n```bash\npoetry run linkml-convert -s src/linkml_tutorial/schema/linkml_tutorial.yaml -t rdf src/data/examples/Animal-001.yaml --target-class AnimalCollection\npoetry run linkml-convert -s src/linkml_tutorial/schema/linkml_tutorial.yaml -t rdf src/data/examples/Person-001.yaml --target-class PersonCollection\n```\n\nTo compile changed schemasheets, run:\n\n```\nmake compile-sheets\n```\n\nFor more information, please consult the [online LinkML tutorial](https://linkml.io/linkml/intro/tutorial01.html)\nA link to a video tutorial is coming soon!\n\n\n## Credits\n\nthis project was made with [linkml-project-cookiecutter](https://github.com/linkml/linkml-project-cookiecutter)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flinkml%2Flinkml-tutorial","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flinkml%2Flinkml-tutorial","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flinkml%2Flinkml-tutorial/lists"}