https://cacontology.projectvic.org/sex-offender-registry#AgeValidationShape
Validates age-related constraints for registered offenders.
Instances of cacontology-registry:RegisteredSexOffender can have the following properties:
@prefix cacontology-registry: <https://cacontology.projectvic.org/sex-offender-registry#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix sh: <http://www.w3.org/ns/shacl#> .
cacontology-registry:AgeValidationShape a sh:NodeShape ;
rdfs:label "Age Validation Shape"@en ;
rdfs:comment "Validates age-related constraints for registered offenders."@en ;
sh:sparql [ sh:message "Offender must be at least 18 years old at time of registration."@en ;
sh:select """
SELECT $this
WHERE {
$this cacontology-registry:dateOfBirth ?dob ;
cacontology-registry:hasRegistrationRecord ?record .
?record cacontology-registry:registrationDate ?regDate .
BIND(YEAR(?regDate) - YEAR(?dob) AS ?age)
FILTER (?age < 18)
}
""" ] ;
sh:targetClass cacontology-registry:RegisteredSexOffender .