feat(catalog): derive metadata from repository state - #352
Merged
pedropaulofb merged 1 commit intoJul 13, 2026
Conversation
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
This pull request improves synchronization of the OntoUML/UFO Catalog metadata by deriving catalog contributors from model metadata and by replacing manually maintained modification values with semantic change detection.
The catalog generator now determines whether the catalog collection itself changed, whether only catalog-level metadata changed, or whether no semantic change occurred. It then updates
dct:modifiedandfdpo:metadataModifiedaccording to their distinct meanings.The pull request also updates three catalog-level metadata values:
storage_urlwith the OntoUML permanent identifier;The previously implemented contributor aggregation behavior is retained.
Motivation
The previous catalog metadata required the following values to be maintained manually in
catalog.yaml:modified;metadata_modified;This created several problems:
This implementation makes the generated catalog metadata dependent on the repository’s semantic content rather than manually synchronized values.
Changes
Derive catalog contributors from model metadata
The generator now derives catalog-level
dct:contributorvalues from the union of alldct:contributorvalues declared in direct model metadata files:The generated contributor set:
includes contributors declared across all cataloged models;
removes exact duplicate IRIs;
identifies simple equivalent variants that differ only by:
httpversushttps;deterministically retains one existing representative IRI for equivalent variants;
does not attempt identity resolution between unrelated identifiers belonging to the same person;
rejects contributor values that are not valid HTTP(S) IRIs.
The contributor list is no longer maintained manually in
catalog.yaml.Derive modification timestamps from semantic changes
The following fields were removed from
catalog.yaml:The generator now reads the existing
catalog.ttl, generates the candidate catalog graph, and compares the RDF content semantically.Timestamp predicates are excluded from the semantic comparison so that timestamps do not cause their own modification events.
The implemented behavior is:
dct:modifiedfdpo:metadataModifiedCatalog membership is represented by the generated
dcat:datasetrelationships.Catalog metadata includes the remaining generated catalog-level statements, such as:
Preserve deterministic no-op generation
The generator compares RDF graphs rather than serialized Turtle text.
Consequently, the following do not update either modification value:
A repeated no-op generation therefore remains byte-identical.
Use one UTC timestamp per semantic update
When a relevant semantic change is detected, the generator captures one UTC timestamp and reuses it for all properties that must be updated.
This ensures that catalog membership changes produce identical values for:
New values are serialized as
xsd:dateTime.An existing legacy date-only
dct:modifiedvalue is preserved until catalog membership changes, avoiding the invention of a historical time value that was never recorded.Preserve safe
--checkbehavior--checkevaluates whether the existing catalog is semantically synchronized without modifying files.It does not generate a new current timestamp merely to perform validation.
The command exits successfully when the generated semantic content is current and reports whether detected staleness concerns:
Add controlled timestamp input
The generator supports an explicit generation timestamp for deterministic testing and controlled generation scenarios.
This allows the timestamp behavior to be tested without depending on the system clock.
Update catalog-level metadata
The catalog storage identifier is updated to:
The bibliographic citation is updated to:
The catalog contact email is updated to:
Update documentation and automated validation
The generator documentation now describes:
--check;The test suite includes regression coverage for the new behavior.
Validation performed
The following focused test suite was executed:
Result:
The generated catalog was synchronized with:
python scripts/generate_catalog_file.py .Synchronization was verified with:
python scripts/generate_catalog_file.py . --checkThe generator was executed a second time and the generated
catalog.ttlremained byte-identical, confirming deterministic no-op behavior.Ruff validation was executed:
Ruff formatting validation was executed:
Python compilation validation was executed:
The repository pre-commit configuration was also executed against the staged change set:
All checks passed.
Scope
The pull request is limited to the catalog generation and release-validation files required for this implementation:
.github/workflows/process-new-model-submission.yml.github/workflows/publish-models-release.ymlcatalog.yamlcatalog.ttlscripts/generate-catalog-file.mdscripts/generate_catalog_file.pyscripts/tests/test_generate_catalog_file.pyNo unrelated repository changes are included.