Commit e9136eb
feat: OssieSource reads Apache Ossie semantic models (v0.42.0) (#64)
* feat: OssieSource reads Apache Ossie semantic models (v0.42.0)
Apache Ossie (incubating) — formerly Open Semantic Interchange — is the
vendor-neutral spec for exchanging semantic models across analytics, AI,
and BI platforms. It standardises what a metric *is*; this library
enforces what an agent may *do* with it, so Ossie is a fourth input to
the SemanticSource protocol rather than a competitor to enforcement.
Four decisions define the adapter, each a place where the easy choice is
a silent correctness bug:
- Table keys drop the database qualifier. Relationship endpoints are
"schema.table.column" and build_relationship_index recovers the table
with one rsplit; a three-part key would break that contract.
- Cardinality is derived from keys, not defaulted. Ossie never writes
the join type down.
- Composite joins are skipped with a warning, not split into one edge
per column pair — the planner walks those edges, and each pair alone
is wrong. Matches the CubeSource precedent.
- Dialect is an opaque string, never checked against the enum: the
accepted expression-language proposal adds Ossie_SQL_2026 and makes
it the default.
Governance vocabulary (owners, review dates, tiers, decompositions,
drill_by, metric impacts) has no home in the spec — every $def sets
additionalProperties: false — so it rides in custom_extensions under
the AGENTIC_DATA_CONTRACTS vendor name and is revalidated on load.
Every ai_context and every foreign vendor block is carried through
get_extras() without interpretation.
Also moves _parse_date to base.parse_review_date, now that two sources
need it, and upgrades all locked dependencies. The pinned
contract_digest guard still holds, so published bytes are unaffected.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
* fix: address review findings on OssieSource
Ten findings from the branch review; eight were real defects.
The one that mattered: cardinality was derived from the `from` side
only, on the premise that Ossie's `to` is the one side "by
construction". Nothing in the spec validates that, and
RelationshipChecker._check_fan_out fires only on one_to_many — so a
backwards-declared join read as one_to_one and silently disabled the
row-multiplication warning on an aggregate. Now derived from both
sides, with the spec's declaration honoured when the `to` dataset
declares no keys at all (absence of a key is not evidence of fan-out,
and downgrading every key-less model would flood the checker).
Also:
- Scalar tier/domains/filters in the vendor block were shredded by
list(): "gold" became ['g','o','l','d']. Promoted as YamlSource does.
- get_extras() always emitted ossie_custom_extensions, even empty.
Verified to break freeze->rehydrate under expected_extras, and it
added a noise key to every Ossie contract's canonical bytes.
- Foreign extensions and ai_context were keyed globally but collected
per model, so a two-model file silently lost the first of two
same-named entries. Both are now keyed by model name first.
- Extras were not JSON-normalized; a YAML-native date in an ai_context
could reach canonical bytes unconverted. _normalize_extras/_jsonify
promoted to base.jsonify_extras and shared.
- json.loads on a YAML mapping payload raised TypeError and produced a
"not valid JSON" warning about a non-problem.
- An unresolvable dataset source vanished silently; a typo'd source
turns drill_by column validation off rather than failing it.
- expected_extras on a non-yaml source was silently dropped.
Not fixed, documented instead: two models whose sources differ only by
database qualifier still collide on the table key. That is inherent to
the two-part key contract Relationship endpoints require, and it warns.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>1 parent 5633cde commit e9136eb
15 files changed
Lines changed: 2210 additions & 601 deletions
File tree
- docs
- src/agentic_data_contracts
- core
- semantic
- tests
- fixtures
- test_core
- test_semantic
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
5 | 47 | | |
6 | 48 | | |
7 | 49 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | | - | |
| 22 | + | |
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| |||
652 | 652 | | |
653 | 653 | | |
654 | 654 | | |
655 | | - | |
| 655 | + | |
656 | 656 | | |
657 | | - | |
| 657 | + | |
658 | 658 | | |
659 | 659 | | |
660 | 660 | | |
| |||
709 | 709 | | |
710 | 710 | | |
711 | 711 | | |
| 712 | + | |
| 713 | + | |
| 714 | + | |
| 715 | + | |
| 716 | + | |
| 717 | + | |
| 718 | + | |
| 719 | + | |
| 720 | + | |
| 721 | + | |
| 722 | + | |
| 723 | + | |
| 724 | + | |
| 725 | + | |
| 726 | + | |
| 727 | + | |
| 728 | + | |
| 729 | + | |
| 730 | + | |
| 731 | + | |
| 732 | + | |
| 733 | + | |
| 734 | + | |
| 735 | + | |
| 736 | + | |
| 737 | + | |
| 738 | + | |
| 739 | + | |
| 740 | + | |
| 741 | + | |
| 742 | + | |
| 743 | + | |
| 744 | + | |
| 745 | + | |
| 746 | + | |
| 747 | + | |
| 748 | + | |
| 749 | + | |
| 750 | + | |
| 751 | + | |
| 752 | + | |
| 753 | + | |
| 754 | + | |
| 755 | + | |
| 756 | + | |
| 757 | + | |
| 758 | + | |
| 759 | + | |
| 760 | + | |
| 761 | + | |
| 762 | + | |
| 763 | + | |
| 764 | + | |
| 765 | + | |
| 766 | + | |
| 767 | + | |
| 768 | + | |
| 769 | + | |
| 770 | + | |
| 771 | + | |
| 772 | + | |
| 773 | + | |
| 774 | + | |
| 775 | + | |
| 776 | + | |
| 777 | + | |
| 778 | + | |
| 779 | + | |
| 780 | + | |
| 781 | + | |
712 | 782 | | |
713 | 783 | | |
714 | 784 | | |
| |||
849 | 919 | | |
850 | 920 | | |
851 | 921 | | |
852 | | - | |
| 922 | + | |
853 | 923 | | |
854 | 924 | | |
855 | 925 | | |
| |||
1205 | 1275 | | |
1206 | 1276 | | |
1207 | 1277 | | |
1208 | | - | |
| 1278 | + | |
1209 | 1279 | | |
1210 | 1280 | | |
1211 | 1281 | | |
| |||
0 commit comments