Repository navigation
Add optional knowledge references to ontology concepts and metrics - #748
bksahu-atlan wants to merge 3 commits into
Conversation
|
Thank you for your first contribution to Apache Ossie (incubating)! A committer will review your PR. In the meantime, please ensure:
No ICLA is required to contribute. If you are elected as a committer in the future, you will need an Individual Contributor License Agreement (ICLA) on file with the ASF. Questions? Ask in the PR comments or join us on Slack. We appreciate your contribution! |
|
Nice work keeping the ontology side and the metric side consistent. One observation. The path and deep_link regex patterns exist in two places: ossie-schema.json and models.py. there is no check that the two stay identical. the JSON Schema uses (?![\s\S]) as the end, models.py uses plain $. These differ in Python's re module, where $ also matches just before a trailing newline. I tested this against Pydantic's actual validator: Pydantic v2's default regex engine is Rust-based, not Python's re, so $ here means strict end-of-string. No actual bug today. probably I would consider adding a test that parses both patterns from their source files and asserts they are the same string. |
|
Thanks for the proposal — I like the direction of keeping this additive and optional. A few small suggestions, mostly aligned with JB's points:
Happy to help with the docs wording if that's useful. |
|
@ashlearnnext-star Thanks for catching the drift risk. Added a guard comparing both pattern bodies and explicitly accounting for the different strict-end anchors: JSON Schema uses The locator is now named |
|
@Koji-Minami Thanks for the concrete suggestions. Addressed these in 31ef7a6:
Also merged current main and added round-trip coverage for its new ontology SDK. All 367 SDK tests pass. The broader run has the same 231 failing test IDs as untouched main with the existing local dependencies; the PR description records that limitation. No builds or dependency installs. The reference-format revision needs a dev-list follow-up and a review deadline at least 72 hours after the change, per CONTRIBUTING.md. I am not treating the earlier discussion window as approval for this revision. |
Summary
Add optional
knowledge_refsso ontology concepts and metrics can point to thepolicy, definition or decision notes behind them. References belong to the
concept or metric, so the external document needs no backlink into the model.
The shared reference has a display
name, a relativepath, aformat(jsonor
md), and an optionaljson_pointerfor a JSON entry. For example:The pointer is an RFC 6901 pointer string, without a leading
#. Markdownreferences identify whole documents.
ai_contextremains inline guidance forAI tools;
knowledge_refsidentifies external source material.Schema validation does not open targets. Consumers resolve references under
their own access policy and may opt into separate CI link checks. References
do not change query semantics or imply approval, verification, or causal evidence.
Knowledge Record contents, evidence strength, Markdown anchors, and approval
workflows remain outside this proposal.
Review changes
typetoformatto distinguish it from ontology type.deep_linktojson_pointerand removed the URI-fragment#prefixthroughout schemas, SDK, examples and tests.
clarified
ai_contextand opt-in link checking.including trailing newlines. The checks account explicitly for the different
strict-end anchors required by the validators' regex engines.
mainat59080f6without rewriting the published branch. Preservedits ontology SDK and added concept reference round-trip coverage there.
Compatibility
Existing documents need no changes. Older strict validators, SDKs or converters
may reject documents using the new field; producers targeting them should omit
it. Converter adoption is tracked in apache/ossie-converters#328.
Anyone testing the earlier version of this unmerged proposal should rename
deep_linktojson_pointer, remove its leading#, and rename referencetypetoformat.The change history entry remains proposed, with the PR reference included.
Validation
Checked against
apache/ossiemain59080f6b925faff6f7f10dd32a7347591af14226:Untouched main with the same installed dependencies: 952 passed, 268 skipped,
the identical 231 failing test IDs. No added failures. The local sqlglot
version is 30.4.2; main now requires at least 30.29.0 for SQL validation.
were run, and no SQL was executed. CI remains the authoritative lint/check run.
Discussion
The PR remains scoped to concepts and metrics. Agreement is still needed on
whether references on fields, datasets, relationships and the semantic model,
URL support through the REST spec, and an opt-in validator link-checking command
can follow separately. None of those features is implemented here.
The dev-list follow-up and maintainer review request are drafted, not sent.
The material format revision needs a new discussion deadline at least 72 hours
after the change. No consensus or approval is claimed here.
Prepared with AI assistance for contributor review.