forked from crs4/rocrate-validator
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path2_requesting_agent.ttl
More file actions
97 lines (84 loc) · 3.3 KB
/
Copy path2_requesting_agent.ttl
File metadata and controls
97 lines (84 loc) · 3.3 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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
# 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 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 ===#
five-safes-crate:CreateActionHasAgent
a sh:NodeShape ;
sh:name "CreateAction" ;
sh:targetClass schema:CreateAction ;
sh:description "Checks that a CreateAction has an agent and that each agent is a Person." ;
# CreateAction entity MUST have an agent (IRI)
sh:property [
a sh:PropertyShape ;
sh:name "Has Agent" ;
sh:path schema:agent ;
sh:minCount 1 ;
sh:nodeKind sh:IRI ;
sh:severity sh:Violation ;
sh:message "CreateAction MUST have at least one agent that is a contextual entity." ;
] ;
# The agent of a CreateAction entity MUST be a Person
sh:property [
a sh:PropertyShape ;
sh:name "Agent is a Person" ;
sh:path schema:agent ;
sh:nodeKind sh:IRI ;
sh:class schema:Person ;
sh:severity sh:Violation ;
sh:message "Each CreateAction agent MUST be typed as Person." ;
] ;
# If any agent affiliation exists, it MUST be an Organization (IRI)
sh:property [
a sh:PropertyShape ;
sh:name "Affiliation is an Organization" ;
sh:path ( schema:agent schema:affiliation ) ;
sh:class schema:Organization ;
sh:nodeKind sh:IRI ;
sh:severity sh:Violation ;
sh:message "The affiliation of a CreateAction's agent MUST be a contextual entity with type Organization." ;
] .
#=== SHOULD shapes ===#
# Person who is the agent of a WorkflowRunAction SHOULD have an affiliation
five-safes-crate:PersonAgentHasAffiliation
a sh:NodeShape ;
sh:name "Agent of WorkflowRunAction" ;
sh:description "The agent of a WorkflowRunAction entity" ;
sh:target [
a sh:SPARQLTarget ;
sh:prefixes ro-crate:sparqlPrefixes ;
sh:select """
SELECT DISTINCT ?this WHERE {
?action a ro-crate:WorkflowRunAction ;
schema:agent ?this .
}
"""
] ;
# The agent of the `CreateAction` corresponding to the workflowrunAction SHOULD have an affiliation
sh:property [
a sh:PropertyShape ;
sh:name "Presence of affiliations" ;
sh:path schema:affiliation ;
sh:minCount 1 ;
sh:severity sh:Warning ;
sh:message "The agent of the `CreateAction` corresponding to the workflow run SHOULD have an affiliation" ;
] .
# === MAY shapes ===#
# (none)