Skip to content

Commit 0b54b45

Browse files
Merge branch 'nfdi-de:main' into addition-of-citation-file
2 parents 30709d5 + 67e459b commit 0b54b45

18 files changed

Lines changed: 289 additions & 52 deletions

.github/workflows/deploy-docs.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
steps:
2828
# https://github.com/actions/checkout
2929
- name: Checkout
30-
uses: actions/checkout@v5.0.0
30+
uses: actions/checkout@v6.0.0
3131
with:
3232
fetch-depth: 0 # otherwise, you will fail to push refs to dest repo
3333

@@ -40,15 +40,15 @@ jobs:
4040
4141
# https://github.com/astral-sh/setup-uv
4242
- name: Install uv
43-
uses: astral-sh/setup-uv@v7.1.2
43+
uses: astral-sh/setup-uv@v7.1.4
4444
with:
4545
python-version: 3.13
4646
enable-cache: true
4747
cache-dependency-glob: "uv.lock"
4848

4949
# https://github.com/actions/setup-python
5050
- name: Set up Python
51-
uses: actions/setup-python@v6.0.0
51+
uses: actions/setup-python@v6.1.0
5252
with:
5353
python-version: 3.13
5454

.github/workflows/main.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,21 +26,21 @@ jobs:
2626

2727
# https://github.com/actions/checkout
2828
- name: Check out repository
29-
uses: actions/checkout@v5.0.0
29+
uses: actions/checkout@v6.0.0
3030
with:
3131
persist-credentials: false
3232

3333
# https://github.com/astral-sh/setup-uv
3434
- name: Install uv
35-
uses: astral-sh/setup-uv@v7.1.2
35+
uses: astral-sh/setup-uv@v7.1.4
3636
with:
3737
python-version: ${{ matrix.python-version }}
3838
enable-cache: true
3939
cache-dependency-glob: "uv.lock"
4040

4141
# https://github.com/actions/setup-python
4242
- name: Set up Python ${{ matrix.python-version }}
43-
uses: actions/setup-python@v6.0.0
43+
uses: actions/setup-python@v6.1.0
4444
with:
4545
python-version: ${{ matrix.python-version }}
4646

.github/workflows/pypi-publish.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,20 +28,20 @@ jobs:
2828
steps:
2929
# https://github.com/actions/checkout
3030
- name: Check out repository
31-
uses: actions/checkout@v5.0.0
31+
uses: actions/checkout@v6.0.0
3232
with:
3333
persist-credentials: false
3434

3535
# https://github.com/astral-sh/setup-uv
3636
- name: Install uv
37-
uses: astral-sh/setup-uv@v7.1.2
37+
uses: astral-sh/setup-uv@v7.1.4
3838
with:
3939
python-version: 3.13
4040
enable-cache: true
4141

4242
# https://github.com/actions/setup-python
4343
- name: Set up Python
44-
uses: actions/setup-python@v6.0.0
44+
uses: actions/setup-python@v6.1.0
4545
with:
4646
python-version: 3.13
4747

.github/workflows/test_pages_build.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,19 +28,19 @@ jobs:
2828
steps:
2929
# https://github.com/actions/checkout
3030
- name: Checkout
31-
uses: actions/checkout@v5.0.0
31+
uses: actions/checkout@v6.0.0
3232
with:
3333
fetch-depth: 0
3434

3535
# https://github.com/actions/setup-python
3636
- name: Set up Python 3
37-
uses: actions/setup-python@v6.0.0
37+
uses: actions/setup-python@v6.1.0
3838
with:
3939
python-version: 3.13
4040

4141
# https://github.com/astral-sh/setup-uv
4242
- name: Install uv
43-
uses: astral-sh/setup-uv@v7.1.2
43+
uses: astral-sh/setup-uv@v7.1.4
4444
with:
4545
python-version: 3.13
4646
enable-cache: true
@@ -61,7 +61,7 @@ jobs:
6161
6262
# https://github.com/rossjrw/pr-preview-action
6363
- name: Deploy preview
64-
uses: rossjrw/pr-preview-action@v1.6.2
64+
uses: rossjrw/pr-preview-action@v1.6.3
6565
with:
6666
source-dir: site/
6767
preview-branch: gh-pages

README.md

Lines changed: 95 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,31 @@
33
[![Build and test](https://github.com/nfdi-de/dcat-ap-plus/actions/workflows/main.yaml/badge.svg)](https://github.com/nfdi-de/dcat-ap-plus/actions/workflows/main.yaml)
44
[![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)
55

6-
# dcat-ap-plus
6+
# DCAT Application Profile for Providing Links to Use-case Specific Context (DCAT-AP+)
77

8-
This metadata schema is an Extension of the DCAT Application Profile for Providing Links to Use-case Specific Context. It allows to provide additional metadata regarding: which kind(s) of entity(s) or activity(s) were evaluated (the dcat:Dataset is about), which kind of activity generated the dcat:Dataset, which kind of instruments were used in the dataset generating activity, in which surrounding (e.g. a laboratory) and according to which plan the dataset generating activity took place, as well as regarding which kind(s) of qualitative and quantitative characteristic were attributed to the evaluated entity or evaluated activity and to the used instruments.
8+
The LinkML schema provided in this repository is an extension of the [DCAT Application Profile](https://semiceu.github.io/DCAT-AP/releases/3.0.0/), which allows to provide additional metadata for a `dcat:Dataset` in a very generic manner, such as:
9+
* which kind(s) of entity(s) or activity(s) were evaluated,
10+
* which kind of activity generated the `dcat:Dataset`,
11+
* which kind of instruments were used in the dataset generating activity,
12+
* in which surrounding (e.g. a laboratory) and according to which plan the dataset generating activity took place,
13+
* as well as which kind(s) of qualitative and quantitative characteristic(s) were attributed to the evaluated entity or evaluated activity and to the used instruments.
914

10-
## Documentation Website
15+
This extension is mainly based on the [Starting Point Terms of the Provenance Ontology (PROV-O)](https://www.w3.org/TR/prov-o/#description-starting-point-terms),
16+
in that it makes the `prov:wasGeneratedBy` property of the `Dataset` class mandatory and specifies necessary properties for its expected range, the `prov:Activity` class.
1117

12-
[https://nfdi-de.github.io/dcat-ap-plus](https://nfdi-de.github.io/dcat-ap-plus)
18+
The choice to use LinkML for extending DCAT-AP was based on the need to have different layers that cater to different domain-specific use cases. DCAT-AP+ serves as the basic layer for such extensions and is thus kept very generic. Being the basis of the [ChemDCAT-AP](
19+
nfdi-de.github.io/chem-dcat-ap), one can see how it can be applied to further extend its classes for domain-specific needs.
20+
21+
DCAT-AP+ is developed within close collaboration between [NFDI4Chem](https://nfdi4chem.de) & [NFDI4Cat](https://nfdi4cat.org/) and is intended to be further improved, extended and adapted by the whole NFDI community.
22+
23+
A more elaborate documentation is provided here: [https://nfdi-de.github.io/dcat-ap-plus](hhttps://nfdi-de.github.io/dcat-ap-plus/latest/about/).
24+
25+
## DCAT-AP to LinkML: Automatic Translation and Extension
26+
27+
The JSON-LD serialization of the official DCAT-AP 3.0.0 SHACL shapes ([dcat_ap_shacl.jsonld](src/dcat_ap_shacl.jsonld)) were downloaded from the DCAT-AP GitHub repository [3.0.0 release folder within the master branch](https://github.com/SEMICeu/DCAT-AP/tree/master/releases/3.0.0/shacl). The downloaded SHACL shapes were then processed by the [dcat_ap_shacl_2_linkml.py](src/dcat_ap_shacl_2_linkml.py) script to generate two LinkML schemas from it:
28+
29+
* [dcat_ap_linkml.yaml](src/dcat_ap_plus/schema/dcat_ap_linkml.yaml) - an almost 1:1 translation of the DCAT-AP SHACL shapes to LinkML.
30+
* [dcat_ap_plus.yaml](src/dcat_ap_plus/schema/dcat_ap_plus.yaml) - the LinkML representation of DCAT-AP to which we added the additional constraints, classes and properties we need for our DCAT-AP+ extension.
1331

1432
## Repository Structure
1533

@@ -26,10 +44,80 @@ This metadata schema is an Extension of the DCAT Application Profile for Providi
2644
* [tests/](tests/) - Python tests
2745
* [data/](tests/data) - Example data
2846

29-
## Developer Tools
47+
## Developer Documentation
48+
49+
See also the documentation of the template: https://github.com/linkml/linkml-project-copier?tab=readme-ov-file#prerequisites
50+
51+
* uv
52+
53+
uv is a tool to manage Python projects and for managing isolated Python-based applications. You will use it in your generated project to manage dependencies and build distribution files. Install uv by following their [instructions](https://docs.astral.sh/uv/getting-started/installation/).
54+
55+
Note: Environments with private PyPi repository may need extra configuration (example):
56+
57+
export UV_DEFAULT_INDEX=https://nexus.example.com/repository/pypi-all/simple
58+
*
59+
60+
Copier
61+
62+
Copier is a tool for generating projects based on a template (like this one!). It also allows re-configuring the projects and to keep them updated when the original template changes. To insert dates into the template, copier requires [jinja2_time](https://github.com/hackebrot/jinja2-time) in the copier environment. Install both with uv by running:
63+
64+
uv tool install --with jinja2-time copier
65+
66+
* just
67+
68+
The project contains a justfile with pre-defined complex commands. To execute these commands you need [just](https://github.com/casey/just) as command runner. Install it by running:
69+
70+
uv tool install rust-just
71+
72+
To generate project artefacts run:
73+
`just gen-project`: generates all other representations
74+
`just deploy`: deploys site
75+
`just testdoc`: locally builds docs and runs test server
76+
77+
### Regenerate schema files from DCAT-AP SHACL shapes
78+
79+
To regenerate the DCAT-AP LinkML representation as well as the PLUS extension run:
80+
81+
uv run python src/dcat_ap_shacl_2_linkml.py
82+
83+
### Test data validation and convertion
84+
85+
Validate and test all: `just test`
86+
87+
Validate a single example dataset using LinkML's validator framework:
88+
89+
* Validate DCAT-AP-PLUS extension conform example
90+
````commandline
91+
uv run linkml validate tests/data/valid/AnalysisDataset-001.yaml -s src/dcat_ap_plus/schema/dcat_ap_plus.yaml -C AnalysisDataset
92+
````
93+
* Validate DCAT-AP-PLUS extension conform example
94+
````commandline
95+
uv run linkml validate tests/data/valid/Dataset-001.yaml -s src/dcat_ap_plus/schema/dcat_ap_plus.yaml -C Dataset
96+
````
97+
98+
To convert the test datasets of each DCAT-AP profile into a TTL graph run:
99+
* Convert domain agnostic DCAT-AP extension conform example of an analysis
100+
````commandline
101+
uv run linkml-convert -t ttl tests/data/valid/AnalysisDataset-001.yaml -s src/dcat_ap_plus/schema/dcat_ap_plus.yaml -P "_base=https://search.nfdi4chem.de/dataset/" -C AnalysisDataset
102+
````
103+
* Convert a NMR spectroscopy-specific DCAT-AP extension conform example
104+
````commandline
105+
uv run linkml-convert -t ttl tests/data/valid/Dataset-001.yaml -s ssrc/dcat_ap_plus/schema/dcat_ap_plus.yaml -P "_base=https://search.nfdi4chem.de/dataset/" -C Dataset
106+
````
107+
108+
### Build GitHub pages docs locally
109+
110+
uv run mkdocs serve
111+
112+
rm -rf docs/elements/*.md && uv run gen-doc -d docs/elements src/dcat_ap_plus/schema/dcat_ap_plus.yaml
113+
114+
## Funding
115+
116+
This work was funded by the German Research Foundation (DFG) through the projects:
117+
* "[NFDI4Cat](https://nfdi4cat.org/) - NFDI for Catalysis-Related Sciences" (DFG project no. [441926934](https://gepris.dfg.de/gepris/projekt/441926934)) and
118+
* "[NFDI4Chem](https://nfdi4chem.de) - NFDI for Chemistry" (DFG project no. [441958208](https://gepris.dfg.de/gepris/projekt/441958208))"
30119
31-
There are several pre-defined command-recipes available.
32-
They are written for the command runner [just](https://github.com/casey/just/). To list all pre-defined commands, run `just` or `just --list`.
120+
within the National Research Data Infrastructure (NFDI) programme of the Joint Science Conference (GWK).
33121
34122
## Credits
35123

README_pypkg.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
# dcat_ap_plus
22

3-
Extension of the DCAT Application Profile (DCAT-AP) that adds links to use-case specific context. It enables describing:
4-
5-
- which entities or activities were evaluated (the dataset is about),
6-
- which activity generated the dataset, including instruments, environment (e.g., lab), and plan,
7-
- which qualitative and quantitative characteristics were attributed to evaluated entities/activities and used instruments.
3+
An extension of the [DCAT Application Profile](https://semiceu.github.io/DCAT-AP/releases/3.0.0/), which allows to provide additional metadata for a `dcat:Dataset` in a very generic manner, such as:
4+
* which kind(s) of entity(s) or activity(s) were evaluated,
5+
* which kind of activity generated the `dcat:Dataset`,
6+
* which kind of instruments were used in the dataset generating activity,
7+
* in which surrounding (e.g. a laboratory) and according to which plan the dataset generating activity took place,
8+
* as well as which kind(s) of qualitative and quantitative characteristic(s) were attributed to the evaluated entity or evaluated activity and to the used instruments.
89

910
This package ships the LinkML-generated Python datamodel for the schema.
1011
Two versions of the datamodel are provided: one using Python dataclasses and another using Pydantic.
@@ -38,7 +39,7 @@ print(ds)
3839
## Documentation
3940

4041
- Project docs and schema reference: <https://nfdi-de.github.io/dcat-ap-plus>
41-
- Source code: <https://github.com/dalito/dcat-ap-plus>
42+
- Source code: <https://github.com/nfdi-de/dcat-ap-plus>
4243

4344
## License
4445

docs/about.md

Lines changed: 28 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,28 @@
1-
# About dcat-ap-plus
2-
3-
This metadata schema is an Extension of the DCAT Application Profile
4-
for Providing Links to Use-case Specific Context. It allows to provide additional
5-
metadata regarding: which kind(s) of entity(s) or activity(s) were evaluated (the
6-
dcat:Dataset is about), which kind of activity generated the dcat:Dataset, which
7-
kind of instruments were used in the dataset generating activity, in which surrounding
8-
(e.g. a laboratory) and according to which plan the dataset generating activity
9-
took place, as well as regarding which kind(s) of qualitative and quantitative characteristic
10-
were attributed to the evaluated entity or evaluated activity and to the used instruments.
1+
# About DCAT-AP+
2+
3+
Funded by the German Research Foundantion (DFG) as part of the German National Research Data Infrastucture (NFDI)
4+
initiative under the grant numbers [441926934](https://gepris.dfg.de/gepris/projekt/441926934) and [441958208](https://gepris.dfg.de/gepris/projekt/441958208),
5+
DCAT-AP+ is being developed in close collaboration between the German research
6+
infrastructure projects [NFDI4Chem](https://nfdi4chem.de) and [NFDI4Cat](https://nfdi4cat.org/).
7+
8+
To allow more fine-grained and semantic searches within their data repositories,
9+
both projects had to address the need to also provide detailed chemistry-specific metadata for the research data output
10+
of their communities. Due to the disciplinary overlap of both projects, their previous collaboration was thus intensified
11+
to produce a common metadata schema called [ChemDCAT-AP](nfdi-de.github.io/chem-dcat-ap/), an extension of the
12+
[DCAT Application Profile](https://semiceu.github.io/DCAT-AP/releases/3.0.0/) that is based mostly on
13+
the [Starting Point Terms](https://www.w3.org/TR/prov-o/#description-starting-point-terms) of the W3C standard the Provenance Ontology (PROV-O). With ChemDCAT-AP, the chemical
14+
substances, entities and reactions covered by a dataset as well as the processes,
15+
tools and devices that were involved its creation can be described in a semantically uniform way that allows further
16+
use-case specific extension.
17+
This work will be published and presented at the 19th International Conference on Metadata and Semantics Research
18+
([MTSR](https://www.mtsr-conf.org/home)) Thessaloniki, Greece, 15 - 19 December 2025.
19+
20+
Since the underlying basic design patterns of ChemDCAT-AP are domain-agnostic and thus applicable to a much wider
21+
range of use cases, the core layer of ChemDCAT-AP, called DCAT-AP+, was decided to be outsourced into its own repository.
22+
23+
## Next Steps
24+
Within the [NFDI Section Metadata Working Group Ontology Harmonization and Mapping](https://www.nfdi.de/section-metadata/),
25+
we started to test and discuss the applicability of DCAT-AP+ for the whole NFDI community. Additionally, we currently
26+
investigate the feasibility of providing more semantic depth and interoperability by mapping the DCAT-AP+ schema
27+
elements to the [NFDIcore ontology](https://nfdi.fiz-karlsruhe.de/ontology/) instead of the PROV-O and DCTerms
28+
whenever appropriate.

docs/automatic-generation.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# Automatic generation of DCAT-AP+
2+
In order to build an extension of DCAT-AP, a faithful translation of DCAT-AP into a LinkML schema was provided first.
3+
For this, the JSON-LD serialization of the official DCAT-AP 3.0.0 SHACL shapes ([dcat_ap_shacl.jsonld](src/dcat_ap_shacl.jsonld)) were used,
4+
which we downloaded from the DCAT-AP GitHub repository [3.0.0 release folder within the master branch](https://github.com/SEMICeu/DCAT-AP/tree/master/releases/3.0.0/shacl).
5+
These SHACL shapes were then processed by the
6+
[dcat_ap_shacl_2_linkml.py](https://github.com/nfdi-de/dcat-ap-plus/blob/main/src/dcat_ap_plus/dcat_ap_shacl_2_linkml.py)
7+
script to generate two LinkML schemas from it:
8+
9+
* [dcat_ap_linkml.yaml](src/dcat_ap_plus/schema/dcat_ap_linkml.yaml) - an almost 1:1 translation of the DCAT-AP SHACL shapes to LinkML.
10+
* [dcat_ap_plus.yaml](src/dcat_ap_plus/schema/dcat_ap_plus.yaml) - the LinkML representation of DCAT-AP to which we added the additional constraints,
11+
* classes and properties we need for our provenance based extension.
12+
13+
## Automatic Translation of DCAT-AP into LinkML
14+
The `dcat_ap_shacl_2_linkml.py` module performs the translation by reading the DCAT-AP JSON-LD file and generating
15+
corresponding LinkML constructs. DCAT-AP's SHACL node shapes are mapped to either LinkML classes or datatypes depending
16+
on whether they target ontology classes or XSD types, with property shapes serving as the basis for class slots. To
17+
ensure the new model remains semantically identical to the source, the original term IRIs are retained verbatim in the
18+
`class_uri` and `slot_uri` fields, drawn from the SHACL `targetClass` and `path` attributes.
19+
20+
Regarding range definitions, we addressed union ranges differently based on type. Object class unions, such as
21+
`dcat:primaryTopic`, were managed using the LinkML
22+
[any_of](https://linkml.io/linkml/schemas/advanced.html#unions-as-ranges) feature. Conversely, due to the lack of
23+
stable support for datatype unions in LinkML ([see issue](https://github.com/linkml/linkml/issues/1813)), we enforced a
24+
stricter interpretation for date-related slots, restricting them to the XSD date datatype. This approach allows us to
25+
meet current project needs while expecting full datatype union support in upcoming updates.
26+
27+
To adhere to LinkML's naming convention, we also changed the names of the derived and added slots from camel case to
28+
snake case.
29+
30+
## Automatic Extension of DCAT-AP in LinkML
31+
To produce the DCAT-AP+ extension, we used the same Python script to add the additional constraints, classes and
32+
properties we needed, which are described in more detail in the
33+
[Design Patterns and Decisions section](design-patterns.md).
34+
Consequently, any future changes to DCAT-AP+ must be made in the `dcat_ap_shacl_2_linkml.py`
35+
([L412-L991](https://github.com/nfdi-de/dcat-ap-plus/blob/main/src/dcat_ap_plus/dcat_ap_shacl_2_linkml.py#L412-L991)).

docs/dcat-ap-plus-users.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Projects using DCAT-AP+
2+
The following projects use DCAT-AP+ as a basis for further domain-specific extensions of DCAT-AP
3+
4+
- [ChemDCAT-AP](https://nfdi-de.github.io/chem-dcat-ap): A chemistry specific DCAT-AP extension from which DCAT-AP+ was spun off.
5+
- [NMR-DCAT-AP](https://nfdi4chem.github.io/nmr-dcat-ap/): An extension of ChemDCAT-AP that formalizes the NFDI4Chem NMR Minimal Information Standard.

0 commit comments

Comments
 (0)