Expand incoming_class.json and outgoing_class.json views to support SHACL property shapes#334
Draft
Expand incoming_class.json and outgoing_class.json views to support SHACL property shapes#334
Conversation
…ON views Co-authored-by: jpmccu <602385+jpmccu@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Expand the incoming_class.json and outgoing_class.json views to support showing SHACL property shapes as links between classes. It should support use of classes as nodeshapes, but also separate nodeshapes.
Expand incoming_class.json and outgoing_class.json views to support SHACL property shapes
Sep 11, 2025
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.
This PR implements support for SHACL property shapes as links between classes in the
incoming_class.jsonandoutgoing_class.jsonviews, addressing the requirement to show SHACL relationships alongside traditional class hierarchy relationships.Problem
The existing class JSON views only supported basic RDF class hierarchy relationships (
rdfs:subClassOfandowl:equivalentClass). They did not recognize SHACL property shapes that create semantic links between classes through shape constraints, missing important relationships in knowledge graphs that use SHACL for data validation and structure definition.Solution
Extended the SPARQL queries in both templates to detect SHACL property shapes that create class-to-class relationships through:
1. NodeShapes with Target Classes
Detects when a NodeShape targets a specific class.
2. Property Shapes with Class Constraints
Finds property shapes that constrain values to be instances of specific classes.
3. Classes Used as NodeShapes
Supports the pattern where classes are directly declared as NodeShapes with their own property constraints.
Example SHACL Patterns Supported
These now appear as links: PersonShape→Person, Person→Organization, Organization→Person.
Changes Made
sh:) supportAll changes preserve existing functionality while adding comprehensive SHACL support through minimal, well-documented additions.
Validation
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.