Skip to content

Abbreviations : TRANSITIVE, SYMMETRIC, and INVERSE #779

@afs

Description

@afs

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


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. )

Metadata

Metadata

Assignees

No one assigned

    Labels

    RulesFor SHACL 1.2 Rules spec.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions