Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 12 additions & 4 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,15 @@ The ontology namespace publishes as a deterministic GitHub Pages artifact
bytes -- no build timestamps, source SHA-256 manifest) and deploy only
through the fail-closed `scripts/publish_ontology_site.py` from `main`.
A manual dispatch from another ref is not a publication path. The
lowercase and repository-case public namespace IRIs remain a tracked
interoperability gap ([ADR 0157](docs/adr/0157-public-ontology-namespace-identity.md),
issue #372): do not silently rewrite either form; any namespace migration
is a versioned ADR with compatibility mappings first.
repository-case public namespace
`https://contextualwisdomlab.github.io/LineageWeave/ontology#` is
canonical ([ADR 0207](docs/adr/0207-repository-case-ontology-namespace-canonical.md),
superseding ADR 0157, resolving issue #372); the lowercase form is a
deprecated compatibility vocabulary with validated term-kind mappings.
New runtime values, exports, fixtures, and database rows mint only
repository-case IRIs; `scripts/migrate_legacy_namespace.py` rewrites
stored lowercase IRIs (dry-run by default, never touching provenance
columns). Do not silently rewrite either historical form. The SHACL
shapes graph (`docs/ontology/lineageweave-kg-shapes.ttl`) is the
closed-world data-validation boundary for DB-to-RDF projections and is
published beside the ontology.
41 changes: 41 additions & 0 deletions CHANGELOG.d/2.18.0-public-ontology-namespace-completeness.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# 2.18.0 — Public ontology namespace completeness

## Added

- The repository-case public ontology namespace
`https://contextualwisdomlab.github.io/LineageWeave/ontology#` is
canonical ([ADR 0207], superseding ADR 0157, resolving #372): it is the
exact project path GitHub Pages serves. The lowercase form is a deprecated
compatibility vocabulary published beside the ontology with validated
`owl:equivalentClass` / `owl:equivalentProperty` mappings;
`scripts/migrate_legacy_namespace.py` now rewrites stored lowercase IRIs to
the canonical spelling (dry-run by default, transactional, never touching
provenance columns).
- Node-attribute datatype properties grounded in real schema columns:
`postTitle`, `postBody`, `eventOccurredAt` on posts;
`personName`, `lastKnownJobTitle` on persons; `entityName`,
`entityCode` on corporate entities; shared domain-free `createdAt` /
`updatedAt` record timestamps whose per-class cardinality lives in SHACL.
No property is minted for a column that does not exist.
- A SKOS post-type concept scheme (`postTypeScheme`) formalizing the governed
five-value `voc_type` vocabulary (`voc`, `vocc`, `voco`, `vom`, `vop`),
bringing that lookup category under the ontology round-trip check for the
first time. Keyman job titles and industry sectors stay unmodeled free text;
no scheme is invented without a governed source vocabulary.
- Logical integrity constraints: `OurSidePerson owl:disjointWith
CounterpartyPerson` and `hasAffiliate owl:inverseOf affiliatedWith` so
reasoners refuse impossible person sides and bidirectional affiliation
queries resolve without a second stored edge.
- `docs/ontology/lineageweave-kg-shapes.ttl`, the closed-world SHACL shapes
graph validating DB-to-RDF projections: required post title/body/timestamp,
confidence bounded to `[0.0, 1.0]` inclusive, required names and entity
code, and the our-side/counterparty disjointness complement. Validated in
CI with pyshacl including negative violation tests; published beside the
ontology with dangling-target refusal in the fail-closed publisher.

## Changed

- Ontology publication artifacts now include the shapes graph; the build
manifest lists it deterministically and the documentation page links it.

[ADR 0207]: docs/adr/0207-repository-case-ontology-namespace-canonical.md
22 changes: 19 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,25 @@ All notable changes to this project are documented here. Format follows

### Added

- The repository-case public ontology namespace
`https://contextualwisdomlab.github.io/LineageWeave/ontology#` is canonical
(ADR 0207, superseding ADR 0157, resolving issue #372); the lowercase form
is a deprecated compatibility vocabulary with validated mappings and a
dry-run migration tool for stored values.
- Closed-world SHACL validation (`docs/ontology/lineageweave-kg-shapes.ttl`,
pyshacl in tests): required post title/body/timestamp, project-mention
RDF subject/predicate/object chain, decimal confidence bounded to
`[0.0, 1.0]`, required person/entity names and entity code, and the
our-side/counterparty disjointness complement; published with
the ontology site and guarded against dangling shape targets.
- Node-attribute datatype properties grounded only in real schema columns
(`postTitle`, `postBody`, `eventOccurredAt`, `personName`,
`lastKnownJobTitle`, `entityName`, `entityCode`, shared domain-free
`createdAt`/`updatedAt`), a SKOS post-type scheme formalizing the governed
five-value `voc_type` vocabulary under the round-trip check, and logical
constraints: `OurSidePerson owl:disjointWith CounterpartyPerson` plus the
`hasAffiliate` inverse of `affiliatedWith` (ADR 0207).
Comment thread
seonghobae marked this conversation as resolved.

- Buyer Calendar now consumes the Naruon calendar projection beside
post-grounded commitments (ADR 0203 step 2 / #336). Observed occurrences
stay evidence-only; a commitment still opens that post. The 달력
Expand Down Expand Up @@ -52,9 +71,6 @@ All notable changes to this project are documented here. Format follows
retrieval, multi-thread Event Lineage answers, persisted image-evidence
citations, and the focused evidence popup. Their implementations remain
active-PR evidence until protected merge.
- ADR 0157 and its exact-head inventory choose the existing lowercase public
ontology namespace as canonical and define the compatibility, publication,
and migration evidence required by issue #372 without rewriting identifiers.
- The ontology Pages artifact now publishes the deprecated repository-case
compatibility vocabulary after validating every mapping's term kind.
- The PROV-O support profile now mints its product class mappings only in the
Expand Down
2 changes: 1 addition & 1 deletion backend/tests/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -1833,7 +1833,7 @@ def test_post_detail_exposes_explicit_and_semantic_project_evidence(
"Semantic project",
"project was described in the body",
0.82,
"https://contextualwisdomlab.github.io/lineageweave/ontology#Project",
"https://contextualwisdomlab.github.io/LineageWeave/ontology#Project",
"contextual_orchestrator_semantic",
),
)
Expand Down
179 changes: 179 additions & 0 deletions docs/adr/0207-repository-case-ontology-namespace-canonical.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,179 @@
# ADR 0207 — Make the repository-case public ontology namespace canonical

**Decision status:** Accepted
**Date:** 2026-08-25
**Supersedes:** [ADR 0157](0157-public-ontology-namespace-identity.md)
**Resolves:** [#372](https://github.com/ContextualWisdomLab/LineageWeave/issues/372)

## Context

ADR 0157 made the lowercase
`https://contextualwisdomlab.github.io/lineageweave/ontology#` namespace
canonical and demoted the repository-case
`https://contextualwisdomlab.github.io/LineageWeave/ontology#` to a
compatibility vocabulary. Its decision 8 required an owned route at the exact
lowercase path before migration could complete. That owned lowercase route
does not exist and is not planned: GitHub Pages serves this repository only at
the project path `/LineageWeave/`, which matches the repository name, and an
organization-site alias for a second case-distinct path would permanently
split one publication into two hosting surfaces that must be kept in lockstep.

The product owner has now directed the opposite resolution: the public
ontology namespace must use the repository-case spelling `LineageWeave`, the
same case GitHub Pages actually serves. This aligns the semantic identifier
with (a) the dereferenceable documentation endpoint already published at
`https://contextualwisdomlab.github.io/LineageWeave/ontology` ([ADR
0159](0159-published-ontology-pages.md)), (b) the repository name every
downstream consumer sees, and (c) the PROV-O support profile's historical
IRIs. RDF treats the two spellings as different resources, so the flip is a
real identifier change with real compatibility obligations -- it is not a
cosmetic edit. Per ADR 0157's own terms, both forms are externally durable:
stored `post_project_mention.ontology_iri` values may still carry the
lowercase form, and downstream graphs may have copied either.

The same slice completes the ontology's missing definitions: node attribute
datatype properties, a SKOS post-type concept scheme grounded in the seeded
`voc_type` controlled vocabulary, OWL disjointness and inverse constraints,
and a SHACL shapes graph for closed-world data validation ([Knublauch &
Kontokostas, 2017]). SHACL carries the cardinality and value-range checks
OWL's open-world semantics deliberately does not, so DB-to-RDF projections
fail loudly instead of silently polluting downstream graphs.

## Decision

1. The canonical namespace for all existing and future LineageWeave ontology
terms is the repository-case
`https://contextualwisdomlab.github.io/LineageWeave/ontology#`. New runtime
values, RDF exports, database rows, examples, API payloads, and generated
Pages artifacts mint only repository-case term IRIs.
2. The lowercase namespace is now the deprecated compatibility namespace. It
remains dereferenceable through the published compatibility vocabulary and
is never reused for different meanings.
3. The publication slice serves both namespace documents with `200 OK`. The
repository-case document is authoritative; the lowercase document identifies
it via `dcterms:isReplacedBy`, carries `owl:deprecated true`, and holds only
validated mappings. A redirect alone remains insufficient, per ADR 0157's
reasoning, which applies symmetrically.
4. Compatibility mappings are generated between the two parsed graphs and
emitted only when local-name uniqueness, term kind, and defining semantics
match: class-to-class `owl:equivalentClass`; property-to-same-kind
`owl:equivalentProperty`; SKOS-concept-to-SKOS-concept `skos:exactMatch`
after meaning verification; individuals `owl:sameAs` only with identity
evidence. A term without sufficient evidence receives no equivalence
assertion. The publication validator enforces local-name equality and term
kinds fail-closed in both directions.
5. Historical RDF, provenance bundles, and evidence rows are immutable.
`scripts/migrate_legacy_namespace.py` now rewrites stored lowercase IRIs to
the repository-case spelling -- dry-run by default, transactional,
idempotent, never touching provenance columns, refusing unknown third
spellings.
6. Producers stop minting lowercase IRIs in this release. The lowercase
compatibility vocabulary stays marked deprecated for at least 180 days and
two minor releases, whichever is later; dereferenceability and mappings are
not removed at the end of that window.
7. Node-attribute datatype properties are declared only for columns the
relational schema actually defines (`source_post.post_title`,
`post_body`, `created_at`, `updated_at`, `event_occurred_at`;
`cataloged_person.person_name`, `last_known_job_title`;
`corporate_entity.corporate_entity_code`, `entity_name`). No invented
column-backed property (country, business registration number) is minted.
Shared timestamp properties carry no `rdfs:domain` because two `rdfs:domain`
statements on one property entail subjects belong to both classes -- the
same multi-domain trap ADR 0004's edge design already avoids; per-class
cardinality lives in the SHACL shapes instead.
8. The post-type classification is formalized as SKOS exactly where the
relational source has a governed vocabulary: the five seeded `voc_type`
codes (`voc`, `vocc`, `voco`, `vom`, `vop`) become concepts in a
`skos:ConceptScheme`. Keyman job titles and industry sectors remain free
text in the schema with no lookup category, so no scheme is invented for
them yet; that gap is tracked rather than fabricated.
9. Logical integrity constraints are stated explicitly:
`:OurSidePerson owl:disjointWith :CounterpartyPerson` (a person side is one
or the other, per the seeded `person_side` vocabulary), and
`:hasAffiliate owl:inverseOf :affiliatedWith` so bidirectional person-to-
entity queries resolve without a second stored edge. The inverse carries no
relational lookup code, mirroring the existing `:mentions` /
`:mentionedIn` pair.
10. A separate SHACL shapes graph validates projected data:
required post title/body/timestamps, a complete single-valued RDF
`subject`/`predicate`/`object` chain for every `ProjectMention`,
single-valued decimal confidence within `[0.0, 1.0]`, required names on
persons and entities, and the closed-world complement of the
our-side/counterparty disjointness. Publication copies
the shapes artifact beside the ontology and refuses dangling shape targets
outside the canonical namespace.

## Considered options

### Repository-case canonical — chosen

Matches the only hosting path Pages actually serves, keeps one publication
surface, honors the owner directive, and preserves the support profile's
historical IRIs. Cost: stored lowercase IRIs migrate once through the existing
transactional tooling, and the compatibility vocabulary flips direction.

### Keep lowercase canonical (ADR 0157 status quo)

Would require building and operating a second, organization-hosted lowercase
route forever, splitting semantic identity from the served documentation path.
Rejected by the owner directive and by deployment simplicity.

### Treat both namespaces as canonical

Rejected for the same reason ADR 0157 rejected it: RDF consumers correctly
treat distinct IRIs as distinct resources; dual authorities preserve the
interoperability defect.

## Consequences

- One canonical namespace aligned with the served Pages path; new producers
are unambiguous.
- The lowercase compatibility vocabulary remains resolvable indefinitely;
existing serialized graphs keep resolving through validated mappings.
- Stored-value migration runs through `scripts/migrate_legacy_namespace.py`
with its existing dry-run/refusal discipline, direction reversed.
- Runtime constants, Turtle/JSON-LD/N-Triples, support profile, API and
frontend fixtures, database seeds' consumers, and the generated Pages
artifact move in one synchronized release.
- SHACL validation becomes a first-class test gate over the source graph.

## Verification

- Exact `200` responses for both namespace documents and representative
fragments, with the repository-case document identified as canonical.
- RDF graph-isomorphism and term-kind tests for every emitted mapping; no
duplicate local fragments across namespaces.
- Consumer fixtures prove old lowercase graphs still resolve and new
serialization mints only repository-case IRIs.
- Transactional migration tests prove idempotency, rollback safety, and
provenance-column preservation (direction-reversed).
- SHACL conformance of the source ontology plus a negative violation test;
publication manifest lists the shapes artifact deterministically.

## Related decisions

- [ADR 0004](0004-knowledge-graph-ontology.md): ontology vocabulary authority.
- [ADR 0011](0011-prov-o-standard-relations.md) /
[ADR 0065](0065-prov-o-provenance-boundary.md): PROV-O boundary.
- [ADR 0157](0157-public-ontology-namespace-identity.md): superseded; its
compatibility-mapping mechanics are retained with direction reversed.
- [ADR 0159](0159-published-ontology-pages.md): deterministic Pages
publication pipeline extended with the shapes artifact.
- Issue #372 owns the completed implementation and verification.

## References — APA 7th

Knublauch, H., & Kontokostas, R. (Eds.). (2017). *SHACL: Shapes constraint
language* (W3C Recommendation). World Wide Web Consortium.
https://www.w3.org/TR/shacl/

Miles, A., & Bechhofer, S. (Eds.). (2009). *SKOS simple knowledge organization
system reference* (W3C Recommendation). World Wide Web Consortium.
https://www.w3.org/TR/skos-reference/

Sauermann, L., & Cyganiak, R. (2008). *Cool URIs for the Semantic Web* (W3C
Interest Group Note). World Wide Web Consortium. https://www.w3.org/TR/cooluris/

W3C OWL Working Group. (2012). *OWL 2 web ontology language quick reference
guide* (2nd ed., W3C Recommendation). World Wide Web Consortium.
https://www.w3.org/TR/owl2-quick-reference/
2 changes: 1 addition & 1 deletion docs/adr/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ decision from them.
| [`lineage-bi-research-notes.md`](../lineage-bi-research-notes.md) | [0084](0084-lineage-research-grounding.md), [0062](0062-semantic-unit-embedding.md), [0064](0064-lineage-evidence-and-tree-assembly.md), [0024](0024-rankweave-fusion-fail-closed.md), [0165](0165-quantity-script-display.md), [0167](0167-rankweave-ranking-channel-evidence.md), [0169](0169-ask-batched-lineage-graph.md), [0202](0202-ask-event-time-filter.md) |
| [`PROV_O_IMPLEMENTATION.md`](../PROV_O_IMPLEMENTATION.md) | [0065](0065-prov-o-provenance-boundary.md) |
| [`PROV_O_IMPLEMENTATION_MATRIX.md`](../PROV_O_IMPLEMENTATION_MATRIX.md) | [0065](0065-prov-o-provenance-boundary.md) |
| [`ONTOLOGY_NAMESPACE_INVENTORY.md`](../doctoring/ONTOLOGY_NAMESPACE_INVENTORY.md) | [0157](0157-public-ontology-namespace-identity.md) |
| [`ONTOLOGY_NAMESPACE_INVENTORY.md`](../doctoring/ONTOLOGY_NAMESPACE_INVENTORY.md) | [0207](0207-repository-case-ontology-namespace-canonical.md), [0157](0157-public-ontology-namespace-identity.md) |
| [`image-content-schema.md`](../image-content-schema.md) | [0066](0066-position-preserving-image-content.md) |
| [`storybook-inventory.md`](../storybook-inventory.md) | [0118](0118-uiux-standard-guide-v3-design-overhaul.md), [0184](0184-ontology-provenance-explorer.md) |
| [`POSTGRESQL_CONCURRENCY_REFERENCES.md`](../doctoring/POSTGRESQL_CONCURRENCY_REFERENCES.md) | [0204](0204-analysis-run-short-transaction-delivery.md) |
Expand Down
15 changes: 15 additions & 0 deletions docs/doctoring/ONTOLOGY_NAMESPACE_INVENTORY.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,3 +81,18 @@ decision uses ADR 0157. PR #485 now owns ADR `0158` at exact head
file uses `0159`, so the publication decision in this stack uses ADR 0159.
Recheck immediately before integration; neither number is a global allocator
reservation.

## Resolution (ADR 0207, 2026-08-25)

The product owner directed the opposite canonicalization: the
repository-case namespace
`https://contextualwisdomlab.github.io/LineageWeave/ontology#` is now
canonical ([ADR 0207](../adr/0207-repository-case-ontology-namespace-canonical.md),
superseding [ADR 0157](../adr/0157-public-ontology-namespace-identity.md),
resolving issue #372). The lowercase form is a deprecated compatibility
vocabulary; both documents stay dereferenceable through the published
site with validated term-kind mappings, and stored values migrate via
`scripts/migrate_legacy_namespace.py` with its dry-run/refusal
discipline (direction reversed: lowercase rows rewrite to
repository-case). The inventory above remains the historical evidence
for why both forms were treated as externally durable.
Loading
Loading