feat: static cube:Cube metadata + ObservationSet link (#41)#51
Open
redlink-code-engine wants to merge 1 commit into
Open
feat: static cube:Cube metadata + ObservationSet link (#41)#51redlink-code-engine wants to merge 1 commit into
redlink-code-engine wants to merge 1 commit into
Conversation
Adds a deterministic Turtle generator that produces a companion metadata.ttl alongside the YARRRML mapping, declaring the dataset as a cube.link Cube and its ObservationSet: - New module src/ogd_to_lod/metadata/ with MetadataGenerator - Cube IRI = base_uri itself, ObservationSet = <base_uri>observation-set - Emits schema:name/description/publisher/keywords, dcterms:identifier/ issued/modified/license from dataset_context (when present) - ISO dates → xsd:date, ISO datetimes → xsd:dateTime, license URLs → IRI - Always emits cube:observationSet link, even with empty context Wired into the flow so generate_node populates state.generated_metadata and create_pr_node commits metadata.ttl (3rd file in the PR alongside mapping.yarrrml.yaml and the CSV). Per-row Set→Observation linking is delegated to YARRRML: the prompt is extended with a required `observationSetLink` mapping that emits cube:observation triples on the static set IRI, keeping cube.link's forward-only linking convention. Per-property cube:DimensionConstraint / cube:MeasureConstraint and static dimension values from issue #41 are out of scope here and deferred to a follow-up issue. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.
Closes #41 (partial — see Out of scope).
Summary
src/ogd_to_lod/metadata/module with a deterministicMetadataGeneratorthat emits a companionmetadata.ttlfor every mapping.cube:Cube(IRI =base_uri) and itscube:ObservationSet(IRI =<base_uri>observation-set), populated fromdataset_context.xsd:date, ISO datetimes →xsd:dateTime, license URLs are emitted as IRIs (else as strings).generate_nodenow also populatesstate.generated_metadata;create_pr_node/GitHubService.create_mapping_prcommitmetadata.ttlas a third file alongside the YARRRML mapping and the CSV.observationSetLinkmapping so that each row also emits<observation-set> cube:observation <obs>— keeping cube.link's forward-only linking convention (no back-pointer oncube:Observation).IRI conventions chosen
<base_uri>(the dataset's root URI is the cube)<base_uri>observation-setex-obs:$(...)Out of scope (deferred to follow-up)
cube:DimensionConstraint/cube:MeasureConstraintblocks under acube:ObservationConstraintRAUM = Zürich)Test plan
pytest -q→ 373 passed, 3 skipped (integration tests requiring RMLMapper/Java){base_uri}substitutionmetadata.ttland the YARRRML'sobservationSetLinkblock