Skip to content

Commit c7d6084

Browse files
committed
Ammended test checking that agent SHOULD have an affiliation.
1 parent 47023b1 commit c7d6084

2 files changed

Lines changed: 44 additions & 39 deletions

File tree

rocrate_validator/profiles/five-safes-crate/must/2_agent_entity.ttl

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -77,31 +77,3 @@ five-safes-crate:AgentAffiliationIsOrganization
7777
sh:class schema:Organization ;
7878
sh:message "The affiliation (if any) of a CreateAction's agent MUST be an Organization" ;
7979
] .
80-
81-
82-
# All schema:Organization instances: @id MUST be a PID permalink (ROR / ISNI / Wikidata)
83-
five-safes-crate:OrganizationIdIsPIDPermalink
84-
a sh:NodeShape ;
85-
sh:name "Organizations value restriction" ;
86-
sh:description "An Organization `@id` must be a PID permalink (ROR, ISNI, or Wikidata)." ;
87-
88-
# Target the CLASS node; values are all subjects with rdf:type schema:Organization
89-
sh:targetNode schema:Organization ;
90-
91-
sh:property [
92-
a sh:PropertyShape ;
93-
sh:name "Organization URI value" ;
94-
sh:description "Check that the Organization entity URI (@id) is a PID permalink." ;
95-
96-
# From the class node, walk inverse rdf:type to all instances
97-
sh:path [ sh:inversePath rdf:type ] ;
98-
99-
# Require at least one instance (prevents empty graphs from 'passing')
100-
sh:minCount 1 ;
101-
102-
# Regex over the string form of the instance IRI
103-
sh:pattern "^(?:https://(?:ror\\.org/0[0-9a-hjkmnp-tv-z]{6}[0-9]{2}|isni\\.org/isni/\\d{15}[\\dX]|(?:www\\.)?wikidata\\.org/entity/Q\\d+))$" ;
104-
sh:flags "i" ;
105-
106-
sh:message "Organization @id MUST be a PID permalink (ROR/ISNI/Wikidata)." ;
107-
] .

rocrate_validator/profiles/five-safes-crate/should/2_agent_entity.ttl

Lines changed: 44 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,49 @@
1111
# Person who is the agent of a CreateAction SHOULD have an affiliation
1212
five-safes-crate:PersonAgentHasAffiliation
1313
a sh:NodeShape ;
14-
sh:name "Organizations value restriction" ;
15-
sh:description "An Organization `@id` must be a permalink" ;
16-
sh:targetClass schema:Organization ;
14+
sh:mame "Agent's affiliation" ;
15+
sh:description "The agent of a CreateAction entity SHOULD have an affiliation" ;
16+
sh:target [
17+
a sh:SPARQLTarget ;
18+
sh:prefixes ro-crate:sparqlPrefixes ;
19+
sh:select """
20+
SELECT DISTINCT ?this WHERE {
21+
?action a schema:CreateAction ;
22+
schema:agent ?this .
23+
?this a schema:Person .
24+
}
25+
"""
26+
] ;
1727
sh:property [
18-
a sh:PropertyShape ;
19-
sh:name "Organization URI value" ;
20-
sh:description "Check if the Organization Entity URI is a permalink" ;
21-
sh:path [ sh:inversePath rdf:type ] ;
28+
sh:path schema:affiliation ;
2229
sh:minCount 1 ;
23-
sh:message """An Organization URI MUST be a permalink""" ;
24-
sh:pattern "^(https://(ror\\.org/0[0-9a-hjkmnp-tv-z]{6}[0-9]{2}|isni\\.org/isni/[0-9]{15}[0-9X]|(www\\.)?wikidata\\.org/entity/Q[0-9]+))$" ;
25-
sh:flags "i" ;
26-
] .
30+
sh:message "The agent of a CreateAction entity SHOULD have an affiliation" ;
31+
] .
32+
33+
34+
# All schema:Organization instances: @id SHOULD be a PID permalink (ROR / ISNI / Wikidata)
35+
five-safes-crate:OrganizationIdIsPIDPermalink
36+
a sh:NodeShape ;
37+
sh:name "Organizations value restriction" ;
38+
sh:description "An Organization `@id` should be a PID permalink (ROR, ISNI, or Wikidata)." ;
39+
40+
# Target the CLASS node; values are all subjects with rdf:type schema:Organization
41+
sh:targetNode schema:Organization ;
42+
43+
sh:property [
44+
a sh:PropertyShape ;
45+
sh:name "Organization URI value" ;
46+
sh:description "Check that the Organization entity URI (@id) is a PID permalink." ;
47+
48+
# From the class node, walk inverse rdf:type to all instances
49+
sh:path [ sh:inversePath rdf:type ] ;
50+
51+
# Require at least one instance (prevents empty graphs from 'passing')
52+
sh:minCount 1 ;
53+
54+
# Regex over the string form of the instance IRI
55+
sh:pattern "^(?:https://(?:ror\\.org/0[0-9a-hjkmnp-tv-z]{6}[0-9]{2}|isni\\.org/isni/\\d{15}[\\dX]|(?:www\\.)?wikidata\\.org/entity/Q\\d+))$" ;
56+
sh:flags "i" ;
57+
58+
sh:message "Organization @id SHOULD be a PID permalink (ROR/ISNI/Wikidata)." ;
59+
] .

0 commit comments

Comments
 (0)