forked from crs4/rocrate-validator
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path1_responsible_project.ttl
More file actions
137 lines (122 loc) · 4.73 KB
/
1_responsible_project.ttl
File metadata and controls
137 lines (122 loc) · 4.73 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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
# 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:ResponsibleProject
a sh:NodeShape ;
sh:name "Responsible Project" ;
sh:target [
a sh:SPARQLTarget ;
sh:prefixes ro-crate:sparqlPrefixes ;
sh:select """
SELECT DISTINCT ?this WHERE {
?action a schema:CreateAction ;
schema:agent ?agent .
?agent schema:memberOf ?this .
}
"""
] ;
sh:property [
a sh:PropertyShape ;
sh:name "funding" ;
sh:path schema:funding;
sh:class schema:Grant ;
sh:severity sh:Violation ;
sh:message """The property 'funding' of the Responsible Project MUST be of type Grant.""" ;
] ;
sh:property [
a sh:PropertyShape ;
sh:name "member" ;
sh:path schema:member;
sh:or (
[ sh:class schema:Organization ]
[ sh:class schema:Person ]
) ;
sh:severity sh:Violation ;
sh:message """The property 'member' of the Responsible Project MUST be of type schema:Organization or Person.""" ;
] .
#=== SHOULD shapes ===#
five-safes-crate:ResponsibleProjectMemberAndSourceOrganizationIntersection
a sh:NodeShape ;
sh:name "Organizations (members of Responsible Project)" ;
sh:description """At least one of the organisations that are members of the responsible project SHOULD be included in the Requesting Agent's affiliations, if such properties exist.""" ;
sh:target [
a sh:SPARQLTarget ;
sh:prefixes ro-crate:sparqlPrefixes ;
sh:select """
SELECT DISTINCT ?this WHERE {
?action a schema:CreateAction ;
schema:agent ?this .
?this a schema:Person ;
schema:memberOf ?project ;
schema:affiliation ?someAffiliation .
?project schema:member ?org2 .
}
"""
] ;
sh:sparql [
a sh:SPARQLConstraint ;
sh:name "Intersection with agent affiliations" ;
sh:description """At least one of the organisations that are members of the responsible project SHOULD be included in the Requesting Agent's affiliations, if such properties exist.""" ;
sh:prefixes ro-crate:sparqlPrefixes ;
sh:select """
SELECT $this WHERE {
FILTER NOT EXISTS {
$this schema:affiliation ?org .
$this schema:memberOf ?project .
?project schema:member ?org .
}
}
""" ;
sh:severity sh:Warning ;
sh:message """At least one of the organisations that are members of the responsible project SHOULD be included in the Requesting Agent's affiliations, if such properties exist.""" ;
] .
#=== MAY shapes ===#
five-safes-crate:ResponsibleProject
a sh:NodeShape ;
sh:name "Responsible Project" ;
sh:target [
a sh:SPARQLTarget ;
sh:prefixes ro-crate:sparqlPrefixes ;
sh:select """
SELECT DISTINCT ?this WHERE {
?action a schema:CreateAction ;
schema:agent ?agent .
?agent schema:memberOf ?this .
}
"""
] ;
sh:property [
a sh:PropertyShape ;
sh:name "funding" ;
sh:path schema:funding;
sh:minCount 1 ;
sh:severity sh:Info ;
sh:message """The Responsible Project does not have the property `funding`.""" ;
] ;
sh:property [
a sh:PropertyShape ;
sh:name "member" ;
sh:path schema:member;
sh:minCount 1 ;
sh:severity sh:Info ;
sh:message """The Responsible Project does not have the property `member`.""" ;
] .