Skip to content
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

Inferencing, sh:entailment, and strategies for describing entailment satisfaction #219

Open
ajnelson-nist opened this issue Jan 24, 2025 · 1 comment
Labels
Inferencing For SHACL 1.2 Inferencing spec. UCR Use Cases and Requirements

Comments

@ajnelson-nist
Copy link

This is an expansion of a use case suggested in this comment. The summary is that there may be value in defining a "partner" predicate to sh:entailment for custom entailment regimes.

Suppose I have a shapes graph that I expect to run against a knowledge graph (ABox & TBox) with the expectation of RDFS inferencing having taken place before the shapes start reviewing.

My understanding is much of RDFS and OWL entailment can be accomplished with what is in the 2017 state of the SHACL-AF document, by my current understanding of the mutual coverage of SPARQL CONSTRUCT and SHACL-AF expressions. As an example, I have a script that runs parts of RDFS entailment by running a sequence of CONSTRUCT queries implementing some of the rules from here. This CONSTRUCT query entails types from rdfs:domain.

Separate thought, which will converge: sh:entailment, given in the 2017 state of the SHACL document, Section 1.5, specifies how a shapes graph can require a certain entailment regime, and what should happen if the SHACL processor doesn't self-declare as supporting the requested entailment regime.

So, this shapes graph ...

@prefix ex: <http://example.org/shapes/> .

<http://example.org/shapes>
  a owl:Ontology ;
  sh:entailment <http://www.w3.org/ns/entailment/RDFS> ;
  .

... is supposed to trigger a failure from the processor if the processor doesn't declare support for http://www.w3.org/ns/entailment/RDFS.

Coming together: Should part of the Inferencing working group's output be a graph implementing RDFS entailment, so that any processor could have a "default" ruleset to follow or use for consistency checking with their own implementation of RDFS entailment?

A benefit would be that the inferencing group could use this a way to test specification behaviors around sh:entailment, like non-standard IRIs that might be used in less broadly adopted shape graphs.
For instance, a user might like to require some graphs they work with use some, but not all, of RDFS entailment, because their application requirements might not support literals in the subject position, which can be caused by rule rdfs4b.
An IRI the user's organization defines to specify this degree of entailment should be usable with sh:entailment, but then their SHACL processor would need to be made aware of the IRI.

If a shapes graph could declare that it satisfies an entailment, then this opens a way to demonstrate custom entailment regimes.

Say I have an entailment regime of just wanting rdfs:subPropertyOf expansion on IRI-identified properties.

@prefix ex: <http://example.org/shapes/> .

<http://example.org/rules/NamedSubProperty-as-SPARQL>
  a owl:Ontology ;
  rdfs:seeAlso <https://www.w3.org/TR/owl2-profiles/#Reasoning_in_OWL_2_RL_and_RDF_Graphs_using_Rules> ;
  rdfs:seeAlso <https://www.w3.org/TR/rdf11-mt/#patterns-of-rdfs-entailment-informative> ;

  # Suggested new property
  sh:satisfiesEntailment <http://example.org/entailment/NamedSubProperty> ;

  .

# A SHACL rule would be written here to implement just RDFS rule rdfs5 / OWL-RL rule prp-spo1.

I could satisfy that custom entailment two ways, one using SPARQL Rules, one using Triple Rules (as currently described in the SHACL-AF document). These could be done in separate graphs, either of which could fully satisfy the custom entailment, and could be selected by the end user or processor based on known tuning for SPARQL or for rules.

Should the above be worked through with the Inferencing group?

@afs
Copy link
Contributor

afs commented Jan 25, 2025

See also comment #215 (comment) from @HolgerKnublauch

@afs afs added the UCR Use Cases and Requirements label Jan 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Inferencing For SHACL 1.2 Inferencing spec. UCR Use Cases and Requirements
Projects
None yet
Development

No branches or pull requests

2 participants