Adapt GenerateOntologyViews to LDH ldh:view vocabulary#19
Merged
Conversation
LinkedDataHub deprecated `ldh:template` (attached to classes) in favor of `ldh:view` / `ldh:inverseView` attached to properties — see LDH commits b54d8c8b6 (#267) and 1ec5da016. - Iterate distinct properties instead of (class, property) tuples - Attach views via `ldh:view` on the property (forward direction) - Skip `owl:FunctionalProperty` (clean property-level replacement for the old class-scoped `owl:maxQualifiedCardinality 1` check) - Drop class/range from view URI naming; sha1-suffix on local-name collisions Inverse views (`ldh:inverseView`) intentionally deferred. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2 tasks
# Conflicts: # uv.lock
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
LinkedDataHub deprecated
ldh:template(attached to classes) in favor ofldh:viewandldh:inverseViewattached to properties. See LDH commitsb54d8c8b6(#267, "Ontology-based blocks are attached to properties, not classes") and1ec5da016("Renamedldh:blocktoldh:view").ldh:templateis fully removed from the LDH ontology.This makes
ldh-GenerateOntologyViewsincompatible with current LDH. This PR adapts it.Changes
(class, property)tuples — views now hang off properties, so a per-class loop produced duplicate triples.(property, ldh:view, view)instead of(class, ldh:template, view).owl:maxQualifiedCardinality 1filter with a property-level?property a owl:FunctionalPropertyfilter — cleaner fit for the property-level vocabulary; preserves the UX intent (no redundant 1-row tables).{base}#{property_local}_View(with a sha1 suffix on local-name collisions)._generate_sparql_queryto take onlyproperty_uri(the body was already class- and range-agnostic).description()text updated.Inverse views (
ldh:inverseView) intentionally deferred — most properties (especially datatype) are not useful in inverse direction; adding them blindly would double portal noise. ATODOcomment marks the spot.Test plan
uv run pytest tests/ -q— 106 passed, 44 skipped (same baseline; no regressions)ldh:viewtriples emitted on properties, noldh:templatetriples remain,owl:FunctionalPropertycorrectly skippedexamples/generate-portal.json, thencurlthe posted ontology graph and verifyldh:viewappears andldh:templatedoes not; confirm property views render in the LDH UINotes
ldh-prefix rename). Whichever lands second should bump.GenerateOntologyViewsis not informal-semantics.md, so per the project's spec-driven-tests convention no unit test was added. A follow-up will add spec entries + tests for the four portal-related operations (ExtractOntology,GenerateOntologyViews,GenerateClassContainers,GeneratePortal).