@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix prov: <http://www.w3.org/ns/prov#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix list: <http://www.w3.org/2000/10/swap/list#> .
@prefix log: <http://www.w3.org/2000/10/swap/log#> .
@prefix sh: <http://www.w3.org/ns/shacl#> .
@prefix : <http://example.org/> .

# ensures that shape data is included in the output
{ ?file :shapeGraph ?shapeGraph } => ?shapeGraph.

# includes additional data derived from the rules

{ 
    ?file :shape [ sh:property ?property ].
    ?property ?p ?o .
    # avoid duplicates
    ?file :shapeGraph [log:notIncludes { ?property ?p ?o } ]
} 
=> 
{
    ?property ?p ?o 
} .


{ 
    [] :shape [ sh:property ?property ].
    ?property prov:wasDerivedFrom ?entity .
    ?entity rdfs:label ?o .
} 
=> 
{
    ?entity rdfs:label ?o 
} .
