From fc9ff77e1dc385e187fa255a63f59d57af0829ce Mon Sep 17 00:00:00 2001 From: Michael Hanke Date: Wed, 24 Jun 2026 17:57:57 +0200 Subject: [PATCH 1/3] fix: various minor issues identified by LinkML 1.11 linting --- src/study-mixin/unreleased.yaml | 1 + src/things-distributions/unreleased.yaml | 1 + src/things-distributions/v1.yaml | 1 + src/things-files/unreleased.yaml | 1 + src/things-files/v1.yaml | 1 + src/things-study/unreleased.yaml | 1 + src/things-study/v1.yaml | 1 + src/things/v1/examples/Thing-04-relations.json | 4 ++-- src/things/v1/examples/Thing-04-relations.yaml | 2 +- src/things/v1/examples/Thing-05-publication.json | 6 +++--- src/things/v1/examples/Thing-05-publication.yaml | 4 ++-- 11 files changed, 15 insertions(+), 8 deletions(-) diff --git a/src/study-mixin/unreleased.yaml b/src/study-mixin/unreleased.yaml index 79fe86a..4ef87db 100644 --- a/src/study-mixin/unreleased.yaml +++ b/src/study-mixin/unreleased.yaml @@ -30,6 +30,7 @@ license: MIT prefixes: dcterms: http://purl.org/dc/terms/ dlcommonmx: https://concepts.datalad.org/s/common-mixin/unreleased/ + dlschemas: https://concepts.datalad.org/s/ dlstudymx: https://concepts.datalad.org/s/study-mixin/unreleased/ dlthings: https://concepts.datalad.org/s/things/v1/ dltypes: https://concepts.datalad.org/s/types/v1/ diff --git a/src/things-distributions/unreleased.yaml b/src/things-distributions/unreleased.yaml index d805caa..2f8d03a 100644 --- a/src/things-distributions/unreleased.yaml +++ b/src/things-distributions/unreleased.yaml @@ -32,6 +32,7 @@ prefixes: dlschemas: https://concepts.datalad.org/s/ dlthings: https://concepts.datalad.org/s/things/unreleased/ eunal: http://publications.europa.eu/resource/authority/ + ex: http://example.org/ fabio: http://purl.org/spar/fabio/ foaf: http://xmlns.com/foaf/0.1/ linkml: https://w3id.org/linkml/ diff --git a/src/things-distributions/v1.yaml b/src/things-distributions/v1.yaml index 536995a..4b4056a 100644 --- a/src/things-distributions/v1.yaml +++ b/src/things-distributions/v1.yaml @@ -33,6 +33,7 @@ prefixes: dlschemas: https://concepts.datalad.org/s/ dlthings: https://concepts.datalad.org/s/things/v2/ eunal: http://publications.europa.eu/resource/authority/ + ex: http://example.org/ fabio: http://purl.org/spar/fabio/ foaf: http://xmlns.com/foaf/0.1/ linkml: https://w3id.org/linkml/ diff --git a/src/things-files/unreleased.yaml b/src/things-files/unreleased.yaml index 1df6a64..e12a0a7 100644 --- a/src/things-files/unreleased.yaml +++ b/src/things-files/unreleased.yaml @@ -36,6 +36,7 @@ prefixes: dlschemas: https://concepts.datalad.org/s/ dlthings: https://concepts.datalad.org/s/things/unreleased/ eunal: http://publications.europa.eu/resource/authority/ + ex: http://example.org/ fabio: http://purl.org/spar/fabio/ foaf: http://xmlns.com/foaf/0.1/ linkml: https://w3id.org/linkml/ diff --git a/src/things-files/v1.yaml b/src/things-files/v1.yaml index 32b2319..be816d4 100644 --- a/src/things-files/v1.yaml +++ b/src/things-files/v1.yaml @@ -37,6 +37,7 @@ prefixes: dlschemas: https://concepts.datalad.org/s/ dlthings: https://concepts.datalad.org/s/things/v2/ eunal: http://publications.europa.eu/resource/authority/ + ex: http://example.org/ fabio: http://purl.org/spar/fabio/ foaf: http://xmlns.com/foaf/0.1/ linkml: https://w3id.org/linkml/ diff --git a/src/things-study/unreleased.yaml b/src/things-study/unreleased.yaml index 43097b8..aa45f82 100644 --- a/src/things-study/unreleased.yaml +++ b/src/things-study/unreleased.yaml @@ -38,6 +38,7 @@ prefixes: dlschemas: https://concepts.datalad.org/s/ dlthings: https://concepts.datalad.org/s/things/unreleased/ eunal: http://publications.europa.eu/resource/authority/ + ex: http://example.org/ foaf: http://xmlns.com/foaf/0.1/ FRAPO: http://purl.org/cerif/frapo/ linkml: https://w3id.org/linkml/ diff --git a/src/things-study/v1.yaml b/src/things-study/v1.yaml index d332c49..4aba1cc 100644 --- a/src/things-study/v1.yaml +++ b/src/things-study/v1.yaml @@ -39,6 +39,7 @@ prefixes: dlschemas: https://concepts.datalad.org/s/ dlthings: https://concepts.datalad.org/s/things/v2/ eunal: http://publications.europa.eu/resource/authority/ + ex: http://example.org/ foaf: http://xmlns.com/foaf/0.1/ FRAPO: http://purl.org/cerif/frapo/ linkml: https://w3id.org/linkml/ diff --git a/src/things/v1/examples/Thing-04-relations.json b/src/things/v1/examples/Thing-04-relations.json index e5d63dd..0bd1bb5 100644 --- a/src/things/v1/examples/Thing-04-relations.json +++ b/src/things/v1/examples/Thing-04-relations.json @@ -1,8 +1,8 @@ { "pid": "https://doi.org/10.21105/joss.03262", "relations": { - "ISSN:2475-9066": { - "pid": "ISSN:2475-9066", + "http://identifiers.org/issn/2475-9066": { + "pid": "http://identifiers.org/issn/2475-9066", "attributes": [ { "predicate": "ex:title", diff --git a/src/things/v1/examples/Thing-04-relations.yaml b/src/things/v1/examples/Thing-04-relations.yaml index 6fd691e..6c60006 100644 --- a/src/things/v1/examples/Thing-04-relations.yaml +++ b/src/things/v1/examples/Thing-04-relations.yaml @@ -4,7 +4,7 @@ pid: https://doi.org/10.21105/joss.03262 relations: # the containing journal - ISSN:2475-9066: + http://identifiers.org/issn/2475-9066: # inlined information attributes: - predicate: ex:title diff --git a/src/things/v1/examples/Thing-05-publication.json b/src/things/v1/examples/Thing-05-publication.json index 429587e..88ae63d 100644 --- a/src/things/v1/examples/Thing-05-publication.json +++ b/src/things/v1/examples/Thing-05-publication.json @@ -1,8 +1,8 @@ { "pid": "https://doi.org/10.1038/s41597-022-01163-2", "relations": { - "ISSN:2052-4463": { - "pid": "ISSN:2052-4463", + "http://identifiers.org/issn/2052-4463": { + "pid": "http://identifiers.org/issn/2052-4463", "attributes": [ { "predicate": "ex:title", @@ -18,7 +18,7 @@ }, "characterized_by": [ { - "object": "ISSN:2052-4463", + "object": "http://identifiers.org/issn/2052-4463", "predicate": "ex:isPartOf" }, { diff --git a/src/things/v1/examples/Thing-05-publication.yaml b/src/things/v1/examples/Thing-05-publication.yaml index 647fd7a..078a193 100644 --- a/src/things/v1/examples/Thing-05-publication.yaml +++ b/src/things/v1/examples/Thing-05-publication.yaml @@ -8,7 +8,7 @@ exact_mappings: description: "Large-scale datasets present unique opportunities to perform scientific investigations with unprecedented breadth. However, they also pose considerable challenges for the findability, accessibility, interoperability, and reusability (FAIR) of research outcomes due to infrastructure limitations, data usage constraints, or software license restrictions. Here we introduce a DataLad-based, domain-agnostic framework suitable for reproducible data processing in compliance with open science mandates. The framework attempts to minimize platform idiosyncrasies and performance-related complexities. It affords the capture of machine-actionable computational provenance records that can be used to retrace and verify the origins of research outcomes, as well as be re-executed independent of the original computing infrastructure. We demonstrate the framework’s performance using two showcases: one highlighting data sharing and transparency (using the studyforrest.org dataset) and another highlighting scalability (using the largest public brain imaging dataset available: the UK Biobank dataset)." relations: # the containing journal with some information on it - ISSN:2052-4463: + http://identifiers.org/issn/2052-4463: exact_mappings: - bibo:Journal attributes: @@ -59,7 +59,7 @@ attributes: characterized_by: # containing journal - predicate: ex:isPartOf - object: ISSN:2052-4463 + object: http://identifiers.org/issn/2052-4463 # related topics - predicate: ex:subject object: https://www.nature.com/subjects/data-processing -- 2.54.1 From c0b3a8b28008e31dbf1c33562e71711ab26c58e1 Mon Sep 17 00:00:00 2001 From: Michael Hanke Date: Wed, 24 Jun 2026 17:59:11 +0200 Subject: [PATCH 2/3] chore: transition to LinkML 1.11 and depend on it Two patches could be dropped, because equivalent changes have been introduced upstream. --- Makefile | 6 ++++-- pyproject.toml | 2 +- tools/patch_linkml | 6 ++++-- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index dae31e3..e08f649 100644 --- a/Makefile +++ b/Makefile @@ -82,6 +82,9 @@ build/linkml-docs/s/%: src/%.yaml src/%/extra-docs gen-owl \ -f owl \ --mergeimports \ + --consolidate-cardinality-axioms \ + --skip-vacuous-min-zero-cardinality-axiom \ + --skip-vacuous-local-range-axioms \ $< > $@.owl.ttl && \ gen-jsonld-context \ --mergeimports \ @@ -159,7 +162,6 @@ checkmodel/%: src/%.yaml @linkml-lint \ --config .linkmllint.yaml \ --max-warnings 0 \ - --validate \ $< schema="$<"; if [ "$${schema##*-mixin}" = "$<" ]; then $(MAKE) checkmodel-outputs/$*; else echo "Skipping mixin output tests"; fi @@ -175,7 +177,7 @@ checkmodel-outputs/%: src/%.yaml @echo Generate JSON schema @${FAILIF_STDERR} gen-json-schema $< > /dev/null @echo Generate OWL - @${FAILIF_STDERR} gen-owl $< > /dev/null + @${FAILIF_STDERR} gen-owl --consolidate-cardinality-axioms --skip-vacuous-min-zero-cardinality-axioms --skip-vacuous-local-range-axioms $< > /dev/null @echo Generate Python classes @${FAILIF_STDERR} grep -q '^classes:' $< && ( gen-python $< | python ) || true diff --git a/pyproject.toml b/pyproject.toml index 95ea7d3..632245b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -33,7 +33,7 @@ classifiers = [ "Programming Language :: Python :: Implementation :: PyPy", ] dependencies = [ - "linkml >= 1.10", + "linkml >= 1.11", "dump-things-service", ] diff --git a/tools/patch_linkml b/tools/patch_linkml index 8d27a1e..05a22ee 100755 --- a/tools/patch_linkml +++ b/tools/patch_linkml @@ -9,7 +9,8 @@ patch -d $(python -c 'import os; import linkml.generators.shaclgen as m; print(o # Honor type-designator slots when loading graphs patch -d $(python -c 'import os; import linkml_runtime.loaders as m; print(os.path.dirname(m.__file__))') < patches/rdflib_loader_typedesignator.diff # Use correct constructor arguments when normalizing inlined objects -patch -d $(python -c 'import os; import linkml_runtime.utils.yamlutils as m; print(os.path.dirname(m.__file__))') < patches/linkml_runtime_utils_yamlutils.diff +# An equivalent change is included in LinkML 1.11.1 +#patch -d $(python -c 'import os; import linkml_runtime.utils.yamlutils as m; print(os.path.dirname(m.__file__))') < patches/linkml_runtime_utils_yamlutils.diff # Use `&` to separate multiple interfaces in graphql schemas patch -d $(python -c 'import os; import linkml.generators.graphqlgen as m; print(os.path.dirname(m.__file__))') < patches/graphqlgen_interface_list.diff # Do not emit python/rdflib upper case namespaces in `ifabsent`-default values @@ -17,4 +18,5 @@ patch -d $(python -c 'import os; import linkml.generators.common.ifabsent_proces # Support explicit type clauses with schema defined types when loading ttl patch -d $(python -c 'import os; import linkml_runtime.loaders as m; print(os.path.dirname(m.__file__))') < patches/rdflib_loader_custom_types.diff # Order type expressions that are emitted by gen-python correctly -patch -d $(python -c 'import os; import linkml.generators.pythongen as m; print(os.path.dirname(m.__file__))') < patches/pythongen_type_reference_order.diff +# LinkML 1.11.1 has the patched function reimplemented, docs suggest the patched issue is addressed +#patch -d $(python -c 'import os; import linkml.generators.pythongen as m; print(os.path.dirname(m.__file__))') < patches/pythongen_type_reference_order.diff -- 2.54.1 From e8e931fdc3b299cce42ba7a37368be859e60fdc1 Mon Sep 17 00:00:00 2001 From: Michael Hanke Date: Wed, 24 Jun 2026 14:50:15 +0200 Subject: [PATCH 3/3] fix: use custom type URI for `HexBinary` As diagnosed in https://hub.psychoinformatics.de/orinoco/dump-things-server/issues/226 and other issues, the `HexBinary` type setup using `uri: xsd:hexBinary` has both prevented proper validation, and caused data corruption due to issues with the rdflib validator. While it is preferrable to have something as globally understood as ``` skos:notation "1234567890abcdef"^^xsd:hexBinary ``` the value is diminished if actual implementations produce ``` skos:notation "b'\\x124Vx\\x90\\xab\\xcd\\xef'"^^xsd:hexBinary ``` instead. Given that we use custom type URIs in most (if not all) other places, and combine that with `exact_mappings` to support inference, it appears to be acceptable to adopt this pattern also in this case. --- src/things/unreleased.yaml | 4 +++- src/things/v2.yaml | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/things/unreleased.yaml b/src/things/unreleased.yaml index 276fe2c..7cc9bc4 100644 --- a/src/things/unreleased.yaml +++ b/src/things/unreleased.yaml @@ -124,12 +124,14 @@ types: - The regex is single-quoted for YAML encoding, hence all inner "'" have been doubled HexBinary: - uri: xsd:hexBinary + uri: dlthings:HexBinary base: str typeof: string pattern: "^[a-fA-F0-9]+$" description: >- hex-encoded binary data. + exact_mappings: + - xsd:hexBinary NodeUriOrCurie: typeof: uriorcurie diff --git a/src/things/v2.yaml b/src/things/v2.yaml index dc7accf..61339e1 100644 --- a/src/things/v2.yaml +++ b/src/things/v2.yaml @@ -125,12 +125,14 @@ types: - The regex is single-quoted for YAML encoding, hence all inner "'" have been doubled HexBinary: - uri: xsd:hexBinary + uri: dlthings:HexBinary base: str typeof: string pattern: "^[a-fA-F0-9]+$" description: >- hex-encoded binary data. + exact_mappings: + - xsd:hexBinary NodeUriOrCurie: typeof: uriorcurie -- 2.54.1