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

SHACL - Allow shapes to specify if they should be validated as transactional, legacy bulk or sparql bulk #5170

Open
hmottestad opened this issue Oct 31, 2024 · 0 comments
Assignees
Labels
📦 SHACL affects the SHACL validator
Milestone

Comments

@hmottestad
Copy link
Contributor

The SHACL engine usually decides how a shape should be validated based on what operations are in the transaction and the size of the transaction.

It would also be good to limit what the SHACL engine is allowed to do for a particular shape, in case there is an issue with a particular approach.

Something like:

@prefix ex: <http://example.com/ns#> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix sh: <http://www.w3.org/ns/shacl#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix rdf4j: <http://rdf4j.org/schema/rdf4j#> .
@prefix rsx: <http://rdf4j.org/shacl-extensions#> .

{
  ex:PersonShape a sh:NodeShape;
    sh:targetClass ex:Person;

    rsx:validationApproach (
        rsx:transactionalValidationApproach
        rsx:sparqlBulkValidationApproach
        rsx:legacyBulkValidationApproach 
    );

    sh:property [
        sh:path (ex:knows1 ex:knows2);
        sh:class ex:Person
      ] .
  rdf4j:nil sh:shapesGraph rdf4j:nil.

}

Where rsx:validationApproach specifies which validation approaches that are available to the SHACL engine.

The order of the items in the list are the preferred order and the SHACL engine must choose the first validation approach that is possible to use.

All shapes support transactional validation and legacy bulk validation. A transaction that adds or modifies a shape must always use a bulk validation. So the following rules apply:

  • rsx:transactionalValidationApproach is optional
  • rsx:sparqlBulkValidationApproach is optional
  • rsx:legacyBulkValidationApproach must always be in the list

Default

 rsx:validationApproach (
        rsx:transactionalValidationApproach
        rsx:sparqlBulkValidationApproach
        rsx:legacyBulkValidationApproach 
    );

Never use the transactional approach, only bulk

 rsx:validationApproach (
        rsx:sparqlBulkValidationApproach
        rsx:legacyBulkValidationApproach 
    );

Never use the transactional approach, only bulk, and only the legacy bulk approach

 rsx:validationApproach (
        rsx:legacyBulkValidationApproach 
    );

If bulk validation is required, only use the legacy approach and not SPARQL

 rsx:validationApproach (
        rsx:transactionalValidationApproach
        rsx:legacyBulkValidationApproach 
    );

The following are illegal

 rsx:validationApproach (
        rsx:transactionalValidationApproach
    );
 rsx:validationApproach (
        rsx:sparqlBulkValidationApproach
    );
 rsx:validationApproach (
        rsx:transactionalValidationApproach
        rsx:sparqlBulkValidationApproach
    );
@hmottestad hmottestad added the 📦 SHACL affects the SHACL validator label Oct 31, 2024
@hmottestad hmottestad added this to the 5.1.0 milestone Oct 31, 2024
@hmottestad hmottestad self-assigned this Oct 31, 2024
@hmottestad hmottestad modified the milestones: 5.1.0, 5.2.0 Nov 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
📦 SHACL affects the SHACL validator
Projects
None yet
Development

No branches or pull requests

1 participant