Skip to content

Validate prefix maps against Semantic Farm - #73

Open
cthoyt wants to merge 4 commits into
nfdi-de:mainfrom
cthoyt-forks:add-bioregistry-validation
Open

Validate prefix maps against Semantic Farm#73
cthoyt wants to merge 4 commits into
nfdi-de:mainfrom
cthoyt-forks:add-bioregistry-validation

Conversation

@cthoyt

@cthoyt cthoyt commented Mar 27, 2026

Copy link
Copy Markdown

Motivation

LinkML doesn't support modelers in defining meaningful prefix maps.

Therefore, we have to look to external tooling to do so. I wrote about tooling in the Semantic Farm that supports modelers to define meaningful prefix maps: https://cthoyt.com/2026/01/06/bioregistry-linkml-validation.html

Summary of Changes

This PR adds the Semantic Farm LinkML prefix map validation / feedback workflow into the tests in this repository. It immediately surfaces several issues, some of which could be added as new prefixes in the Semantic Farm, and some of which might need to be reconsidered.

This PR also bumps the minimum python version from 3.9 to 3.10 - 3.9 is past end of life and software like Bioregistry (and soon, LinkML) don't support it.

Errors in DCAT-AP LinkML

$ bioregistry validate linkml --use-preferred https://github.com/nfdi-de/dcat-ap-plus/blob/main/src/dcat_ap_plus/schema/dcat_ap_linkml.yaml

gives:

prefix uri_prefix issue solution
dcatap http://data.europa.eu/r5r/ unknown CURIE prefix added to Semantic Farm in biopragmatics/bioregistry#1869
vl https://purl.eu/ns/shacl# unknown CURIE prefix replace with W3 definition of SHACL, see #76
iana https://www.iana.org/assignments/ unknown CURIE prefix Consider switching to the more specific CURIE/URI prefix pair iana.mediatype: https://www.iana.org/assignments/media-types/
epos https://www.epos-eu.org/epos-dcat-ap# unknown CURIE prefix added to Semantic Farm in biopragmatics/bioregistry#1869
dcatap_linkml https://w3id.org/nfdi-de/dcat-ap-linkml/ unknown CURIE prefix

Errors in DCAT-AP Plus

$ bioregistry validate linkml --use-preferred https://github.com/nfdi-de/dcat-ap-plus/blob/main/src/dcat_ap_plus/schema/dcat_ap_plus.yaml

gives:

prefix uri_prefix issue solution
dcatap http://data.europa.eu/r5r/ unknown CURIE prefix added to Semantic Farm in biopragmatics/bioregistry#1869
vl https://purl.eu/ns/shacl# unknown CURIE prefix this should be the W3 definition for SHACL, see #76
iana https://www.iana.org/assignments/ unknown CURIE prefix Consider switching to the more specific CURIE/URI prefix pair iana.mediatype: https://www.iana.org/assignments/media-types/
epos https://www.epos-eu.org/epos-dcat-ap# unknown CURIE prefix added to Semantic Farm in biopragmatics/bioregistry#1869
dcatapplus https://w3id.org/nfdi-de/dcat-ap-plus/ unknown CURIE prefix
SOSA http://www.w3.org/ns/sosa/ non-standard CURIE prefix Switch to preferred prefix: sosa
AFE http://purl.allotrope.org/ontologies/equipment#AFE_ unknown CURIE prefix Added allotrope.equipment in biopragmatics/bioregistry#1919, switch to using that instead of AFE
ex http://example.org/ unknown CURIE prefix use concrete examples, not made up ones

See Also

P.S. I made this PR biopragmatics/bioregistry#1866 to expose this functionality more nicely :)

@dalito

dalito commented Mar 27, 2026

Copy link
Copy Markdown
Collaborator

I like the idea and allowed CI to run for you as new contributor.

...as the CI runs show such checks should be in place.

Comment thread tests/test_data.py Outdated
@dalito

dalito commented Mar 29, 2026

Copy link
Copy Markdown
Collaborator

Before we merge this, we should fix #74 to keep CI green.

@HendrikBorgelt

Copy link
Copy Markdown
Collaborator

We also need to take a look at why we have some prefixes in our LinkML schema. epos and vl don't seem to be used, and I think @StroemPhi is still trying to drop AFE references. The prefix ex can be deleted, since we don't target this namespace, nor do we need it for your example data.

For the Prefix dcatap_linkml, I would like to get feedback from @dalito, @markdoerr, and @StroemPhi if we should even implement this. I opened an Issue at biopragmatics/bioregistry#1868, which we could use as a draft.

@StroemPhi

Copy link
Copy Markdown
Member

As I just wrote to @HendrikBorgelt via RC, I'm for registering all our namespaces also in the Semantic Farm to make use of @cthoyt's automated checks. And I'm for snake_casing.
The Allotrope prefixes need to be present as long as we use AFO terms for the mapping. We can only drop those once we have alternatives in CHMO and similar ones.

@cthoyt

cthoyt commented Apr 17, 2026

Copy link
Copy Markdown
Author

regarding AFO, most of the subspaces were already in Semantic Farm. I added one for allotrope.equipment in biopragmatics/bioregistry#1919

HendrikBorgelt added a commit to HendrikBorgelt/dcat-ap-plus that referenced this pull request Apr 20, 2026
As discussed in PR nfdi-de#73, I changed prefixes:

dcatapplus --> dcat_ap_plus

iana --> iana.mediatype: https://www.iana.org/assignments/media-types/
SOSA --> sosa
AFE --> allotrope.equipment

Deleted: vl & ex
HendrikBorgelt added a commit to HendrikBorgelt/dcat-ap-plus that referenced this pull request Apr 20, 2026
As discussed in PR nfdi-de#73, I changed prefixes:

dcatapplus --> dcat_ap_plus

iana --> iana.mediatype: https://www.iana.org/assignments/media-types/
SOSA --> sosa
AFE --> allotrope.equipment

Deleted: vl & ex
HendrikBorgelt added a commit to HendrikBorgelt/dcat-ap-plus that referenced this pull request Apr 20, 2026
As discussed in PR nfdi-de#73, I changed prefixes:

dcatapplus --> dcat_ap_plus

iana --> iana.mediatype: https://www.iana.org/assignments/media-types/
SOSA --> sosa
AFE --> allotrope.equipment

Deleted: vl & ex

Revert "prepared schema files for prefixes by the semantic farm"

This reverts commit f710e24.

prepared schema files for prefixes by the semantic farm

As discussed in PR nfdi-de#73, I changed prefixes:

dcatapplus --> dcat_ap_plus

iana --> iana.mediatype: https://www.iana.org/assignments/media-types/
SOSA --> sosa
AFE --> allotrope.equipment

Deleted: vl & ex
HendrikBorgelt added a commit to HendrikBorgelt/dcat-ap-plus that referenced this pull request Apr 20, 2026
As discussed in PR nfdi-de#73, I changed prefixes:

dcatapplus --> dcat_ap_plus

iana --> iana.mediatype: https://www.iana.org/assignments/media-types/
SOSA --> sosa
AFE --> allotrope.equipment

Deleted: vl & ex
HendrikBorgelt added a commit to HendrikBorgelt/dcat-ap-plus that referenced this pull request Apr 20, 2026
As discussed in PR nfdi-de#73, I changed prefixes:

dcatapplus --> dcat_ap_plus

iana --> iana.mediatype: https://www.iana.org/assignments/media-types/
SOSA --> sosa
AFE --> allotrope.equipment

Deleted: vl & ex
HendrikBorgelt added a commit to HendrikBorgelt/dcat-ap-plus that referenced this pull request Apr 20, 2026
As discussed in PR nfdi-de#73, I changed prefixes:

dcatapplus --> dcat_ap_plus

iana --> iana.mediatype: https://www.iana.org/assignments/media-types/
SOSA --> sosa
AFE --> allotrope.equipment

Deleted: vl & ex
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants