Skip to content

Attaching rules to shapes #765

@afs

Description

@afs

Should we include attaching SHACL (1.2) Rules to shapes?
If so, what does it mean given the difference in execution semantics?

Subsidiary question:
In practice, how often are constriants and AF-rules written on the same shape?
If they are, how are the rules being used, in practice, to influence the validation?

Sketch:

[] rdf:type sh:NodeShape ;
    sh:rule 
      [ a srl:SHACLRule ;
        srl:ruleSet "...";    ## SRL syntax
        sh:prefixes ... ;
      ];
[] rdf:type sh:NodeShape ;
    sh:rule
      [ a srl:SHACLRule ;
        srl:ruleSet [ ... RDF syntax ... ] ;
      ];

Ruleset execution has $this bound to the current node shape. This is available to rule body evaluation:

https://www.w3.org/TR/shacl12-rules/#eval-rule

let SEQ0: Solution sequence = { ("this", RDF Term of current NodeShape) }

Well-formedness changes to compensate for this.

(given the more restricted matching, substitution of $this by it's RDF term should also work)

A problem:
sh:rule (AF) has it's own execution model. We would have to either modify that (turn it off) or make attached rules "run once". The latter option seems pointless because it is then no more than a way to write a CONSTRUCT rule in another syntax.

Metadata

Metadata

Assignees

Labels

RulesFor SHACL 1.2 Rules spec.

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions