Skip to content

#185: Added subClassOfInShapesGraph parameter #447

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: gh-pages
Choose a base branch
from

Conversation

HolgerKnublauch
Copy link
Contributor

Closes #185

Added Andy and Ashley as reviewers too, to check if this is implementable from their engines point of view. The main difference is that instead of

?instance rdf:type/rdfs:subClassOf $class .

it would become

?instance rdf:type ?type .
GRAPH $shapesGraph {
    $type rdfs:subClassOf* ?class
}

And it's an optional feature...

<p>
SHACL processors SHOULD offer a parameter <code>subClassOfInShapesGraph</code> that, if set to <code>true</code>
should alter the definition of <a>SHACL Type</a> so that the <code>rdfs:subClassOf</code> triples are queried
from the <a>shapes graph</a> instead of the <a>data graph</a>.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
from the <a>shapes graph</a> instead of the <a>data graph</a>.
from the <a>shapes graph</a> in addition to the <a>data graph</a>.

Why omit consideration of rdfs:subClassOf statements in the data graph when this mode is enabled?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That COULD work too. I went with the simpler solution because querying a union graph would be more complex, and make optimizations harder. If we know that we only look in the shapes graph, all class closures could be pre-computed into HashSets, instead of having to walk the hierarchy over and over.

Also, what about undesirable cases where some subClassOf triples are in the data graph and others in the shapes graph. That sounds like a mess to me.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are there realistic scenarios where people want to mix and match?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are there realistic scenarios where people want to mix and match?

I can imagine some cases e.g. having an upper level ontology in your shapes graph and then lower level ontologies in your data graph. I have no data on whether these appear in the wild.

@jeswr
Copy link
Member

jeswr commented Jul 29, 2025

At risk of overcomplicating things - would it be worth inferenceDataInShapesGraph rather than subClassOfInShapesGraph; and using this feature to enable inclusion of other data for inference rules in the shapes graph?

@HolgerKnublauch
Copy link
Contributor Author

@jeswr there is already sh:entailment to activate other inferencing. And it is under complete control of the user which graph to pass into the engine as shapes graph. That graph may have been pre-processed with OWL to infer additional rdfs:subClassOf axioms.

As the above IMHO doesn't need a formal parameter to the engine, I wanted to however spell out the new flag because it does need a parameter as it changes how some terms (SHACL Instance) behave.

@afs
Copy link
Contributor

afs commented Jul 29, 2025

SHACL implementations can be parameterized

Where's the list of all parameters?

The whole "implementation controls" area seems to sit uneasily between implementation and standardization.

@afs
Copy link
Contributor

afs commented Jul 29, 2025

Not sure if the discussion is best here or on #185.

Added a general comment on the issue -- #185 (comment)

@HolgerKnublauch
Copy link
Contributor Author

I am not aware of other flags or parameters for the engine, but they could be grouped into an appendix if we define more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Where should my ontology go? Data graph versus shapes graph
3 participants