Repository navigation
Conversation
… domain and range ApplyRDFS.subProperty() short-circuited on hasClassDeclarations(), so a vocabulary with rdfs:subPropertyOf but no rdfs:subClassOf inferred nothing from it. It now tests hasPropertyDeclarations(). The domain and range of a super-property were never applied to triples using a sub-property: (:x :p :y), (:p rdfs:subPropertyOf :q), (:q rdfs:domain :D) did not give (:x rdf:type :D), in either the stream (ApplyRDFS) or the graph (MatchRDFS). CxtInf now has lookups that include super-properties (domain, range) and sub-properties (properties by domain, by range), used by both. Generated-by: Claude Opus 5.5 (Claude Code) Co-Authored-By: Claude Opus 5.5 <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.
GitHub issue resolved #4312
Pull request Description:
Two fixes to RDFS inference with
rdfs:subPropertyOf, in both the stream (ApplyRDFS, used byriot --rdfs) and the graph (MatchRDFS, used byRDFSFactory.graphRDFS):ApplyRDFS.subProperty()short-circuited onhasClassDeclarations(); it now testshasPropertyDeclarations(). Before, a vocabulary withrdfs:subPropertyOfbut nordfs:subClassOfinferred nothing from it.(:x :p :y),(:p rdfs:subPropertyOf :q),(:q rdfs:domain :D)gives(:x rdf:type :D).CxtInfhas four lookups that include super-properties (getDomainInc,getRangeInc) or sub-properties (getPropertiesByDomainInc,getPropertiesByRangeInc).ApplyRDFS.domain()/range()andMatchRDFS'saccTypesDomain/accTypesRange/accInstancesDomain/accInstancesRangeuse them.I first tried propagating domains and ranges to sub-properties in
BaseSetupRDFS, but that makes the inference graph report entailed vocabulary triples (:pp rdfs:domain :Q), whichTestMatchVocabandAbstractTestRDFSrightly reject. So the vocabulary maps are unchanged, and only the lookups are.Tests: 9 new, in
TestStreamRDFS(including:ppfrom the existingrdfs-vocab.ttl, which the shared data never used) andTestMiscRDFS(graph finds by several patterns). All 9 fail onmainand pass with the change. The fulljena-arqtest suite passes (16742 run, 0 failures, 1 skipped).The patch was written with the help of an AI coding assistant (Claude Code), and is disclosed in the commit with a
Generated-by:trailer.By submitting this pull request, I acknowledge that I am making a contribution to the Apache Software Foundation under the terms and conditions of the Contributor's Agreement.
See the Apache Jena "Contributing" guide.