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
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
# 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 purl: <http://purl.org/dc/terms/> .
@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:ValidationCheckObjectHasDescriptiveNameAndIsAssessAction
a sh:NodeShape ;
sh:name "ValidationCheck" ;
sh:description "" ;

sh:target [
a sh:SPARQLTarget ;
sh:select """
PREFIX schema: <http://schema.org/>
PREFIX shp: <https://w3id.org/shp#>

SELECT ?this
WHERE {
?this schema:additionalType shp:ValidationCheck .
}
""" ;
] ;

sh:property [
sh:path rdf:type ;
sh:minCount 1 ;
sh:hasValue schema:AssessAction;
sh:severity sh:Violation ;
sh:message "ValidationCheck MUST be a `schema:AssessAction`." ;
] ;

sh:property [
sh:a sh:PropertyShape ;
sh:name "name" ;
sh:description "ValidationCheck MUST have a human readable name string of at least 10 characters." ;
sh:path schema:name ;
sh:datatype xsd:string ;
sh:minLength 10 ;
sh:severity sh:Violation ;
sh:message "ValidationCheck MUST have a human readable name string of at least 10 characters." ;
] .


five-safes-crate:ValidationCheckActionStatusMustHaveAllowedValue
a sh:NodeShape ;
sh:name "ValidationCheck" ;
sh:target [
a sh:SPARQLTarget ;
sh:select """
PREFIX schema: <http://schema.org/>
PREFIX shp: <https://w3id.org/shp#>

SELECT ?this
WHERE {
?this schema:additionalType shp:ValidationCheck ;
schema:actionStatus ?status .
}
""" ;
] ;

sh:property [
a sh:PropertyShape ;
sh:name "actionStatus" ;
sh:description "The `actionStatus` of ValidationCheck MUST have an allowed value (see https://schema.org/ActionStatusType)." ;
sh:path schema:actionStatus ;
sh:in (
"http://schema.org/PotentialActionStatus"
"http://schema.org/ActiveActionStatus"
"http://schema.org/CompletedActionStatus"
"http://schema.org/FailedActionStatus"
) ;
sh:severity sh:Violation ;
sh:message "The `actionStatus` of ValidationCheck MUST have an allowed value (see https://schema.org/ActionStatusType)." ;
] .
Original file line number Diff line number Diff line change
@@ -0,0 +1,167 @@
# 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 purl: <http://purl.org/dc/terms/> .
@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:RootDataEntityShouldMentionValidationCheckObject
a sh:NodeShape ;
sh:name "RootDataEntity" ;
sh:targetClass ro-crate:RootDataEntity ;
sh:description "" ;

sh:sparql [
a sh:SPARQLConstraint ;
sh:name "mentions" ;
sh:description "RootDataEntity SHOULD mention a ValidationCheck object." ;
sh:select """
PREFIX schema: <http://schema.org/>
PREFIX shp: <https://w3id.org/shp#>
SELECT $this
WHERE {
FILTER NOT EXISTS{
$this schema:mentions ?action .
?action schema:additionalType shp:ValidationCheck .
}
}
""" ;
sh:severity sh:Warning ;
sh:message "RootDataEntity SHOULD mention a ValidationCheck object." ;
] .


five-safes-crate:ValidationCheckObjectShouldPointToRootDataEntity
a sh:NodeShape ;
sh:name "ValidationCheck" ;
sh:description "" ;
sh:target [
a sh:SPARQLTarget ;
sh:select """
PREFIX schema: <http://schema.org/>
PREFIX shp: <https://w3id.org/shp#>
SELECT ?this
WHERE {
?this schema:additionalType shp:ValidationCheck .
}
""" ;
] ;

sh:property [
a sh:PropertyShape ;
sh:name "object" ;
sh:path schema:object ;
sh:minCount 1 ;
sh:hasValue <./> ;
sh:severity sh:Warning ;
sh:message "`ValidationCheck` --> `object` SHOULD point to the root of the RO-Crate" ;
] .


five-safes-crate:ValidationCheckInstrumentShouldPointToEntityWithSpecificId
a sh:NodeShape ;
sh:name "ValidationCheck" ;
sh:description "" ;
sh:target [
a sh:SPARQLTarget ;
sh:select """
PREFIX schema: <http://schema.org/>
PREFIX shp: <https://w3id.org/shp#>
SELECT ?this
WHERE {
?this schema:additionalType shp:ValidationCheck .
}
""" ;
] ;

sh:property [
a sh:PropertyShape ;
sh:name "instrument" ;
sh:description "" ;
sh:path schema:instrument ;
sh:minCount 1 ;
sh:nodeKind sh:IRI ;
sh:hasValue <https://w3id.org/5s-crate/0.4> ;
sh:severity sh:Warning ;
sh:message "`ValidationCheck` --> `instrument` SHOULD point to an entity with @id https://w3id.org/5s-crate/0.4" ;
] .


five-safes-crate:ValidationCheckShouldHaveActionStatus
a sh:NodeShape ;
sh:name "ValidationCheck" ;
sh:description "" ;

sh:target [
a sh:SPARQLTarget ;
sh:select """
PREFIX schema: <http://schema.org/>
PREFIX shp: <https://w3id.org/shp#>

SELECT ?this
WHERE {
?this schema:additionalType shp:ValidationCheck .
}
""" ;
] ;

sh:property [
a sh:PropertyShape ;
sh:name "ActionStatus" ;
sh:path schema:actionStatus ;
sh:minCount 1 ;
sh:severity sh:Warning ;
sh:message "ValidationCheck SHOULD have actionStatus property." ;
] .



five-safes-crate:ValidationCheckShouldHaveActionStatus
a sh:NodeShape ;
sh:name "ValidationCheck" ;
sh:target [
a sh:SPARQLTarget ;
sh:select """
PREFIX schema: <http://schema.org/>
PREFIX shp: <https://w3id.org/shp#>

SELECT ?this
WHERE {
?this schema:additionalType shp:ValidationCheck .
}
""" ;
] ;

sh:property [
a sh:PropertyShape ;
sh:minCount 1 ;
sh:name "actionStatus" ;
sh:description "ValidationCheck SHOULD have the `actionStatus` property." ;
sh:path schema:actionStatus ;
sh:in (
"http://schema.org/PotentialActionStatus"
"http://schema.org/ActiveActionStatus"
"http://schema.org/CompletedActionStatus"
"http://schema.org/FailedActionStatus"
) ;
sh:severity sh:Warning ;
sh:message "ValidationCheck SHOULD have the `actionStatus` property." ;
] .
Loading