Preserve declared inverse and subproperty links in RDF exports - #824
Merged
WaylandYang merged 2 commits intoSep 20, 2026
Merged
Conversation
Signed-off-by: dada-yan <BinjunYann@gmail.com>
This was referenced Sep 20, 2026
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.
Problem
The RDF exporter emits property definitions and boolean axioms, but drops the already stored
inverse_ofandsub_property_ofdeclarations. A vocabulary containingemploys inverseOf employmentand a subproperty chain loses those links when exported.The existing mapping's axiom-copying behavior and ADR0020/#320 establish the vocabulary export; this restores declared links rather than introducing a new ontology interpretation.
Change
Carry the two nullable references through the internal export DTO and existing batched query, then emit
owl:inverseOfandrdfs:subPropertyOfusing the current base's vocabulary. Imported IRIs and existing key-based minting are retained. Document that the exporter copies explicit links only.No reciprocal declarations, transitive closure, inferred facts, extra queries, or schema changes are added.
Validation
Linux with dedicated PostgreSQL/pgvector and
UTOPIA_TEST_REQUIRE_DB=1:-D warnings), workspace tests and build pass: 940 passed, 0 failed, 1 ignored live-public-HTTPS test.External reasoners may derive additional conclusions from the recovered declarations. Reverting the exporter affects future exports; it does not remove triples already imported into external systems. Conflict/review state, other ontology links, and inference changes are out of scope.
Combined regression verification
All five independent fixes merge cleanly onto the same dev baseline. On the combined Linux branch, format, workspace Clippy, build and the full test suite pass (952 passed, 0 failed, 1 explicitly ignored live-public-HTTPS test). A shared authenticated RDF fixture verifies unbound values, subsecond history and explicit ontology links together in Turtle and JSON-LD. Removing each fix individually makes its regression fail again; restoring all fixes returns the full suite to 952 passing tests. No database migration or historical rewrite is included.