-
Notifications
You must be signed in to change notification settings - Fork 6
WIP: ShEx validation method #17
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
Draft
stain
wants to merge
32
commits into
main
Choose a base branch
from
shex
base: main
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.
Draft
Changes from 22 commits
Commits
Show all changes
32 commits
Select commit
Hold shift + click to select a range
bcef301
a preliminary ShEx profile for Process Run Crate
stain 1e7a79a
Example from https://w3id.org/ro/wfrun/process/0.1
stain 495a6ac
PySheX dependencies
stain 089adc2
test command
stain 59fe1d5
process-crate-0.1
stain 820cf1b
correct command line
stain 0a443cf
newer PyShEx
stain 4a0004e
basic RO-Crate validation
stain d8d9903
Avoid EXTRA
stain 8fe5b37
more validation of RDF
stain 40508d8
Making shex into package info
stain 7d92a6a
now validating!
stain 631ad12
ignore stuff from pip install --editable .
stain f293e0d
attempt to shape workflow crate profile
stain 4176e6b
programmingLanguage does not seem to require contextual entity
stain 52f5772
workflow-run-crate draft
stain 3940a93
Draft of Bioschemas profile (untested)
stain 443ebb2
namespaces
stain 6a0e6a8
Merge branch 'main' into shex
stain 4cdd9bb
correct import
stain cad4842
ignore tox output
stain de413fd
broken start of provenance profile
stain 51c9233
avoid recursion recursion
stain 9d0bf16
now hopefully valid shex
stain 5e527cf
example of using shacl severity in shex
stain c5eca5e
Avoid pytest import
stain 183aec0
Depend on v0.2.16-RC4 of runcrateValidator for now
stain 2f0c2f0
some bioschemas
stain 7b8dd3f
Merge branch 'shex' of github.com:ResearchObject/runcrate into shex
stain b7e70c7
Merge remote-tracking branch 'origin/main' into shex
stain 8445dd2
more shex
stain 670a653
Merge remote-tracking branch 'refs/remotes/origin/shex' into shex
stain 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,3 +2,9 @@ _site/ | |
| .sass-cache/ | ||
| .jekyll-cache/ | ||
| .jekyll-metadata | ||
| __pycache__ | ||
| build | ||
| *egg-info | ||
| .coverage | ||
| coverage.xml | ||
| dist | ||
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 |
|---|---|---|
| @@ -1,6 +1,7 @@ | ||
| graft docs | ||
| graft src | ||
|
|
||
| include *.shex | ||
| include *.rst | ||
| include LICENSE | ||
| include requirements.txt | ||
|
|
||
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
188 changes: 188 additions & 0 deletions
188
src/runcrate/shex/bioschemas-computationalworkflow-1.0.shex
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,188 @@ | ||
| # Copyright 2023 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. | ||
|
|
||
| ## ShEX shape for https://bioschemas.org/profiles/ComputationalWorkflow/1.0-RELEASE and | ||
| # https://bioschemas.org/profiles/FormalParameter/1.0-RELEASE | ||
| # following MUST requirements ("marginality: minimum"), with | ||
| # all SHOULD/COULD (recommended/optional) marked as optional (*/?) | ||
| # | ||
| # NOTE: As this shape is meant to be used with a workflow-crate, it assumes the | ||
| # workflow is mainEntity of an RO-Crate root, which is the start focus. That also | ||
| # means some contextual entities are assumed to be explicit with a @type and s:name | ||
| # rather than just a IRI. | ||
|
|
||
| ## FIXME: Update namespace | ||
| PREFIX p: <https://bioschemas.example.org/profiles/ComputationalWorkflow/1.0-RELEASE#> | ||
| PREFIX xsd: <http://www.w3.org/2001/XMLSchema#> | ||
| PREFIX s: <http://schema.org/> | ||
| PREFIX foaf: <http://xmlns.com/foaf/0.1/> | ||
| PREFIX dct: <http://purl.org/dc/terms/> | ||
| PREFIX bioschemas: <https://bioschemas.org/> | ||
|
|
||
| start = @p:Root | ||
|
|
||
| p:Root { | ||
| s:mainEntity @p:MainWorkflow; | ||
| } | ||
| p:MainWorkflow { | ||
| ## Marginality: Minimum | ||
|
|
||
| a [bioschemas:ComputationalWorkflow]; | ||
| dct:conformsTo [<https://bioschemas.org/profiles/ComputationalWorkflow/1.0-RELEASE>] | ||
| s:creator @sd:PersonOrOrg+; | ||
| # NOTE: We won't be picky about xsd type even if profile insists Date or DateTime | ||
| s:dateCreated Literal; | ||
|
|
||
| # NOTE: interpret profile liberally, in/out can be 0 if no input/output, otherwise required | ||
| s:input @p:FormalParameter*; | ||
| s:output @p:FormalParameter*; | ||
|
|
||
| ( s:licence LITERAL | | ||
| s:licence { | ||
| # Require contextual entity in RO-Crate | ||
| a [s:Creativework] | ||
| s:name LITERAL; | ||
| } | ||
| )+; | ||
| s:name LITERAL; | ||
|
|
||
| ( s:programmingLanguage Literal | | ||
| s:programmingLanguage { | ||
| # Require contextual entity in RO-Crate | ||
| a [s:ComputerLanguage]; | ||
| s:name LITERAL; | ||
| } | ||
| ); | ||
|
|
||
| s:sdPublisher @sd:PersonOrOrg; | ||
| ( # Depends on context | ||
| s:url IRI| | ||
| s:url xsd:string; | ||
| ); | ||
|
|
||
| s:version LITERAL; | ||
|
|
||
| ## Marginality: Recommended | ||
|
|
||
| ( s:citation LITERAL | | ||
| s:citation { | ||
| # FIXME: Won't detect subtypes like s:ScholarlyArticle without rdfs inferencing | ||
| a [s:CreativeWork]; | ||
| # s:name xsd:string | ||
| }; | ||
| )*; | ||
|
|
||
| s:contributor @sd:PersonOrOrg*; | ||
|
|
||
| ( s:creativeWorkStatus LITERAL | | ||
| s:creativeWorkStatus IRI; | ||
| )?; | ||
|
|
||
| ( s:documentation { | ||
| a [s:CreativeWork]; | ||
| } | | ||
| s:documentation IRI; | ||
| ); | ||
|
|
||
| s:funding { | ||
| a [s:Grant]; | ||
| }*; | ||
|
|
||
| s:hasPart { | ||
| # Extended types to include tools | ||
| ( a [s:CreativeWork] | | ||
| a [s:SoftwareApplication] | | ||
| a [s:SoftwareSourceCode] | ||
| ) ; | ||
| }*; | ||
|
|
||
| ( | ||
| s:isBasedOn { a [s:CreativeWork] } | | ||
| s:isBasedOn { a [s:Product] } | | ||
| s:isBasedOn IRI | ||
| )?; | ||
|
|
||
| s:keywords LITERAL?; | ||
|
|
||
| s:maintainer @sd:PersonOrOrg*; | ||
|
|
||
| s:producer @sd:PersonOrOrg*; | ||
|
|
||
| s:publisher @sd:PersonOrOrg*; | ||
|
|
||
| s:runtimePlatform LITERAL?; | ||
| ( | ||
| s:softwareRequirements LITERAL | | ||
| s:softwareRequirements IRI | ||
| )*; | ||
|
|
||
| s:targetProduct { | ||
| a [s:SoftwareApplication]; | ||
| }*; | ||
|
|
||
| ## Marginality: Optional | ||
|
|
||
| s:alternateName Literal*; | ||
| s:conditionsOfAccess Literal?; | ||
| # FIXME: ISO8601 regex pattern without forcing xsd:dateTime/xsd:date/xsd:timestamp etc. declaration | ||
| s:dateModified LITERAL?; | ||
| s:datePublished LITERAL?; | ||
|
|
||
| ( | ||
| s:encodingFormat LITERAL | | ||
| s:encodingFormat IRI | ||
| )?; | ||
|
|
||
| $p:identifier ( | ||
| s:identifier { | ||
| a [s:PropertyValue]; | ||
| } | | ||
| s:identifier xsd:string; | ||
| s:identifier IRI; | ||
| )*; | ||
|
|
||
| ( | ||
| s:image { | ||
| a [s:ImageObject]; | ||
| } | | ||
| s:image IRI; | ||
| )?; | ||
| } | ||
|
|
||
| p:PersonOrOrg { | ||
| # As we're in RO-Crate, the contextual entity is required | ||
| (a [s:Person] | | ||
| a [s:Organization] | ||
| ) | ||
| s:name LITERAL; | ||
| } | ||
|
|
||
| p:FormalParameter { | ||
| a [bioschemas:FormalParameter]; | ||
| dct:conformsTo [<>]; | ||
| s:name LITERAL; | ||
| s:additionalType IRI*; | ||
| s:description LITERAL?; | ||
| ( | ||
| s:encodingFormat LITERAL | | ||
| s:encodingFormat IRI; | ||
| )?; | ||
| ( | ||
| s:defaultValue Literal | | ||
| s:defaultValue IR | ||
| )?; | ||
| &identifier*; | ||
| s:valueRequired xsd:boolean?; | ||
| } | ||
|
|
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.