-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
provrc: resourceusage propertyvalue propertyid and unitcode
- Loading branch information
Showing
7 changed files
with
1,604 additions
and
10 deletions.
There are no files selected for viewing
47 changes: 47 additions & 0 deletions
47
rocrate_validator/profiles/provenance-run-crate/must/7_propertyvalue.ttl
This file contains 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) 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:ProvRCRUPropertyValueRequired a sh:NodeShape ; | ||
sh:name "Provenance Run Crate resource usage PropertyValue MUST" ; | ||
sh:description "Required properties of a PropertyValue used to represent resource usage" ; | ||
sh:target [ | ||
a sh:SPARQLTarget ; | ||
sh:prefixes ro-crate:sparqlPrefixes ; | ||
sh:select """ | ||
SELECT ?this | ||
WHERE { | ||
?this a schema:PropertyValue . | ||
?action wfrun:resourceUsage ?this . | ||
{ ?action a schema:CreateAction } UNION | ||
{ ?action a schema:ActivateAction } UNION | ||
{ ?action a schema:UpdateAction } . | ||
} | ||
""" | ||
] ; | ||
sh:property [ | ||
a sh:PropertyShape ; | ||
sh:name "RU PropertyValue propertyID" ; | ||
sh:description "A PropertyValue used to represent resourceUsage MUST have a propertyID" ; | ||
sh:path schema:propertyID ; | ||
sh:minCount 1 ; | ||
sh:message "A PropertyValue used to represent resourceUsage MUST have a propertyID" ; | ||
] . |
47 changes: 47 additions & 0 deletions
47
rocrate_validator/profiles/provenance-run-crate/should/7_propertyvalue.ttl
This file contains 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) 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:ProvRCRUPropertyValueRecommended a sh:NodeShape ; | ||
sh:name "Provenance Run Crate resource usage PropertyValue SHOULD" ; | ||
sh:description "Recommended properties of a PropertyValue used to represent resource usage" ; | ||
sh:target [ | ||
a sh:SPARQLTarget ; | ||
sh:prefixes ro-crate:sparqlPrefixes ; | ||
sh:select """ | ||
SELECT ?this | ||
WHERE { | ||
?this a schema:PropertyValue . | ||
?action wfrun:resourceUsage ?this . | ||
{ ?action a schema:CreateAction } UNION | ||
{ ?action a schema:ActivateAction } UNION | ||
{ ?action a schema:UpdateAction } . | ||
} | ||
""" | ||
] ; | ||
sh:property [ | ||
a sh:PropertyShape ; | ||
sh:name "RU PropertyValue unitCode" ; | ||
sh:description "A PropertyValue used to represent resourceUsage SHOULD have a unitCode" ; | ||
sh:path schema:unitCode ; | ||
sh:minCount 1 ; | ||
sh:message "A PropertyValue used to represent resourceUsage SHOULD have a unitCode" ; | ||
] . |
Oops, something went wrong.