forked from crs4/rocrate-validator
-
Notifications
You must be signed in to change notification settings - Fork 0
Infer WorkflowRun from CreateAction in five-safes SHACL profiles - NEW #109
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
Open
EttoreM
wants to merge
12
commits into
develop
Choose a base branch
from
107-run-createaction-checks-only-against-the-createactions-that-the-profile-cares-about
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
662cbcd
Infer WorkflowRun from CreateAction in five-safes SHACL profiles
EttoreM 364a81f
Modification of @graph is now centralised
EttoreM eaa0f9d
PARTIALLY amended the error messages that appear as validation fails.…
EttoreM 4862149
completion of amended error messages for workflowrun / createaction
douglowe 474a297
linting test files
douglowe 51efbd6
update 5s-rocrate tests
douglowe f0b4879
Renamed to
EttoreM acd5533
Amended message in 7_requested_workflow_run.ttl and corresponding test
EttoreM e4a1c23
Added blank space in message in SHACL shape of
EttoreM f1f5c63
improved message in 11_workflow_execution_phase.ttl
EttoreM eddf1b7
Improved comment in 11_workflow_execution_phase.ttl
EttoreM 5996412
Addressed extra comments about message in SHACL shapes.
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
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
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
47 changes: 47 additions & 0 deletions
47
rocrate_validator/profiles/five-safes-crate/must/0_workflow_run_inference.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,47 @@ | ||
| # 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-crate: <https://github.com/crs4/rocrate-validator/profiles/ro-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/> . | ||
|
|
||
|
|
||
| ro-crate:FindWorkflowRunAction a sh:NodeShape, validator:HiddenShape; | ||
| sh:order 1 ; | ||
| sh:name "Identify the CreateAction Entity that corresponds to the Workflow run" ; | ||
| sh:description """The Workflow Run is the CreateAction entity that refers to Workflow run. | ||
| This is identified by checking that the CreateAction entity has an `instrument` property | ||
| that references the same entity as the `mainEntity` property of the Root Data Entity.""" ; | ||
| sh:target [ | ||
| a sh:SPARQLTarget ; | ||
| sh:prefixes ro-crate:sparqlPrefixes ; | ||
| sh:select """ | ||
| SELECT ?this | ||
| WHERE { | ||
| ?this a schema:CreateAction ; | ||
| schema:instrument ?instrument . | ||
| ?root a ro-crate:RootDataEntity ; | ||
| schema:mainEntity ?instrument . | ||
| } | ||
| """ | ||
| ] ; | ||
|
|
||
| sh:rule [ | ||
| a sh:TripleRule ; | ||
| sh:subject sh:this ; | ||
| sh:predicate rdf:type ; | ||
| sh:object ro-crate:WorkflowRunAction ; | ||
| ] . |
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
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 |
|---|---|---|
|
|
@@ -22,7 +22,7 @@ | |
| @prefix xsd: <http://www.w3.org/2001/XMLSchema#> . | ||
|
|
||
|
|
||
| five-safes-crate:RootDataEntityMentionsCreateAction | ||
| five-safes-crate:RootDataEntityMentionsWorkflowRunAction | ||
| a sh:NodeShape ; | ||
| sh:name "RootDataEntity" ; | ||
| sh:targetClass ro-crate:RootDataEntity ; | ||
|
|
@@ -33,42 +33,43 @@ five-safes-crate:RootDataEntityMentionsCreateAction | |
| sh:name "mentions" ; | ||
| sh:path schema:mentions; | ||
| sh:qualifiedValueShape [ | ||
| sh:class schema:CreateAction ; | ||
| sh:class ro-crate:WorkflowRunAction ; | ||
| ] ; | ||
| sh:qualifiedMinCount 1 ; | ||
| sh:severity sh:Violation ; | ||
| sh:message "`RootDataEntity` MUST reference at least one `CreateAction` through `mentions`" ; | ||
| sh:message "`RootDataEntity` MUST reference at least one `CreateAction` (corresponding to the workflow run) through `mentions`" ; | ||
| ] . | ||
|
|
||
|
|
||
| five-safes-crate:CreateActionInstrumentAndStatus | ||
| five-safes-crate:WorkflowRunActionExistence | ||
| a sh:NodeShape ; | ||
| sh:name "CreateAction" ; | ||
| sh:targetClass schema:CreateAction ; | ||
| sh:description "" ; | ||
| sh:severity sh:Violation ; # Apply to all property shapes / constraints below | ||
| sh:name "RootDataEntity" ; | ||
| sh:targetClass ro-crate:RootDataEntity ; | ||
| sh:description "" ; | ||
|
|
||
| sh:property [ | ||
| a sh:PropertyShape ; | ||
| sh:name "instrument" ; | ||
| sh:path schema:instrument; | ||
| sh:minCount 1 ; | ||
| sh:message "`CreateAction` MUST have the `instrument` property" ; | ||
| ] ; | ||
| sh:sparql [ | ||
| a sh:SPARQLConstraint ; | ||
| sh:name "instrument" ; | ||
| sh:name "WorkflowRunAction" ; | ||
| sh:prefixes ro-crate:sparqlPrefixes ; | ||
| sh:select """ | ||
| SELECT $this ?main ?instrument | ||
| WHERE { | ||
| ?root schema:mainEntity ?main . | ||
| $this schema:instrument ?instrument . | ||
| FILTER (?instrument != ?main) | ||
| } | ||
| SELECT $this | ||
| WHERE { | ||
| FILTER NOT EXISTS { | ||
| ?workflowRunAction a ro-crate:WorkflowRunAction . | ||
| } | ||
| } | ||
| """ ; | ||
| sh:message "`CreateAction` --> `instrument` MUST reference the same entity as `Root Data Entity` --> `mainEntity`" ; | ||
| ] ; | ||
| sh:message "The `CreateAction` entity corresponding to the workflow run MUST reference through its property `instrument` the same entity as `RootData Entity` --> `mainEntity`" ; | ||
|
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. Can we word this more clearly? Perhaps 'The |
||
| ] . | ||
|
|
||
|
|
||
| five-safes-crate:WorkflowRunObject | ||
| a sh:NodeShape ; | ||
| sh:name "WorkflowRunAction" ; | ||
| sh:targetClass ro-crate:WorkflowRunAction ; | ||
| sh:description "" ; | ||
| sh:severity sh:Violation ; # Apply to all property shapes / constraints below | ||
|
|
||
| sh:sparql [ | ||
| a sh:SPARQLConstraint ; | ||
| sh:prefixes ro-crate:sparqlPrefixes ; | ||
|
|
@@ -80,5 +81,5 @@ five-safes-crate:CreateActionInstrumentAndStatus | |
| FILTER NOT EXISTS { ?object a ?type . } | ||
| } | ||
| """ ; | ||
| sh:message "Each `object` in `CreateAction` MUST reference an existing entity." ; | ||
| ] . | ||
| sh:message "In the `CreateAction` entity corresponding to the workflow run, each `object` MUST reference an existing entity." ; | ||
| ] . | ||
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,37 @@ | ||
| # Copyright (c) 2024-2026 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 owl: <http://www.w3.org/2002/07/owl#> . | ||
| @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . | ||
| @prefix xml: <http://www.w3.org/XML/1998/namespace#> . | ||
| @prefix xsd: <http://www.w3.org/2001/XMLSchema#> . | ||
| @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . | ||
| @prefix schema: <http://schema.org/> . | ||
| @prefix rocrate: <https://w3id.org/ro/crate/1.1/> . | ||
| @prefix bioschemas: <https://bioschemas.org/> . | ||
| @prefix ro-crate: <https://github.com/crs4/rocrate-validator/profiles/ro-crate/> . | ||
| @prefix isa-ro-crate: <https://github.com/crs4/rocrate-validator/profiles/isa-ro-crate/> . | ||
|
|
||
| <urn:absolute:.> rdf:type owl:Ontology ; | ||
| owl:versionIRI <urn:absolute:1.0> . | ||
|
|
||
| # # ################################################################# | ||
| # # # Classes | ||
| # # ################################################################# | ||
|
|
||
| # Declare a WorkflowRunAction class | ||
| ro-crate:WorkflowRunAction rdf:type owl:Class ; | ||
| rdfs:subClassOf schema:CreateAction ; | ||
| rdfs:label "WorkflowRunAction"@en . |
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
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
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
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.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this test (
five-safes-crate:RootDataEntityMentionsWorkflowRunAction) replicated by the testfive-safes-crate:RootDataEntityShouldMentionWorkflowin the fileshould/11_workflow_execution_phase.ttl?Can you check, and see if they are the same test, and if so then decide if we should keep the MUST or the SHOULD version?