Skip to content

Commit b99219d

Browse files
committed
Change to multi version schema docs
1 parent 4762fd7 commit b99219d

28 files changed

Lines changed: 693 additions & 99 deletions

.github/workflows/deploy-docs.yaml

Lines changed: 33 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,14 @@
22
name: Deploy docs
33
on: # yamllint disable-line rule:truthy
44
push:
5-
branches: [main]
5+
tags:
6+
- 'v[0-9]+.[0-9]+.[0-9]+'
7+
- 'v[0-9]+.[0-9]+.[0-9]+rc[0-9]'
8+
branches:
9+
- main
10+
pull_request:
11+
branches:
12+
- main
613
workflow_dispatch:
714

815
permissions: {}
@@ -55,4 +62,28 @@ jobs:
5562
- name: Generate schema documentation
5663
run: |
5764
just gen-doc
58-
uv run mkdocs gh-deploy
65+
66+
# The if-conditions below make sure to select the right step, depending
67+
# on the job trigger. Only one of the steps below will run at a time.
68+
# The others will be skipped.
69+
70+
- name: Check docs in pull requests with strict mode
71+
if: github.event_name == 'pull_request'
72+
run: |
73+
# XXX Enable strict mode once docs are clean
74+
echo "Strict check of docs disabled."
75+
# uv run mkdocs build --strict
76+
77+
# yamllint disable rule:line-length
78+
- name: Build & deploy "dev" docs for a new commit to main
79+
80+
if: (github.event_name == 'push' && github.ref_type != 'tag') || github.event_name == 'workflow_dispatch'
81+
run: |
82+
export SHORT_SHA=$(echo "${GITHUB_SHA}" | cut -c1-7)
83+
uv run mike deploy --push --update-aliases --title "dev (${SHORT_SHA})" dev
84+
85+
- name: Build & deploy docs for a new version tag
86+
if: github.ref_type == 'tag' && github.event_name == 'push'
87+
run: |
88+
uv run mike deploy --push --update-aliases ${{ github.ref_name }} latest
89+
uv run mike set-default latest --push

.github/workflows/main.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,17 +37,17 @@ jobs:
3737
python-version: ${{ matrix.python-version }}
3838
enable-cache: true
3939
cache-dependency-glob: "uv.lock"
40+
4041
# https://github.com/actions/setup-python
4142
- name: Set up Python ${{ matrix.python-version }}
42-
uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548
43+
uses: actions/setup-python@v6.1.0
4344
with:
4445
python-version: ${{ matrix.python-version }}
4546

4647
- name: Install just
4748
run: |
4849
uv tool install rust-just
4950
50-
5151
- name: Install project
5252
run: uv sync --dev
5353

.github/workflows/pypi-publish.yaml

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -65,36 +65,29 @@ jobs:
6565
runs-on: ubuntu-latest
6666
environment:
6767
name: pypi-release
68-
url: https://pypi.org/p/dcat_4c_ap
68+
url: https://pypi.org/chem-dcat-ap
6969
permissions:
7070
id-token: write # this permission is mandatory for trusted publishing
7171
steps:
7272
# https://github.com/actions/download-artifact
7373
- name: Download built distribution
74-
uses: actions/download-artifact@v4.3.0
74+
uses: actions/download-artifact@v6.0.0
7575
with:
7676
name: distribution-files
7777
path: dist
7878

7979
# https://github.com/pypa/gh-action-pypi-publish
8080
- name: Publish package 📦 to Test PyPI
8181
if: github.event_name == 'push'
82-
uses: pypa/gh-action-pypi-publish@v1.12.4
82+
uses: pypa/gh-action-pypi-publish@v1.13.0
8383
with:
8484
repository-url: https://test.pypi.org/legacy/
8585
verbose: true
8686

8787
- name: Publish package 📦 to PyPI
8888
if: github.event_name == 'release'
89-
uses: pypa/gh-action-pypi-publish@v1.12.4
89+
uses: pypa/gh-action-pypi-publish@v1.13.0
9090
with:
9191
verbose: true
9292

9393
# [1] https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#filter-pattern-cheat-sheet
94-
# Used actions: (updates managed by dependabot)
95-
# - https://github.com/actions/checkout
96-
# - https://github.com/astral-sh/setup-uv
97-
# - https://github.com/actions/setup-python
98-
# - https://github.com/actions/upload-artifact
99-
# - https://github.com/actions/download-artifact
100-
# - https://github.com/pypa/gh-action-pypi-publish/

.github/workflows/test_pages_build.yaml

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ permissions: {}
1616

1717
jobs:
1818
run:
19+
# Don't run for PRs from forks
20+
if: github.event.pull_request.head.repo.full_name == github.repository
1921
# Grant GITHUB_TOKEN the permissions required to make a gh-pages deployment
2022
permissions:
2123
contents: write # to let mkdocs write the new docs
@@ -30,25 +32,30 @@ jobs:
3032
with:
3133
fetch-depth: 0
3234

35+
# https://github.com/actions/setup-python
36+
- name: Set up Python 3
37+
uses: actions/setup-python@v6.1.0
38+
with:
39+
python-version: 3.13
40+
3341
# https://github.com/astral-sh/setup-uv
3442
- name: Install uv
3543
uses: astral-sh/setup-uv@v7.1.4
3644
with:
3745
python-version: 3.13
3846
enable-cache: true
3947
cache-dependency-glob: "uv.lock"
40-
# https://github.com/actions/setup-python
41-
- name: Set up Python 3
42-
uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548
43-
with:
44-
python-version: 3.13
4548

49+
- name: Install just
50+
run: |
51+
uv tool install rust-just
4652
4753
- name: Install dependencies
4854
run: uv sync --dev --no-progress
4955

5056
- name: Build documentation
5157
run: |
58+
just gen-doc
5259
uv run mkdocs build -d site
5360
touch site/.nojekyll
5461

.gitignore

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,23 @@
1+
docs/local-js-pkgs
2+
13
# generated part of documentation
2-
/docs/elements/*.md
4+
docs/elements/**/*.md
5+
6+
# generated merged schema
7+
docs/schema/*
8+
!docs/schema/README.md
39

410
# linkml-run-examples output (not useful to have in git in its current form)
511
/examples/output/*.yaml
612

713
# Derived schemas, generated from the schema.yaml
814
tmp/
915

16+
# generated model representations of generators that ignore config.yaml
17+
project/java
18+
project/owl
19+
project/typescript
20+
1021
# Byte-compiled / optimized / DLL files
1122
__pycache__/
1223
*.py[cod]
@@ -141,7 +152,3 @@ dmypy.json
141152
.idea
142153
# Local vscode editor config
143154
.vscode
144-
/docs
145-
/.idea
146-
/docs
147-
/.idea

.pre-commit-config.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# https://pre-commit.com/
33
repos:
44
- repo: https://github.com/pre-commit/pre-commit-hooks
5-
rev: v5.0.0
5+
rev: v6.0.0
66
hooks:
77
- id: check-toml
88
- id: check-yaml
@@ -11,7 +11,7 @@ repos:
1111
args: [--markdown-linebreak-ext=md]
1212

1313
- repo: https://github.com/adrienverge/yamllint.git
14-
rev: v1.37.0
14+
rev: v1.37.1
1515
hooks:
1616
- id: yamllint
1717
args: [-c=.yamllint.yaml]
@@ -24,13 +24,13 @@ repos:
2424
- tomli
2525

2626
- repo: https://github.com/crate-ci/typos
27-
rev: v1.31.1
27+
rev: v1.39.2
2828
hooks:
2929
- id: typos
3030

3131
- repo: https://github.com/astral-sh/ruff-pre-commit
3232
# Ruff version.
33-
rev: v0.11.3
33+
rev: v0.14.6
3434
hooks:
3535
# Run the linter.
3636
- id: ruff
@@ -40,6 +40,6 @@ repos:
4040

4141
- repo: https://github.com/astral-sh/uv-pre-commit
4242
# uv version.
43-
rev: 0.6.12
43+
rev: 0.9.11
4444
hooks:
4545
- id: uv-lock

.zenodo.json

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
{
2+
"access_right": "open",
3+
"communities": [
4+
{"identifier": "nfdi4cat"},
5+
{"identifier": "nfdi4chem"}
6+
],
7+
"creators": [
8+
{
9+
"name": "Str\u00f6mert, Philip",
10+
"orcid": "0000-0002-1595-3213",
11+
"affiliation": "TIB - Leibniz Information Centre for Science and Technology, Germany"
12+
},
13+
{
14+
"name": "Borgelt, Hendrik",
15+
"orcid": "0000-0001-5886-7860",
16+
"affiliation": "TU Dortmund University, Germany"
17+
},
18+
{
19+
"name": "Doerr, Mark",
20+
"orcid": "0000-0003-3270-6895",
21+
"affiliation": "University of Greifswald, Germany"
22+
},
23+
{
24+
"name": "Linke, David",
25+
"orcid": "0000-0002-5898-1820",
26+
"affiliation": "Leibniz Institute for Catalysis, Albert-Einstein-Str. 29 A, 18059 Rostock, Germany"
27+
}
28+
],
29+
"description": "<p><a href=\"https://nfdi-de.github.io/chem-dcat-ap/\">ChemDCAT-AP</a> is a metadata schema extension for providing chemistry specific metadata for a dataset. It builds upon the domain-agnostic <a href=\"https://nfdi-de.github.io/dcat-ap-plus/\">DCAT-AP-PLUS</a> schema.</p> <p>The metadata schema is developend as <a href=\"https://linkml.io/\">LinkML</a> model which allows to generate various artefacts such as JSON-Schema, SHACL shapes, Python-bindings, and documentation.</p>",
30+
"keywords": [
31+
"LinkML", "DCAT", "DCAT-AP", "data modelling"
32+
],
33+
"license": "MIT",
34+
"related_identifiers": [
35+
{
36+
"identifier": "doi:10.5281/zenodo.5703670",
37+
"relation": "requires",
38+
"resource_type": "software",
39+
"scheme": "doi"
40+
}
41+
],
42+
"upload_type": "software"
43+
}

CONTRIBUTING.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
# Contributing to dcat-4C-ap
1+
# Contributing to chem-dcat-ap
22

33
:+1: First of all: Thank you for taking the time to contribute!
44

55
The following is a set of guidelines for contributing to
6-
dcat-4C-ap. These guidelines are not strict rules.
6+
chem-dcat-ap. These guidelines are not strict rules.
77
Use your best judgment, and feel free to propose changes to this document
88
in a pull request.
99

@@ -22,7 +22,7 @@ in a pull request.
2222

2323
## Code of Conduct
2424

25-
The dcat-4C-ap team strives to create a
25+
The chem-dcat-ap team strives to create a
2626
welcoming environment for editors, users and other contributors.
2727
Please carefully read our [Code of Conduct](CODE_OF_CONDUCT.md).
2828

@@ -73,7 +73,7 @@ Please submit a [Pull Request][pulls] to submit a new term for consideration.
7373
- Never work on the main branch, always work on an issue/feature branch
7474
- Core developers can work on branches off origin rather than forks
7575
- Always create a PR on a branch to maximize transparency of what you are doing
76-
- PRs should be reviewed and merged in a timely fashion by the dcat-4C-ap technical leads
76+
- PRs should be reviewed and merged in a timely fashion by the chem-dcat-ap technical leads
7777
- PRs that do not pass GitHub actions should never be merged
7878
- In the case of git conflicts, the contributor should try and resolve the conflict
7979
- If a PR fails a GitHub action check, the contributor should try and resolve the issue in a timely fashion
@@ -102,20 +102,20 @@ Core developers should read the material on the [LinkML site](https://linkml.io/
102102
- Include examples and counter-examples (intentionally invalid examples)
103103
- Rationale: these serve as documentation and unit tests
104104
- These will be used by the automated test suite
105-
- All elements of the nmdc-schema must be illustrated with valid and invalid data examples in src/data. New schema elements will not be merged into the main branch until examples are provided
105+
- All elements of the schema must be illustrated with valid and invalid data examples in src/data. New schema elements will not be merged into the main branch until examples are provided
106106
- Invalid example data files should be invalid for one single reason, which should be reflected in the filename. It should be possible to render the invalid example files valid by addressing that single fault.
107107
- Use enums for categorical values
108108
- Rationale: Open-ended string ranges encourage multiple values to represent the same entity, like “water”, “H2O” and “HOH”
109109
- Any slot whose values could be constrained to a finite set should use an Enum
110110
- Non-categorical values, e.g. descriptive fields like `name` or `description` fall outside of this.
111111
- Reuse
112112
- Existing scheme elements should be reused where appropriate, rather than making duplicative elements
113-
- More specific classes can be created by refinining classes using inheritance (`is_a`)
113+
- More specific classes can be created by refining classes using inheritance (`is_a`)
114114

115115
[about-branches]: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/about-branches
116116
[about-issues]: https://docs.github.com/en/issues/tracking-your-work-with-issues/about-issues
117117
[about-pulls]: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/about-pull-requests
118-
[issues]: https://github.com/StroemPhi/dcat-4C-ap/issues/
119-
[pulls]: https://github.com/StroemPhi/dcat-4C-ap/pulls/
118+
[issues]: https://github.com/nfdi-de/chem-dcat-ap/issues/
119+
[pulls]: https://github.com/nfdi-de/chem-dcat-ap/pulls/
120120

121121
We recommend also reading [GitHub Pull Requests: 10 Tips to Know](https://blog.mergify.com/github-pull-requests-10-tips-to-know/)

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
[![DOI](https://zenodo.org/badge/1080296103.svg)](https://doi.org/10.5281/zenodo.17702369)
2+
[![PyPI - Version](https://img.shields.io/pypi/v/chem-dcat-ap)](https://pypi.org/project/chem-dcat-ap)
3+
[![Build and test](https://github.com/nfdi-de/chem-dcat-ap/actions/workflows/main.yaml/badge.svg)](https://github.com/nfdi-de/chem-dcat-ap/actions/workflows/main.yaml)
4+
[![Copier Badge](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/copier-org/copier/master/img/badge/badge-grayscale-inverted-border-teal.json)](https://github.com/linkml/linkml-project-copier)
5+
16
# Chem-DCAT-AP
27

38
This is an extension of the DCAT Application Profile v3.0 in LinkML. It is intended to be used by NFDI4Chem & NFDI4Cat

README_pypkg.md

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# Chem-DCAT-AP
2+
3+
Extension of the DCAT Application Profile (DCAT-AP) tailored for chemistry-related data.
4+
It adds links to use-case specific context and enables describing:
5+
6+
- chemical datasets (e.g. spectra, chromatograms, assay results)
7+
- related samples, substances and instruments
8+
- provenance, experimental conditions and other domain-specific metadata
9+
10+
From the LinkML schemas in `src/chem_dcat_ap/schema/*.yaml`, two Python datamodel variants are generated:
11+
12+
- A variant based on Python `dataclasses`
13+
- A variant based on Pydantic models
14+
15+
## Installation
16+
17+
```powershell
18+
pip install chem-dcat-ap
19+
```
20+
21+
Requires Python >= 3.9, < 4.0.
22+
23+
## Quick start
24+
25+
The package exposes the generated classes that correspond to the entities defined in the
26+
`src/chem_dcat_ap/schema/*.yaml` LinkML schemas.
27+
28+
```python
29+
import chem_dcat_ap
30+
from chem_dcat_ap.datamodel.chem_dcat_ap import Dataset, DataGeneratingActivity
31+
32+
print(chem_dcat_ap.__version__)
33+
34+
dataset = Dataset(
35+
id="https://example.org/dataset/chem-001",
36+
title="Example chemical dataset",
37+
description="Minimal example dataset following the Chem-DCAT-AP schema.",
38+
was_generated_by=DataGeneratingActivity(
39+
id="https://example.org/activity/chem-001"
40+
),
41+
)
42+
43+
print(dataset)
44+
```
45+
46+
For details about all available classes and fields, inspect the schema YAML files in
47+
`src/chem_dcat_ap/schema/` and the generated module `chem_dcat_ap.datamodel.chem_dcat_ap`.
48+
49+
## Documentation
50+
51+
- Project docs and schema reference: <https://nfdi-de.github.io/dcat-ap-plus>
52+
- Source code: <https://github.com/nfdi-de/chem-dcat-ap>
53+
54+
## License
55+
56+
MIT License. See the bundled `LICENSE` file for details.

0 commit comments

Comments
 (0)