-
Notifications
You must be signed in to change notification settings - Fork 1
Implement Workflow Retrieval Phase Ruleset #51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Changes from 3 commits
4f7aa40
fc986ca
273d4ba
7e158db
586ab3d
b836a4b
c441902
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,56 @@ | ||
| # 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:CheckValueMayHaveStartTimeIfBegun | ||
| a sh:NodeShape ; | ||
| sh:name "DownloadAction" ; | ||
| sh:description "" ; | ||
| sh:target [ | ||
| a sh:SPARQLTarget ; | ||
| sh:select """ | ||
| PREFIX schema: <http://schema.org/> | ||
| PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> | ||
| SELECT ?this | ||
| WHERE { | ||
| ?this rdf:type schema:DownloadAction ; | ||
| schema:actionStatus ?status . | ||
| FILTER(?status IN ( | ||
| "http://schema.org/CompletedActionStatus", | ||
| "http://schema.org/FailedActionStatus", | ||
| "http://schema.org/ActiveActionStatus" | ||
| )) | ||
| } | ||
| """ ; | ||
| ] ; | ||
|
|
||
| sh:property [ | ||
| a sh:PropertyShape ; | ||
| sh:name "StartTime" ; | ||
| sh:path schema:startTime ; | ||
| sh:minCount 1 ; | ||
| sh:maxCount 1 ; | ||
| sh:severity sh:Info ; | ||
| sh:message "`DownloadAction` MAY have the `startTime` property if it has begun." ; | ||
EttoreM marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| ] . | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,121 @@ | ||
| # 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:DownloadActionObjectHasDescriptiveName | ||
| a sh:NodeShape ; | ||
| sh:name "DownloadAction" ; | ||
| sh:targetClass schema:DownloadAction ; | ||
| sh:description "" ; | ||
|
|
||
| sh:property [ | ||
| a sh:PropertyShape ; | ||
| sh:name "name" ; | ||
| sh:description "DownloadAction MUST have a human readable name string of at least 10 characters." ; | ||
| sh:path schema:name ; | ||
| sh:minCount 1 ; | ||
| sh:maxCount 1 ; | ||
| sh:datatype xsd:string ; | ||
| sh:minLength 10 ; | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think we should specific a minimum length for these strings.
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The requirement is that the name MUST be a descriptive, human-readable summary of the download action. I totally agree that 10 characters (or any other number) for minimum length is arbitrary. On the other end this is a baseline rule encouraging users to insert meaningful names rather than, say "XY". |
||
| sh:severity sh:Violation ; | ||
| sh:message "DownloadAction MUST have a human readable name string of at least 10 characters." ; | ||
| ] . | ||
|
|
||
| five-safes-crate:DownloadActionStartTimeMustFollowISOStandard | ||
| a sh:NodeShape ; | ||
| sh:name "DownloadAction" ; | ||
| sh:description "" ; | ||
| sh:target [ | ||
| a sh:SPARQLTarget ; | ||
| sh:select """ | ||
| PREFIX schema: <http://schema.org/> | ||
| PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> | ||
|
|
||
| SELECT ?this | ||
| WHERE { | ||
| ?this rdf:type schema:DownloadAction ; | ||
| schema:startTime ?o . | ||
| } | ||
| """ ; | ||
| ] ; | ||
|
|
||
| sh:property [ | ||
| a sh:PropertyShape ; | ||
| sh:name "StartTime" ; | ||
| sh:path schema:startTime ; | ||
| sh:pattern "^[0-9]{4}-[0-9]{2}-[0-9]{2}[Tt][0-9]{2}:[0-9]{2}:[0-9]{2}(\\.[0-9]+)?(Z|z|[+-][0-9]{2}:[0-9]{2})$" ; | ||
| sh:severity sh:Violation ; | ||
| sh:message "`DownloadAction` --> `startTime` MUST follows the RFC 3339 standard (YYYY-MM-DD'T'hh:mm:ss[.fraction](Z | ±hh:mm))." ; | ||
| ] . | ||
|
|
||
|
|
||
| five-safes-crate:DownloadActionEndTimeMustFollowISOStandard | ||
| a sh:NodeShape ; | ||
| sh:name "DownloadAction" ; | ||
| sh:description "" ; | ||
| sh:targetClass schema:DownloadAction ; | ||
|
|
||
| sh:property [ | ||
| a sh:PropertyShape ; | ||
| sh:name "EndTime" ; | ||
| sh:minCount 0; | ||
| sh:path schema:endTime ; | ||
| sh:pattern "^[0-9]{4}-[0-9]{2}-[0-9]{2}[Tt][0-9]{2}:[0-9]{2}:[0-9]{2}(\\.[0-9]+)?(Z|z|[+-][0-9]{2}:[0-9]{2})$" ; | ||
| sh:severity sh:Violation ; | ||
| sh:message "`DownloadAction` --> `endTime` MUST follows the RFC 3339 standard (YYYY-MM-DD'T'hh:mm:ss[.fraction](Z | ±hh:mm))." ; | ||
| ] . | ||
|
|
||
|
|
||
| five-safes-crate:CheckValueActionStatusMustHaveAllowedValues | ||
| a sh:NodeShape ; | ||
| sh:name "DownloadAction" ; | ||
| sh:description "" ; | ||
|
|
||
| sh:target [ | ||
| a sh:SPARQLTarget ; | ||
| sh:select """ | ||
| PREFIX schema: <http://schema.org/> | ||
| PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> | ||
|
|
||
| SELECT ?this | ||
| WHERE { | ||
| ?this rdf:type schema:DownloadAction ; | ||
| schema:actionStatus ?status . | ||
| } | ||
| """ ; | ||
| ] ; | ||
|
|
||
| sh:property [ | ||
| a sh:PropertyShape ; | ||
| sh:name "ActionStatus" ; | ||
| 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 "`DownloadAction` --> `actionStatus` MUST have one of the allowed values (see https://schema.org/ActionStatusType)." ; | ||
EttoreM marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| ] . | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,180 @@ | ||
| # 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:RootDataEntityShouldMentionDownloadActionObjectIfItExists | ||
| 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 the DownloadAction object." ; | ||
| sh:select """ | ||
| PREFIX schema: <http://schema.org/> | ||
| PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> | ||
| SELECT $this ?download | ||
| WHERE { | ||
| ?download rdf:type schema:DownloadAction . | ||
| FILTER NOT EXISTS{ | ||
| $this schema:mentions ?download . | ||
| } | ||
| } | ||
| """ ; | ||
| sh:severity sh:Warning ; | ||
| sh:message "RootDataEntity SHOULD mention the DownloadAction object." ; | ||
| ] . | ||
|
|
||
|
|
||
| # five-safes-crate:CheckValueObjectShouldPointToRootDataEntity | ||
EttoreM marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| # a sh:NodeShape ; | ||
| # sh:name "CheckValue" ; | ||
| # 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:CheckValue . | ||
| # } | ||
| # """ ; | ||
| # ] ; | ||
|
|
||
| # sh:property [ | ||
| # a sh:PropertyShape ; | ||
| # sh:name "object" ; | ||
| # sh:path schema:object ; | ||
| # sh:minCount 1 ; | ||
| # sh:hasValue <./> ; | ||
| # sh:severity sh:Warning ; | ||
| # sh:message "`CheckValue` --> `object` SHOULD point to the root of the RO-Crate" ; | ||
| # ] . | ||
|
|
||
|
|
||
| # five-safes-crate:CheckValueInstrumentShouldPointToEntityTypedDefinedTerm | ||
| # a sh:NodeShape ; | ||
| # sh:name "CheckValue" ; | ||
| # 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:CheckValue . | ||
| # } | ||
| # """ ; | ||
| # ] ; | ||
|
|
||
| # sh:property [ | ||
| # a sh:PropertyShape ; | ||
| # sh:name "instrument" ; | ||
| # sh:path schema:instrument ; | ||
| # sh:minCount 1 ; | ||
| # sh:class schema:DefinedTerm ; | ||
| # sh:severity sh:Warning ; | ||
| # sh:message "`CheckValue` --> `instrument` SHOULD point to an entity typed `schema:DefinedTerm`" ; | ||
| # ] . | ||
|
|
||
|
|
||
| # five-safes-crate:CheckValueAgentShouldIdentifyTheAgentWhoPerformnedTheCheck | ||
| # a sh:NodeShape ; | ||
| # sh:name "CheckValue" ; | ||
| # 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:CheckValue . | ||
| # } | ||
| # """ ; | ||
| # ] ; | ||
|
|
||
| # sh:property [ | ||
| # a sh:PropertyShape ; | ||
| # sh:name "agent" ; | ||
| # sh:path schema:agent ; | ||
| # sh:minCount 1 ; | ||
| # sh:nodeKind sh:IRI ; | ||
| # sh:severity sh:Warning ; | ||
| # sh:message "`CheckValue` --> `agent` SHOULD reference the agent who initiated the check" ; | ||
| # ] . | ||
|
|
||
|
|
||
| five-safes-crate:DownloadActionShouldHaveEndTimeIfEnded | ||
| a sh:NodeShape ; | ||
| sh:name "DownloadAction" ; | ||
| sh:description "" ; | ||
| sh:target [ | ||
| a sh:SPARQLTarget ; | ||
| sh:select """ | ||
| PREFIX schema: <http://schema.org/> | ||
| PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> | ||
|
|
||
| SELECT ?this | ||
| WHERE { | ||
| ?this rdf:type schema:DownloadAction ; | ||
| schema:actionStatus ?status . | ||
| FILTER(?status IN ( | ||
| "http://schema.org/CompletedActionStatus", | ||
| "http://schema.org/FailedActionStatus" | ||
| )) | ||
| } | ||
| """ ; | ||
| ] ; | ||
|
|
||
| sh:property [ | ||
| a sh:PropertyShape ; | ||
| sh:name "EndTime" ; | ||
| sh:path schema:endTime ; | ||
| sh:minCount 1 ; | ||
| sh:maxCount 1 ; | ||
| sh:severity sh:Warning ; | ||
| sh:message "`DownloadAction` SHOULD have the `endTime` property if it has ended." ; | ||
EttoreM marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| ] . | ||
|
|
||
|
|
||
| five-safes-crate:DownloadActionShouldHaveActionStatus | ||
| a sh:NodeShape ; | ||
| sh:name "DownloadAction" ; | ||
| sh:targetClass schema:DownloadAction ; | ||
| sh:description "" ; | ||
|
|
||
| sh:property [ | ||
| a sh:PropertyShape ; | ||
| sh:name "ActionStatus" ; | ||
| sh:path schema:actionStatus ; | ||
| sh:minCount 1 ; | ||
| sh:severity sh:Warning ; | ||
| sh:message "`DownloadAction` SHOULD have `actionStatus` property." ; | ||
| ] . | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.