Skip to content

Commit 35fad70

Browse files
committed
1) Now a CreateAction entity can have more than 1 agent. 2) Also, check on @id being a permalink is now restricted to Organizations that are affiliations of agents.
1 parent b0f2174 commit 35fad70

2 files changed

Lines changed: 24 additions & 21 deletions

File tree

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,7 @@ five-safes-crate:CreateActionHasAgent
2929
sh:targetClass schema:CreateAction ;
3030
sh:property [
3131
sh:path schema:agent ;
32-
sh:minCount 1 ;
33-
sh:maxCount 1 ;
32+
sh:minCount 1 ;
3433
sh:nodeKind sh:IRI ;
3534
sh:message "CreateAction MUST have an agent property." ;
3635
] .

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

Lines changed: 23 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -32,29 +32,33 @@ five-safes-crate:PersonAgentHasAffiliation
3232
] .
3333

3434

35-
# All schema:Organization instances: @id SHOULD be a PID permalink (ROR / ISNI / Wikidata)
36-
five-safes-crate:OrganizationIdIsPIDPermalink
35+
five-safes-crate:PersonAgentOfCreateAction_AffiliationPermalinkCheck
3736
a sh:NodeShape ;
38-
sh:name "Organizations value restriction" ;
39-
sh:description "An Organization `@id` should be a PID permalink (ROR, ISNI, or Wikidata)." ;
37+
sh:name "Person (agent of CreateAction) → affiliation Organization PID check" ;
38+
sh:description "For Persons who are agents of a CreateAction, validate that any affiliation Organization has a PID permalink @id." ;
4039

41-
# Target the CLASS node; values are all subjects with rdf:type schema:Organization
42-
sh:targetNode schema:Organization ;
40+
# Target: Persons that are objects of schema:agent where the subject is a CreateAction
41+
sh:target [
42+
a sh:SPARQLTarget ;
43+
sh:prefixes ro-crate:sparqlPrefixes ;
44+
sh:select """
45+
SELECT ?this WHERE {
46+
?this a schema:Person .
47+
?action a schema:CreateAction ;
48+
schema:agent ?this .
49+
}
50+
""" ;
51+
] ;
4352

53+
# If the Person has an affiliation, validate the affiliation node's IRI
4454
sh:property [
4555
a sh:PropertyShape ;
46-
sh:name "Organization URI value" ;
47-
sh:description "Check that the Organization entity URI (@id) is a PID permalink." ;
48-
49-
# From the class node, walk inverse rdf:type to all instances
50-
sh:path [ sh:inversePath rdf:type ] ;
51-
52-
# Require at least one instance (prevents empty graphs from 'passing')
53-
sh:minCount 1 ;
54-
55-
# Regex over the string form of the instance IRI
56+
sh:name "affiliation Organization PID permalink" ;
57+
sh:path schema:affiliation ;
58+
# Optional typing requirement (keep or drop as you prefer)
59+
sh:class schema:Organization ;
60+
sh:nodeKind sh:IRI ;
5661
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+))$" ;
5762
sh:flags "i" ;
58-
59-
sh:message "Organization @id SHOULD be a PID permalink (ROR/ISNI/Wikidata)." ;
60-
] .
63+
sh:message "Affiliation Organization @id SHOULD be a PID permalink (ROR/ISNI/Wikidata)." ;
64+
] .

0 commit comments

Comments
 (0)