1111# Person who is the agent of a CreateAction SHOULD have an affiliation
1212five-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