Collapse semantics to one artifact per namespace#14
Merged
Conversation
The ontology document now carries the namespace's uri, read-only flag and owning team in its root custom_properties, and applying it provisions the namespace. semantic-namespaces is marked artifact=False: still listed so the ontology can be enumerated, still pruned, but written no directory of its own. Its prune keep-set is derived from the ontology filenames — without that, an apply --prune against a tree that has no semantic-namespaces/ directory would read an empty keep-set and delete every namespace on the target. A legacy tree that still carries the directory is applied unchanged.
The app dropped the namespace uri and moved the remaining custom property keys to snake_case, so describe what the document actually carries.
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.
Summary
Copying an organization's semantics graph produced two artifacts per namespace — a
semantic-namespaces/<ns>.yamlrow and asemantic-ontology/<ns>.yamldocument — and applied them in that order. With the app now carrying the namespace's metadata (display_name,read_only,owner) in the ontology document's rootcustom_propertiesand provisioning the namespace when the ontology is applied, the row is redundant. This collapses semantics to one artifact per namespace.Companion to datamesh-manager/entropy-data#1541, which must be deployed to the target instance first.
How it works
semantic-namespacesis markedartifact=False: it is still listed (so the ontology export can enumerate namespaces) and still pruned, but writes no directory of its own.export dirand the app's export zip now emit onlysemantic-ontology/<ns>.yaml.PUTprovisions the namespace, so no namespacePUTis issued.semantic-namespaces/directory to read, the keep-set would otherwise be empty andapply --prunewould delete every namespace on the target. It is now the set ofsemantic-ontology/<ns>.yamlstems — the same stems already used as the ontologyPUTparent ids.semantic-namespaces/directory. When present, it is applied as a flat resource exactly as before, so pre-existing artifact trees and zips keep full fidelity.Testing
test_export_semantics_ontology_document— export writessemantic-ontology/<ns>.yamland nosemantic-namespaces/.test_import_semantics_ontology_document— apply issues the ontologyPUTand no namespacePUT.test_apply_semantics_legacy_namespace_dir_still_applied— a legacy tree's namespace row is stillPUT.test_apply_semantics_prune_keeps_namespaces_from_ontology_filenames— with nosemantic-namespaces/dir,--prunedeletes only the namespace absent from the ontology filenames, not all of them.Full command suite green (239). Three unrelated
test_cli.pytruststore failures are pre-existing and environmental (outside this diff).Notes / out of scope
semantic-namespacesstays a valid--include/--excludename and prune unit; only its artifact materialization changed.