Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions rocrate_validator/profiles/five-safes-crate/must/1_funder.ttl
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Copyright (c) 2024-2025 CRS4
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

@prefix ro: <./> .
@prefix ro-crate: <https://github.com/crs4/rocrate-validator/profiles/ro-crate/> .
@prefix five-safes-crate: <https://github.com/eScienceLab/rocrate-validator/profiles/five-safes-crate/> .
@prefix schema_org: <http://schema.org/> .
@prefix sh: <http://www.w3.org/ns/shacl#> .
@prefix bioschemas: <https://bioschemas.org/> .

five-safes-crate:FundingBody a sh:NodeShape ;
sh:name "Funding body Project" ;
sh:description "Project which is funding this work" ;
sh:targetClass schema_org:Project ;
sh:property [
a sh:PropertyShape ;
sh:name "Project Name" ;
sh:description """Check if the Project Entity `name` (as specified by schema.org)
to clearly identify the dataset and distinguish it from other projects.""" ;
sh:minCount 1 ;
sh:nodeKind sh:Literal ;
sh:path schema_org:name;
sh:message "The Project Entity MUST have a `name` property (as specified by schema.org)" ;
] .
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Copyright (c) 2024-2025 CRS4
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

@prefix ro: <./> .
@prefix ro-crate: <https://github.com/crs4/rocrate-validator/profiles/ro-crate/> .
@prefix five-safes-crate: <https://github.com/eScienceLab/rocrate-validator/profiles/five-safes-crate/> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix schema_org: <http://schema.org/> .
@prefix sh: <http://www.w3.org/ns/shacl#> .
@prefix validator: <https://github.com/crs4/rocrate-validator/> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .


five-safes-crate:RootDataEntityRequiredProperties
a sh:NodeShape ;
sh:name "Five Safes Crate Root Data Entity REQUIRED properties" ;
sh:description "The Root Data Entity MUST have a `sourceOrganisation`" ;
sh:targetClass ro-crate:RootDataEntity ;
sh:property [
a sh:PropertyShape ;
sh:name "Root Data Entity: `sourceOrganization` property" ;
sh:description """Check if the Root Data Entity includes a `sourceOrganization` (as specified by schema.org).""" ;
sh:path schema_org:sourceOrganization;
sh:minCount 1 ;
sh:class ro-crate:ContextualEntity ;
sh:message """The Root Data Entity MUST have a `sourceOrganization` property (as specified by schema.org).
SHOULD link to a Contextual Entity in the RO-Crate Metadata File with a name.""" ;
] .
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# Copyright (c) 2025 eScience Lab, The University of Manchester
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

@prefix ro: <./> .
@prefix ro-crate: <https://github.com/crs4/rocrate-validator/profiles/ro-crate/> .
@prefix five-safes-crate: <https://github.com/eScienceLab/rocrate-validator/profiles/five-safes-crate/> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix schema: <http://schema.org/> .
@prefix sh: <http://www.w3.org/ns/shacl#> .
@prefix validator: <https://github.com/crs4/rocrate-validator/> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .



five-safes-crate:CreateActionHasAgent
a sh:NodeShape ;
sh:name "CreateAction" ;
sh:targetClass schema:CreateAction ;
sh:description "Checks that a CreateAction has an agent and that each agent is a schema:Person." ;

# CreateAction entity MUST have an agent (IRI)
sh:property [
a sh:PropertyShape ;
sh:name "Has Agent" ;
sh:path schema:agent ;
sh:minCount 1 ;
sh:nodeKind sh:IRI ;
sh:severity sh:Violation ;
sh:message "CreateAction MUST have at least one schema:agent that is an IRI." ;
] ;

# The agent of a CreateAction entity MUST be a Person
sh:property [
a sh:PropertyShape ;
sh:name "Agent is a Person" ;
sh:path schema:agent ;
sh:nodeKind sh:IRI ;
sh:class schema:Person ;
sh:severity sh:Violation ;
sh:message "Each CreateAction agent MUST be typed as schema:Person and be an IRI." ;
] ;

# If any agent affiliation exists, it MUST be an Organization (IRI)
sh:property [
a sh:PropertyShape ;
sh:name "Affiliation is an Organization" ;
sh:path ( schema:agent schema:affiliation ) ;
sh:class schema:Organization ;
sh:nodeKind sh:IRI ;
sh:severity sh:Violation ;
sh:message "The affiliation (if any) of a CreateAction's agent MUST be a schema:Organization and be an IRI." ;
] .
81 changes: 81 additions & 0 deletions rocrate_validator/profiles/five-safes-crate/profile.ttl
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
# Copyright (c) 2024-2025 CRS4, University of Manchester
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

@prefix dct: <http://purl.org/dc/terms/> .
@prefix prof: <http://www.w3.org/ns/dx/prof/> .
@prefix role: <http://www.w3.org/ns/dx/prof/role/> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .

<https://w3id.org/5s-crate/0.4>
a prof:Profile ;

# the Profile's label
rdfs:label "Five Safes RO-Crate 0.4" ;

# regular metadata, a basic description of the Profile
rdfs:comment """Five Safes RO-Crate Metadata Specification 0.4"""@en ;

# URI of the publisher of the Metadata Specification
dct:publisher <https://w3id.org/5s-crate> ;

# This profile is an extension of Workflow Run Crate for use in Trusted Research Environments (TRE)
prof:isProfileOf <https://w3id.org/ro/wfrun/workflow/0.5> ;

# This profile is a transitive profile of the RO-Crate Metadata Specification
prof:isTransitiveProfileOf <https://w3id.org/ro/crate/1.1> ,
<https://w3id.org/ro/wfrun/process/0.5> ,
<https://w3id.org/workflowhub/workflow-ro-crate/1.0> ;

# this profile has a JSON-LD context resource
prof:hasResource [
a prof:ResourceDescriptor ;

# it's in JSON-LD format
dct:format <https://w3id.org/mediatype/application/ld+json> ;

# it conforms to JSON-LD, here refered to by its namespace URI as a Profile
dct:conformsTo <https://www.w3.org/TR/json-ld11/> ;

# this profile resource plays the role of "Vocabulary"
# described in this ontology's accompanying Roles vocabulary
prof:hasRole role:Vocabulary ;

# this profile resource's actual file
prof:hasArtifact <https://w3id.org/ro/terms/workflow-run/context> ;
] ;

# this profile has a human-readable documentation resource
prof:hasResource [
a prof:ResourceDescriptor ;

# it's in HTML format
dct:format <https://w3id.org/mediatype/text/html> ;

# it conforms to HTML, here refered to by its namespace URI as a Profile
dct:conformsTo <https://www.w3.org/TR/html/> ;

# this profile resource plays the role of "Specification"
# described in this ontology's accompanying Roles vocabulary
prof:hasRole role:Specification ;

# this profile resource's actual file
prof:hasArtifact <https://trefx.uk/5s-crate/0.4/> ;

# this profile is inherited from Workflow Run profile
prof:isInheritedFrom <https://www.researchobject.org/workflow-run-crate/profiles/0.5/workflow_run_crate/> ;
] ;

# a short code to refer to the Profile with when a URI can't be used
prof:hasToken "five-safes-crate" ;
.
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# Copyright (c) 2025 eScience Lab, The University of Manchester
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

@prefix ro: <./> .
@prefix ro-crate: <https://github.com/crs4/rocrate-validator/profiles/ro-crate/> .
@prefix five-safes-crate: <https://github.com/eScienceLab/rocrate-validator/profiles/five-safes-crate/> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix schema: <http://schema.org/> .
@prefix sh: <http://www.w3.org/ns/shacl#> .
@prefix validator: <https://github.com/crs4/rocrate-validator/> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .


# Person who is the agent of a CreateAction SHOULD have an affiliation
five-safes-crate:PersonAgentHasAffiliation
a sh:NodeShape ;
sh:name "Agent of CreateAction" ;
sh:description "The agent of a CreateAction entity" ;
sh:target [
a sh:SPARQLTarget ;
sh:prefixes ro-crate:sparqlPrefixes ;
sh:select """
SELECT DISTINCT ?this WHERE {
?action a schema:CreateAction ;
schema:agent ?this .
}
"""
] ;

# The agent of a CreateAction entity SHOULD have an affiliation
sh:property [
a sh:PropertyShape ;
sh:name "Presence of affiliations" ;
sh:path schema:affiliation ;
sh:minCount 1 ;
sh:severity sh:Warning ;
sh:message "The agent of a CreateAction entity SHOULD have an affiliation" ;
] ;

# If the agent has an affiliation, validate the affiliation node's IRI
sh:property [
a sh:PropertyShape ;
sh:name "Affiliation IRI" ;
sh:path schema:affiliation ;
sh:nodeKind sh:IRI ;
sh:or (
[ sh:pattern "^https://ror\\.org/0[0-9a-hjkmnp-tv-z]{6}[0-9]{2}$" ; sh:flags "i"]
[ sh:pattern "^https://isni\\.org/isni/\\d{15}[\\dX]$" ; sh:flags "i"]
[ sh:pattern "^https://(?:www\\.)?wikidata\\.org/entity/Q\\d+$" ; sh:flags "i"]
) ;
sh:severity sh:Warning ;
sh:message "Affiliation Organization @id SHOULD be a permalink (ROR/ISNI/Wikidata)." ;
] .
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
# Copyright (c) 2025 eScience Lab, The University of Manchester
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

@prefix ro: <./> .
@prefix ro-crate: <https://github.com/crs4/rocrate-validator/profiles/ro-crate/> .
@prefix five-safes-crate: <https://github.com/eScienceLab/rocrate-validator/profiles/five-safes-crate/> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix schema: <http://schema.org/> .
@prefix sh: <http://www.w3.org/ns/shacl#> .
@prefix validator: <https://github.com/crs4/rocrate-validator/> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .

# Root Dataset SHOULD declare conformsTo Five Safes profile
five-safes-crate:RootDatasetConformsToFiveSafes
a sh:NodeShape ;
sh:name "Root Dataset Five Safes RO-Crate profile conformance" ;
sh:description "The Root Data Entity (./) SHOULD declare conformsTo the Five Safes RO-Crate profile." ;
sh:targetNode ro: ;
sh:property [
a sh:PropertyShape ;
sh:name "conformsTo Five Safes profile" ;
sh:description "Root Dataset SHOULD include schema:conformsTo https://w3id.org/5s-crate/0.4" ;
sh:path schema:conformsTo ;
sh:qualifiedValueShape [
sh:hasValue <https://w3id.org/5s-crate/0.4>
] ;
sh:qualifiedMinCount 1 ;
sh:severity sh:Warning ;
sh:message "Profile Conformance: Root Dataset SHOULD include schema:conformsTo with @id https://w3id.org/5s-crate/0.4" ;
] .

five-safes-crate:RootDatasetDatePublishedWhenPublished
a sh:NodeShape ;
sh:name "datePublished present on published crates" ;
sh:description "If the root dataset is published (has schema:publisher), it SHOULD have schema:datePublished." ;
sh:targetNode ro: ;
sh:severity sh:Warning ;
sh:message "Published crates SHOULD include schema:datePublished." ;
sh:or (
# datePublished not required if no publisher:
[ sh:not [ sh:property [
sh:path schema:publisher ;
sh:minCount 1 ;
]]]
# datePublished required if publisher present:
[ sh:property [
sh:path schema:datePublished ;
sh:minCount 1 ;
]]
) .

five-safes-crate:RootDatasetLicenseWhenPublished
a sh:NodeShape ;
sh:name "License present on published crates" ;
sh:description "If the root dataset is published (has schema:publisher), it SHOULD declare a license." ;
sh:targetNode ro: ;
sh:severity sh:Warning ;
sh:message "Profile Conformance: Published crates SHOULD include a license." ;
sh:or (
# license not required if no publisher:
[ sh:not [ sh:property [
sh:path schema:publisher ;
sh:minCount 1 ;
]]]
# license required if publisher present:
[ sh:property [
sh:path schema:license ;
sh:minCount 1 ;
]]
) .
Loading
Loading