Skip to content

Commit

Permalink
provrc: tool action resourceusage
Browse files Browse the repository at this point in the history
  • Loading branch information
simleo committed Oct 22, 2024
1 parent 6d6925f commit ec81c0f
Show file tree
Hide file tree
Showing 7 changed files with 1,622 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# Copyright (c) 2024 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 provenance-run-crate: <https://github.com/crs4/rocrate-validator/profiles/provenance-run-crate/> .
@prefix schema: <http://schema.org/> .
@prefix bioschemas: <https://bioschemas.org/> .
@prefix sh: <http://www.w3.org/ns/shacl#> .
@prefix wfrun: <https://w3id.org/ro/terms/workflow-run#> .

provenance-run-crate:ProvRCToolActionOptional a sh:NodeShape ;
sh:name "Provenance Run Crate tool action MAY" ;
sh:description "Optional properties of a Provenance Run Crate action that represents a tool execution" ;
sh:target [
a sh:SPARQLTarget ;
sh:prefixes ro-crate:sparqlPrefixes ;
sh:select """
SELECT ?this
WHERE {
{ ?this a schema:CreateAction } UNION
{ ?this a schema:ActivateAction } UNION
{ ?this a schema:UpdateAction } .
?this schema:instrument ?tool .
{ ?tool a schema:SoftwareApplication } UNION
{ ?tool a schema:SoftwareSourceCode } UNION
{ ?tool a bioschemas:ComputationalWorkflow } .
?workflow schema:hasPart ?tool .
?workflow a bioschemas:ComputationalWorkflow .
}
"""
] ;
sh:property [
a sh:PropertyShape ;
sh:name "Tool action resourceUsage" ;
sh:description "A tool action MAY have a resourceUsage" ;
sh:path wfrun:resourceUsage ;
sh:minCount 1 ;
sh:message "A tool action MAY have a resourceUsage" ;
] .
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# Copyright (c) 2024 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 provenance-run-crate: <https://github.com/crs4/rocrate-validator/profiles/provenance-run-crate/> .
@prefix schema: <http://schema.org/> .
@prefix bioschemas: <https://bioschemas.org/> .
@prefix sh: <http://www.w3.org/ns/shacl#> .
@prefix wfrun: <https://w3id.org/ro/terms/workflow-run#> .

provenance-run-crate:ProvRCToolActionRequired a sh:NodeShape ;
sh:name "Provenance Run Crate tool action MUST" ;
sh:description "Required properties of a Provenance Run Crate action that represents a tool execution" ;
sh:target [
a sh:SPARQLTarget ;
sh:prefixes ro-crate:sparqlPrefixes ;
sh:select """
SELECT ?this
WHERE {
{ ?this a schema:CreateAction } UNION
{ ?this a schema:ActivateAction } UNION
{ ?this a schema:UpdateAction } .
?this schema:instrument ?tool .
{ ?tool a schema:SoftwareApplication } UNION
{ ?tool a schema:SoftwareSourceCode } UNION
{ ?tool a bioschemas:ComputationalWorkflow } .
?workflow schema:hasPart ?tool .
?workflow a bioschemas:ComputationalWorkflow .
}
"""
] ;
sh:property [
a sh:PropertyShape ;
sh:name "Tool action resourceUsage" ;
sh:description "If present, resourceUsage MUST point to PropertyValue" ;
sh:path wfrun:resourceUsage ;
sh:class schema:PropertyValue ;
sh:message "If present, resourceUsage MUST point to PropertyValue" ;
] .
Loading

0 comments on commit ec81c0f

Please sign in to comment.