-
Notifications
You must be signed in to change notification settings - Fork 44
Description
The TRANSITIVE, SYMMETRIC, and INVERSE abbreviations in SHACL Rules give a way to write certain patterns in an immediate and direct and clear way.
TRANSITIVE -- this is also useful because it is possible to implement more efficiently than simply following the rule definition shown below.
More efficient rule-based expression requires e.g. matching for direct property relationship. If built-in this isn't necessary, and the direct triples do not appear in the output graph.
It can also be a useful for caching across rule evaluation. e.g. rdfs:subClassOf, rdfs:subPropertyOf.
The SYMMETRIC and INVERSE abbreviations, when used with care, can help declaring expressivity. However, they can generate large numbers of triples if used with common properties.
See also
- https://www.oreilly.com/library/view/semantic-web-for/9780123735560/OEBPS/09_chapter07.htm
- http://mlwiki.org/index.php/RDFS-Plus
- reasoning: transitiveOver (transitive with "step" property) #351
Illustration - simple implementations:
TRANSITIVE(:property)
RULE { ?x :property ?z } WHERE { ?x :property ?y . ?y :property ?z }
or
RULE { ?x :property ?z } WHERE { ?x :property/:property ?z }
SYMMETRIC(:property)
RULE { ?b :property ?a } WHERE { ?a :property?b }
INVERSE(:property1, :property2)
RULE { ?b :property2 ?a } WHERE { ?a :property1 ?b }
RULE { ?b :property1 ?a } WHERE { ?a :property2 ?b }
( @TallTed added missing comma + and to first line so SYMMETRIC INVERSE is not misread as one entity. )