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

The long-await standalone SHACL Rule Expander mode #260

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

ashleysommer
Copy link
Collaborator

🎉 This is by far the most common feature request for PySHACL 🎉

This adds an alternative operating mode, as first described in the discussion in #60

Rather than validating the DataGraph against a Shapes and Constraints, this mode will run only the SHACL Functions and SHACL Rules as defined in the SHACL-AF spec.

  • By default it will output a new graph containing a copy of the existing DataGraph Triples plus the expanded triples
  • Run with inplace mode to expand the new triples directly into the input DataGraph

When combining this mode with the recently added Shapes Selection and Focus-node targeting options, this allows running selected expansion runs on selected nodes, enabling some very powerful procedural SHACL workflows.


This PR is pretty big.

  • There was some refactoring done to Validator, to allow for alternate run modes
  • the addition of the new run modes and the pyshacl_rules CLI script
  • tests for SHACL Rules Expander run mode
  • tests for pyshacl_rules CLI script
  • refactoring of SHACL TripleRules, SPARQLRules, and JSRules to allow the selective gathering from specified Shapes, and the selective application to specified focus nodes
  • Some new typing annotations were added to keep everything happy.

Refactor Validator as a PySHACLRunnerType
Add Rules Expander mode as a new PySHACLRunnerType
Add a CLI script pyshacl_rules for Rules Expander mode
Add tests for SHACL Rules Expander mode
Add tests for pyshacl_rules cli executable
…ACL Rules to be applied only to specified focus nodes.
…e gathered only from the specified SHACL Shapes. Allow SHACL Rules to be applied only to the passed in Focus nodes.
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.

1 participant