forked from crs4/rocrate-validator
-
Notifications
You must be signed in to change notification settings - Fork 0
Implemented rules for the Workflow Execution Phase. #41
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
Merged
EttoreM
merged 15 commits into
develop
from
37-implement-workflow-execution-phase-ruleset
Dec 8, 2025
Merged
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
50b67ef
Implemented rules (minus a couple that need clarifications) for the W…
EttoreM 8cc39c9
Added tests for rules implemented so far.
EttoreM f098e1e
Amended formatting.
EttoreM 86a1b71
Added rule about Worflow's actioStatus.
EttoreM 5b79884
Addressed Eli's comments to PR.
EttoreM ff27145
fixed a lint problem
EttoreM e9405a4
fixed a lint problem - 2
EttoreM 023d2d8
fixed a lint problem - 3
EttoreM b420292
Remobved link problelm.
EttoreM 0ceda47
Fixed tets about startTime and endTime having a proper format.
EttoreM 712bde7
Remobved link problelm - 2.
EttoreM 23ac001
Reduced minimum length of Workflow's name from 20 to 10 characters.
EttoreM 4f3fced
Provided RFC 339 pattern for timestamps in relevant messages.
EttoreM 9232f19
Improved target of SHACL nodeShape for endTime and startTime constrai…
EttoreM 2b75192
Improved target of SHACL nodeShape for endTime and startTime constrai…
EttoreM File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
58 changes: 58 additions & 0 deletions
58
rocrate_validator/profiles/five-safes-crate/may/11_workflow_execution_phase.ttl
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,58 @@ | ||
| # 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:WorkflowexecutionObjectHasStartTimeIfBegun | ||
| a sh:NodeShape ; | ||
| sh:name "WorkflowExecution" ; | ||
| sh:description "The workflow execution object MAY have a startTime if execution was initiated." ; | ||
|
|
||
| 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:CreateAction ; | ||
| 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:description "The workflow execution object MAY have a startTime if execution was initiated." ; | ||
| sh:message "The workflow execution object MAY have a startTime if execution was initiated." ; | ||
| ] . |
96 changes: 96 additions & 0 deletions
96
rocrate_validator/profiles/five-safes-crate/must/11_workflow_execution_phase.ttl
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,96 @@ | ||
| # 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:WorkflowMustHaveDescriptiveName | ||
| a sh:NodeShape ; | ||
| sh:name "WorkflowExecution" ; | ||
| sh:targetClass schema:CreateAction ; | ||
|
|
||
| sh:property [ | ||
| sh:a sh:PropertyShape ; | ||
| sh:name "name" ; | ||
| sh:minCount 1 ; | ||
| sh:description "Workflow (CreateAction) MUST have a name string of at least 10 characters." ; | ||
| sh:path schema:name ; | ||
| sh:datatype xsd:string ; | ||
| sh:minLength 10 ; | ||
| sh:severity sh:Violation ; | ||
| sh:message "Workflow (CreateAction) MUST have a name string of at least 10 characters." ; | ||
| ] . | ||
|
|
||
|
|
||
| five-safes-crate:WorkflowexecutionObjectHasCompliantStartTimeFormat | ||
| a sh:NodeShape ; | ||
| sh:name "WorkflowExecution" ; | ||
| sh:description "The startTime of the workflow execution object MUST follow the RFC 3339 standard (YYYY-MM-DD'T'hh:mm:ss[.fraction](Z | ±hh:mm))." ; | ||
| sh:targetClass schema:CreateAction ; | ||
|
|
||
| sh:property [ | ||
| a sh:PropertyShape ; | ||
| sh:name "StartTime" ; | ||
| sh:path schema:startTime ; | ||
| sh:minCount 0 ; | ||
| 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 "The startTime of the workflow execution object MUST follow the RFC 3339 standard (YYYY-MM-DD'T'hh:mm:ss[.fraction](Z | ±hh:mm))." ; | ||
| ] . | ||
|
|
||
|
|
||
| five-safes-crate:WorkflowexecutionObjectHasCompliantEndTimeFormat | ||
| a sh:NodeShape ; | ||
| sh:name "WorkflowExecution" ; | ||
| sh:description "The endTime of the workflow execution object MUST follow the RFC 3339 standard (YYYY-MM-DD'T'hh:mm:ss[.fraction](Z | ±hh:mm))." ; | ||
| sh:targetClass schema:CreateAction ; | ||
|
|
||
| sh:property [ | ||
| a sh:PropertyShape ; | ||
| sh:name "EndTime" ; | ||
| sh:path schema:endTime ; | ||
| sh:minCount 0 ; | ||
| 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 ; | ||
elichad marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| sh:message "The endTime of the workflow execution object MUST follow the RFC 3339 standard (YYYY-MM-DD'T'hh:mm:ss[.fraction](Z | ±hh:mm))." ; | ||
| ] . | ||
|
|
||
|
|
||
| five-safes-crate:WorkflowMustHaveActionStatusWithAllowedValues | ||
| a sh:NodeShape ; | ||
| sh:name "WorkflowExecution" ; | ||
| sh:targetClass schema:CreateAction ; | ||
| sh:property [ | ||
| a sh:PropertyShape ; | ||
| sh:minCount 1 ; | ||
| sh:name "actionStatus" ; | ||
| sh:description "WorkflowExecution MUST have an actionStatus with 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 "WorkflowExecution MUST have an actionStatus with an allowed value (see https://schema.org/ActionStatusType)." ; | ||
| ] . | ||
85 changes: 85 additions & 0 deletions
85
rocrate_validator/profiles/five-safes-crate/should/11_workflow_execution_phase.ttl
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,85 @@ | ||
| # 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:RootDataEntityShouldMentionWorkflow | ||
| a sh:NodeShape ; | ||
| sh:name "RootDataEntity" ; | ||
| sh:description "RootDataEntity SHOULD mention workflow execution object (typed CreateAction)." ; | ||
| sh:targetClass ro-crate:RootDataEntity ; | ||
| sh:sparql [ | ||
| a sh:SPARQLConstraint ; | ||
| sh:name "mentions" ; | ||
| sh:select """ | ||
| PREFIX schema: <http://schema.org/> | ||
| PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> | ||
| SELECT $this | ||
| WHERE { | ||
|
|
||
| FILTER NOT EXISTS { | ||
| $this schema:mentions ?workflowExecution . | ||
| ?workflowExecution rdf:type schema:CreateAction . | ||
| } | ||
| } | ||
| """ ; | ||
| sh:severity sh:Warning ; | ||
| sh:message "RootDataEntity SHOULD mention workflow execution object (typed CreateAction)." ; | ||
| ] . | ||
|
|
||
|
|
||
|
|
||
| five-safes-crate:WorkflowexecutionObjectHasEndTimeIfEnded | ||
| a sh:NodeShape ; | ||
| sh:name "WorkflowExecution" ; | ||
| sh:description "The workflow execution object SHOULD have an endTime property if it has ended." ; | ||
|
|
||
| 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:CreateAction ; | ||
| 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:description "The workflow execution object SHOULD have an endTime property if it has ended." ; | ||
| sh:message "The workflow execution object SHOULD have an endTime property if it has ended." ; | ||
| ] . |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.