1111# Person who is the agent of a CreateAction SHOULD have an affiliation
1212five-safes-crate:PersonAgentHasAffiliation
1313 a sh:NodeShape ;
14- sh:name " Agent's affiliation" ;
15- sh:description " The agent of a CreateAction entity SHOULD have an affiliation" ;
16- sh:message " The agent of a CreateAction entity SHOULD have an affiliation" ;
14+ sh:name " Agent of CreateAction" ;
15+ sh:description " The agent of a CreateAction entity" ;
1716 sh:target [
1817 a sh:SPARQLTarget ;
1918 sh:prefixes ro-crate:sparqlPrefixes ;
2019 sh:select """
2120 SELECT DISTINCT ?this WHERE {
2221 ?action a schema:CreateAction ;
2322 schema:agent ?this .
24- ?this a schema:Person .
2523 }
2624 """
2725 ] ;
26+
27+ # The agent of a CreateAction entity SHOULD have an affiliation
2828 sh:property [
29+ sh:name " Presence of affiliations" ;
2930 sh:path schema:affiliation ;
3031 sh:minCount 1 ;
32+ sh:severity sh:Warning ;
3133 sh:message " The agent of a CreateAction entity SHOULD have an affiliation" ;
32- ] .
33-
34-
35- five-safes-crate:PersonAgentOfCreateAction_AffiliationPermalinkCheck
36- a sh:NodeShape ;
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." ;
39-
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- ] ;
34+ ] ;
5235
53- # If the Person has an affiliation, validate the affiliation node's IRI
54- sh:property [
55- a sh:PropertyShape ;
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 ;
61- # Match the string form of the IRI against approved PID patterns.
62- # - ROR: https://ror.org/0XXXXXXX## (Crockford base32 + 2 digits)
63- # - ISNI: https://isni.org/isni/NNNNNNNNNNNNNNNX (X allowed as checksum)
64- # - Wikidata: https://www.wikidata.org/entity/Q<digits> (or without www)
65- 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+))$" ;
66- sh:flags " i" ;
67- sh:message " Affiliation Organization @id SHOULD be a PID permalink (ROR/ISNI/Wikidata)." ;
68- ] .
36+ # If the agent has an affiliation, validate the affiliation node's IRI
37+ sh:property [
38+ a sh:PropertyShape ;
39+ sh:name " Affiliation IRI" ;
40+ sh:path schema:affiliation ;
41+ sh:nodeKind sh:IRI ;
42+ sh:or (
43+ [ sh:pattern " ^https://ror\\.org/0[0-9a-hjkmnp-tv-z]{6}[0-9]{2}$" ]
44+ [ sh:pattern " ^https://isni\\.org/isni/\\d{15}[\\dX]$" ]
45+ [ sh:pattern " ^https://(?:www\\.)?wikidata\\.org/entity/Q\\d+$" ]
46+ ) ;
47+ sh:flags " i" ;
48+ sh:severity sh:Warning ;
49+ sh:message " Affiliation Organization @id SHOULD be a permalink (ROR/ISNI/Wikidata)." ;
50+ ] .
0 commit comments