forked from crs4/rocrate-validator
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path3_timestamp_format.ttl
More file actions
64 lines (56 loc) · 2.79 KB
/
3_timestamp_format.ttl
File metadata and controls
64 lines (56 loc) · 2.79 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# Copyright (c) 2025 eScience Lab, The University of Manchester
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
@prefix ro: <./> .
@prefix ro-crate: <https://github.com/crs4/rocrate-validator/profiles/ro-crate/> .
@prefix five-safes-crate: <https://github.com/eScienceLab/rocrate-validator/profiles/five-safes-crate/> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix schema: <http://schema.org/> .
@prefix purl: <http://purl.org/dc/terms/> .
@prefix sh: <http://www.w3.org/ns/shacl#> .
@prefix validator: <https://github.com/crs4/rocrate-validator/> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
#=== MUST shapes ===#
# to ensure the entity id will be included in any error message,
# target all entities which have startTime and/or endTime properties using sh:targetSubjectsOf,
# then we use sh:property to validate the values of those properties.
# the properties are listed individually so that the property id appears in any error message too
five-safes-crate:TimeStampFormat
a sh:NodeShape ;
sh:name "Timestamp Format" ;
sh:description "Timestamps MUST follow the RFC 3339 standard (YYYY-MM-DD'T'hh:mm:ss[.fraction](Z | ±hh:mm))." ;
sh:targetSubjectsOf schema:startTime, schema:endTime;
sh:property [
a sh:PropertyShape ;
sh:name "End TimeStamp" ;
sh:path schema:endTime ;
sh:minCount 0 ;
sh:pattern "^[0-9]{4}-[0-9]{2}-[0-9]{2}[Tt][0-9]{2}:[0-9]{2}:[0-9]{2}([.|,][0-9]+)?(Z|z|[+-][0-9]{2}:[0-9]{2})$" ;
sh:severity sh:Violation ;
sh:message "All `startTime` and `endTime` values MUST follow the RFC 3339 standard (YYYY-MM-DD'T'hh:mm:ss[.fraction](Z | ±hh:mm))." ;
sh:description "End timestamps MUST follow the RFC 3339 standard." ;
] ;
sh:property [
a sh:PropertyShape ;
sh:name "Start TimeStamp" ;
sh:path schema:startTime ;
sh:minCount 0 ;
sh:pattern "^[0-9]{4}-[0-9]{2}-[0-9]{2}[Tt][0-9]{2}:[0-9]{2}:[0-9]{2}([.|,][0-9]+)?(Z|z|[+-][0-9]{2}:[0-9]{2})$" ;
sh:severity sh:Violation ;
sh:message "All `startTime` and `endTime` values MUST follow the RFC 3339 standard (YYYY-MM-DD'T'hh:mm:ss[.fraction](Z | ±hh:mm))." ;
sh:description "Start timestamps MUST follow the RFC 3339 standard." ;
] .
#=== SHOULD shapes ===#
# (none)
#=== MAY shapes ===#
# (none)