Repository navigation
Conversation
jdsika
force-pushed
the
refactor/delegate-canonicalizer
branch
from
September 18, 2026 18:23
c8b683a to
2c1b8f6
Compare
jdsika
force-pushed
the
refactor/delegate-canonicalizer
branch
3 times, most recently
from
October 8, 2026 14:07
e288953 to
38f1f9b
Compare
The RDF canonicalizer in linkml_runtime was extracted into diffable-rdf, and the two copies diverged. Calling the library fixes nine defects of the in-tree copy, each asserted against both entry points in test_rdf_canonicalize_defects.py: - a base IRI ending in # no longer rewrites every IRI sharing its prefix - a shared rdf:List tail is no longer duplicated - N-Triples refuses a relative IRI instead of writing a file its own parser rejects; N-Triples allows only absolute IRIs - literals containing U+2028 and other line separators survive sorting - degraded RDF/XML, degraded Turtle and JSON-LD are byte-identical across processes - every format ends with exactly one newline - a Dataset is refused instead of silently flattened diffable-rdf becomes a required dependency of linkml-runtime. It needs only rdflib and pyoxigraph, which the runtime already requires. The diff-stable extras remain as aliases. Turtle output of the four RDF generators is unchanged. The library logs degraded output; the runtime re-emits those records as RDFCanonicalizationWarning so they stay visible without logging configuration. Signed-off-by: jdsika <carlo.van-driesten@vdl.digital>
jdsika
force-pushed
the
refactor/delegate-canonicalizer
branch
from
October 13, 2026 18:39
38f1f9b to
011fc23
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Mirror of linkml#3987, same head. Review there; this PR tracks the fork stack.
Stacked on #24. #25 is folded into this PR.
Summary
linkml_runtime.utils.rdf_canonicalizewas extracted into diffable-rdf at the maintainers' request (linkml#3295), and the two copies diverged. This PR deletes the in-tree copy and calls the library. That fixes nine defects in the RDF output of every generator and RDF dumper onmain:main@baseending in#rdf:ListtailValueError, as N-Triples §2.2 says: "IRIs may be written only as absolute IRIs".gen-owl -f json-ldon personinfo with two hash seeds.rdflib.DatasetEach defect is a test in
test_rdf_canonicalize_defects.py, run against bothlinkml_runtime's function and the library's.Dependency
diffable-rdfbecomes a required dependency oflinkml-runtime, because the default path needs it. Facts for that decision:rdflib>=6.3.2andpyoxigraph>=0.5.4.linkml-runtimealready requiresrdflib>=7.6.0andpyoxigraph>=0.5.11. The license is Apache-2.0.--diff-stablestays opt-in, as discussed on feat(rdf): add opt-in diff-stable blank-node labels linkml/linkml#3985. Thediff-stableextras remain as aliases.The library logs degraded output, and
linkml_runtimere-emits it asRDFCanonicalizationWarning, so the warning stays visible without any logging configuration.Output
For the metamodel and personinfo, the Turtle output of
gen-owl,gen-shacl,gen-rdfandgen-shex --format rdfis byte-identical before and after this PR. JSON-LD output is now deterministic, and its graph is unchanged (isomorphic, 1,134 triples).Testing
test_rdf_canonicalize_defects.pycovers the nine properties above. Before delegation, each of them failed for linkml and passed for the library.Fork stack: #24 → #26; #27 (docs) is based on #24.