Skip to content

Preserve declared inverse and subproperty links in RDF exports - #824

Merged
WaylandYang merged 2 commits into
deeplethe:devfrom
Maya-Kid:codex/export-property-axiom-links
Sep 20, 2026
Merged

WaylandYang merged 2 commits into
deeplethe:devfrom
Maya-Kid:codex/export-property-axiom-links

Conversation

@Maya-Kid

@Maya-Kid Maya-Kid commented Sep 20, 2026

Copy link
Copy Markdown
Contributor

Problem

The RDF exporter emits property definitions and boolean axioms, but drops the already stored inverse_of and sub_property_of declarations. A vocabulary containing employs inverseOf employment and 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:inverseOf and rdfs:subPropertyOf using 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:

  • Baseline authenticated HTTP export fails because the declared-link set is empty; the same regression passes after the fix.
  • Legal ontology create/update/import helpers create the declarations. Both formats parse and retain the exact five stored links, including mutual inverse declarations and a three-edge subproperty chain, across a label-only rename.
  • Cross-base links are refused by the actual write path. Unit coverage also checks unresolved target IDs, no invented links, and input order independence.
  • Export leaves the checked declaration, fact, derived-fact and job rows unchanged; existing RDF content remains covered.
  • Format, workspace Clippy (-D warnings), workspace tests and build pass: 940 passed, 0 failed, 1 ignored live-public-HTTPS test.
  • Fresh frontend frozen install, 91 tests, and build pass.

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.

@WaylandYang
WaylandYang merged commit 1e14fcf into deeplethe:dev Sep 20, 2026
4 checks passed
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.

2 participants