@prefix bsh: <https://brickschema.org/schema/BrickShape#> .
@prefix ref: <https://brickschema.org/schema/Brick/ref#> .
@prefix sh: <http://www.w3.org/ns/shacl#> .
bsh:TimeseriesReferenceOnPointsConstraint a sh:NodeShape ;
sh:sparql [ a sh:SPARQLConstraint ;
sh:message "Only Brick Points can have external timeseries references" ;
sh:prefixes <https://brickschema.org/schema/1.4/Brick> ;
sh:select """
SELECT $this
WHERE {
$this ref:hasExternalReference ?ref .
?ref rdf:type ref:TimeseriesReference .
FILTER NOT EXISTS { $this rdf:type/rdfs:subClassOf* brick:Point }
}
""" ] ;
sh:targetSubjectsOf ref:hasExternalReference .