Skip to content

Commit 4beee9a

Browse files
committed
Added extra tests
1 parent 6a42e50 commit 4beee9a

5 files changed

Lines changed: 79 additions & 41 deletions

File tree

rocrate_validator/profiles/five-safes-crate/may/1_responsible_project.ttl

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,5 +43,14 @@ five-safes-crate:ResponsibleProject
4343
sh:path schema:funding;
4444
sh:minCount 1 ;
4545
sh:severity sh:Info ;
46-
sh:message """The Responsible Project MAY have a 'funding' property.""" ;
46+
sh:message """The Responsible Project does not have the property 'funding'.""" ;
47+
] ;
48+
49+
sh:property [
50+
a sh:PropertyShape ;
51+
sh:name "member" ;
52+
sh:path schema:member;
53+
sh:minCount 1 ;
54+
sh:severity sh:Info ;
55+
sh:message """The Responsible Project does not have the property 'member'.""" ;
4756
] .

rocrate_validator/profiles/five-safes-crate/must/1.requesting_agent.ttl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ five-safes-crate:AgentIsMemberOf
4646
] .
4747

4848

49-
# Rule 5
5049
five-safes-crate:AgentProjectIntersection
5150
a sh:NodeShape ;
5251
sh:name "Agent" ;

rocrate_validator/profiles/five-safes-crate/must/1_responsible_project.ttl

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,4 +44,13 @@ five-safes-crate:ResponsibleProject
4444
sh:class schema:Grant ;
4545
sh:severity sh:Violation ;
4646
sh:message """The property 'funding' of the Responsible Project MUST be of type schema:Grant.""" ;
47+
] ;
48+
49+
sh:property [
50+
a sh:PropertyShape ;
51+
sh:name "member" ;
52+
sh:path schema:member;
53+
sh:class schema:Organization ;
54+
sh:severity sh:Violation ;
55+
sh:message """The property 'member' of the Responsible Project MUST be of type schema:Organization.""" ;
4756
] .

rocrate_validator/profiles/five-safes-crate/must/1_root_data_entity_metadata.ttl

Lines changed: 0 additions & 39 deletions
This file was deleted.
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# Copyright (c) 2024-2025 CRS4
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
@prefix ro: <./> .
16+
@prefix ro-crate: <https://github.com/crs4/rocrate-validator/profiles/ro-crate/> .
17+
@prefix five-safes-crate: <https://github.com/eScienceLab/rocrate-validator/profiles/five-safes-crate/> .
18+
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
19+
@prefix schema: <http://schema.org/> .
20+
@prefix sh: <http://www.w3.org/ns/shacl#> .
21+
@prefix validator: <https://github.com/crs4/rocrate-validator/> .
22+
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
23+
24+
25+
five-safes-crate:ResponsibleProjectMemberAndSourceOrganizationIntersection
26+
a sh:NodeShape ;
27+
sh:name "Organizations (members of Responsible Project)" ;
28+
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.""" ;
29+
sh:target [
30+
a sh:SPARQLTarget ;
31+
sh:prefixes ro-crate:sparqlPrefixes ;
32+
sh:select """
33+
SELECT DISTINCT ?this WHERE {
34+
?action a schema:CreateAction ;
35+
schema:agent ?this .
36+
?this a schema:Person ;
37+
schema:memberOf ?project ;
38+
schema:affiliation ?someAffiliation .
39+
?project schema:member ?org2 .
40+
}
41+
"""
42+
] ;
43+
sh:sparql [
44+
a sh:SPARQLConstraint ;
45+
sh:name "Intersection with agent affiliations" ;
46+
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.""" ;
47+
48+
sh:prefixes ro-crate:sparqlPrefixes ;
49+
sh:select """
50+
SELECT $this WHERE {
51+
FILTER NOT EXISTS {
52+
$this schema:affiliation ?org .
53+
$this schema:memberOf ?project .
54+
?project schema:member ?org .
55+
}
56+
}
57+
""" ;
58+
sh:severity sh:Warning ;
59+
sh:message """At least one of the organisations that are members of the responsible project SHOULD be included in the Requesting Agent's affiliations.""" ;
60+
] .

0 commit comments

Comments
 (0)