@prefix bsh: <https://brickschema.org/schema/BrickShape#> .
@prefix sh: <http://www.w3.org/ns/shacl#> .
bsh:SensorInheritQuantityKind a sh:NodeShape ;
sh:rule [ a sh:SPARQLRule ;
sh:construct """
CONSTRUCT {
$this brick:hasQuantity ?quantity .
} WHERE {
$this rdfs:subClassOf+ ?parent .
?parent brick:hasQuantity ?quantity .
FILTER NOT EXISTS {
$this brick:hasQuantity ?quantity .
}
}
""" ;
sh:prefixes <https://brickschema.org/schema/1.4/Brick> ] ;
sh:target [ a sh:SPARQLTarget ;
sh:select """
PREFIX brick: <https://brickschema.org/schema/Brick#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
SELECT DISTINCT ?this WHERE {
?this rdfs:subClassOf+ brick:Sensor
}
""" ] .