Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions .github/workflows/testing.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ env:
FORCE_COLOR: "1" # Force color output in CI

jobs:
# Verifies pep8, pyflakes and circular complexity
flake8:
name: 🚨 Lint Python Code
# Verifies pep8, pyflakes, circular complexity, and spelling
lint:
name: 🚨 Lint and spellcheck
runs-on: ubuntu-latest
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
Expand All @@ -39,14 +39,16 @@ jobs:
python-version: ${{ env.PYTHON_VERSION }}
- name: 🔽 Install flake8
run: pip install flake8
- name: ⌛ Run checks
- name: ⌛ Lint Python code
run: flake8 -v rocrate_validator tests
- name: ⌛ Spell check code and profiles (covers Python and SHACL)
uses: crate-ci/[email protected]

# Runs the tests
test:
name: ⌛ Run tests
runs-on: ubuntu-latest
needs: [flake8]
needs: [lint]
steps:
- name: ⬇️ Checkout
uses: actions/checkout@v4
Expand Down
2,329 changes: 1,125 additions & 1,204 deletions poetry.lock

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ requests = ">=2.32,<3.0"
requests-cache = ">=1.2,<2.0"
inquirerpy = ">=0.3.4,<0.4.0"
enum-tools = ">=0.12,<0.13"
typos = "^1.41.0"

[tool.poetry.group.dev.dependencies]
pyproject-flake8 = "^6.1.0"
Expand Down Expand Up @@ -105,3 +106,6 @@ skip_dirs = [".git", ".github", ".vscode"]

[tool.pytest.ini_options]
testpaths = ["tests"]

[tool.typos.files]
extend-exclude = ["tests/data","docs/diagrams","*.json","*.html","*__init__.py"]
4 changes: 2 additions & 2 deletions rocrate_validator/profiles/process-run-crate/profile.ttl
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
# it's in JSON-LD format
dct:format <https://w3id.org/mediatype/application/ld+json> ;

# it conforms to JSON-LD, here refered to by its namespace URI as a Profile
# it conforms to JSON-LD, here referred to by its namespace URI as a Profile
dct:conformsTo <https://www.w3.org/TR/json-ld11/> ;

# this profile resource plays the role of "Vocabulary"
Expand All @@ -62,7 +62,7 @@
# it's in HTML format
dct:format <https://w3id.org/mediatype/text/html> ;

# it conforms to HTML, here refered to by its namespace URI as a Profile
# it conforms to HTML, here referred to by its namespace URI as a Profile
dct:conformsTo <https://www.w3.org/TR/html/> ;

# this profile resource plays the role of "Specification"
Expand Down
4 changes: 2 additions & 2 deletions rocrate_validator/profiles/provenance-run-crate/profile.ttl
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
# it's in JSON-LD format
dct:format <https://w3id.org/mediatype/application/ld+json> ;

# it conforms to JSON-LD, here refered to by its namespace URI as a Profile
# it conforms to JSON-LD, here referred to by its namespace URI as a Profile
dct:conformsTo <https://www.w3.org/TR/json-ld11/> ;

# this profile resource plays the role of "Vocabulary"
Expand All @@ -63,7 +63,7 @@
# it's in HTML format
dct:format <https://w3id.org/mediatype/text/html> ;

# it conforms to HTML, here refered to by its namespace URI as a Profile
# it conforms to HTML, here referred to by its namespace URI as a Profile
dct:conformsTo <https://www.w3.org/TR/html/> ;

# this profile resource plays the role of "Specification"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ provenance-run-crate:ProvRCParameterConnectionReferencesRecommended a sh:NodeSha
sh:description "Recommended references for ParameterConnection entities" ;
sh:targetClass wfrun:ParameterConnection ;
sh:property [
sh:name "ParamenterConnection references" ;
sh:name "ParameterConnection references" ;
sh:description """References to `ParameterConnection` instances
SHOULD follow the CWL convention,
where connections to workflow output parameters are referenced by the workflow
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ ro-crate:FileDataEntityWebOptionalProperties a sh:NodeShape ;
for instance a landing page that describes the file, including persistence identifiers (e.g. DOI),
resolving to an intermediate HTML page instead of the downloadable file directly.
These can included for File Data Entities as additional metadata by using the properties:
`ìdentifier`, `url`, `subjectOf`and `mainEntityOfPage`""" ;
`identifier`, `url`, `subjectOf`and `mainEntityOfPage`""" ;
sh:targetClass ro-crate:File ;
# Check if the Web-based Data Entity has a contentSize property
sh:property [
Expand Down Expand Up @@ -87,4 +87,3 @@ ro-crate:DirectoryDataEntityWebOptionalDistribution a sh:NodeShape ;
sh:severity sh:Info ;
sh:message """The Directory Data Entity MAY have a `distribution` property to denote the distribution of the files within the directory""" ;
] .

Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ ro-crate:RootDataEntityRequiredProperties
] ;
sh:property [
a sh:PropertyShape ;
sh:name "Root Data Entity: `licence` property" ;
sh:name "Root Data Entity: `license` property" ;
sh:description """Check if the Root Data Entity includes a `license` property (as specified by schema.org)
to provide information about the license of the dataset.""" ;
sh:path schema_org:license;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
ro-crate:DataEntityRequiredProperties a sh:NodeShape ;
sh:name "Data Entity: REQUIRED properties" ;
sh:description """A Data Entity MUST be a `URI Path` relative to the ROCrate root,
or an sbsolute URI""" ;
or an absolute URI""" ;
sh:targetClass ro-crate:DataEntity ;

sh:property [
Expand Down Expand Up @@ -130,9 +130,9 @@ ro-crate:DirectoryDataEntity a sh:NodeShape ;
sh:severity sh:Violation ;
] .

ro-crate:DataEntityRquiredPropertiesShape a sh:NodeShape ;
ro-crate:DataEntityRequiredPropertiesShape a sh:NodeShape ;
sh:name "Data Entity: REQUIRED properties" ;
sh:description """A `DataEntity` MUST be linked, either directly or inderectly, from the Root Data Entity""" ;
sh:description """A `DataEntity` MUST be linked, either directly or indirectly, from the Root Data Entity""" ;
sh:targetClass ro-crate:DataEntity ;
sh:property
[
Expand All @@ -141,7 +141,7 @@ ro-crate:DataEntityRquiredPropertiesShape a sh:NodeShape ;
sh:node schema_org:Dataset ;
sh:minCount 1 ;
sh:name "Data Entity MUST be directly referenced" ;
sh:description """Check if the Data Entity is linked, either directly of inderectly, to the `Root Data Entity` using the `hasPart` (as defined in `schema.org`) property" """ ;
sh:description """Check if the Data Entity is linked, either directly or indirectly, to the `Root Data Entity` using the `hasPart` (as defined in `schema.org`) property" """ ;
# sh:message "A Data Entity MUST be directly or indirectly linked to the `Root Data Entity` through the `hasPart` property" ;
] .

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

ro-crate:FindLicenseEntity a sh:NodeShape, validator:HiddenShape ;
sh:name "Identify License Entity" ;
sh:description """Mark a license entity any Data Entity referenced by the `schema:licence` property.""" ;
sh:description """Mark a license entity any Data Entity referenced by the `schema:license` property.""" ;
sh:target [
a sh:SPARQLTarget ;
sh:prefixes ro-crate:sparqlPrefixes ;
Expand Down Expand Up @@ -68,7 +68,7 @@ ro-crate:WebSiteRecommendedProperties a sh:NodeShape ;

ro-crate:CreativeWorkAuthorDefinition a sh:NodeShape, validator:HiddenShape ;
sh:name "CreativeWork Author Definition" ;
sh:description """Define the `CretiveWorkAuthor` as the `Person` object of the `schema:author` predicate.""" ;
sh:description """Define the `CreativeWorkAuthor` as the `Person` object of the `schema:author` predicate.""" ;
sh:targetObjectsOf schema:author ;
sh:rule [
a sh:TripleRule ;
Expand All @@ -79,4 +79,3 @@ ro-crate:CreativeWorkAuthorDefinition a sh:NodeShape, validator:HiddenShape ;
sh:property [ sh:path rdf:type ; sh:hasValue schema:Person ; sh:minCount 1 ] ;
] ;
] .

4 changes: 2 additions & 2 deletions rocrate_validator/profiles/ro-crate/profile.ttl
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
# it's in JSON-LD format
dct:format <https://w3id.org/mediatype/application/ld+json> ;

# it conforms to JSON-LD, here refered to by its namespace URI as a Profile
# it conforms to JSON-LD, here referred to by its namespace URI as a Profile
dct:conformsTo <https://www.w3.org/TR/json-ld11/> ;

# this profile resource plays the role of "Vocabulary"
Expand All @@ -58,7 +58,7 @@
# it's in HTML format
dct:format <https://w3id.org/mediatype/text/html> ;

# it conforms to HTML, here refered to by its namespace URI as a Profile
# it conforms to HTML, here referred to by its namespace URI as a Profile
dct:conformsTo <https://www.w3.org/TR/html/> ;

# this profile resource plays the role of "Specification"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ ro-crate:RootDataEntityDirectRecommendedProperties a sh:NodeShape ;
sh:targetClass ro-crate:RootDataEntity ;
sh:property [
a sh:PropertyShape ;
sh:name "Root Data Entity: `licence` SHOULD link to a Contextual Entity" ;
sh:name "Root Data Entity: `license` SHOULD link to a Contextual Entity" ;
sh:description """Check if the Root Data Entity includes a `license` property
that links to a Contextual Entity with type `schema_org:CreativeWork` to describe the license.""" ;
sh:nodeKind sh:BlankNodeOrIRI ;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
@prefix sh: <http://www.w3.org/ns/shacl#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .

ro-crate:CreativeWorkAuthorMinimuRecommendedProperties a sh:NodeShape ;
ro-crate:CreativeWorkAuthorMinimumRecommendedProperties a sh:NodeShape ;
sh:name "CreativeWork Author: minimum RECOMMENDED properties" ;
sh:description """The minimum recommended properties for a `CreativeWork Author` are `name` and `affiliation`.""" ;
sh:targetClass ro-crate:CreativeWorkAuthor ;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
@prefix sh: <http://www.w3.org/ns/shacl#> .
@prefix validator: <https://github.com/crs4/rocrate-validator/> .

workflow-ro-crate:MainEntityProperyMustExist a sh:NodeShape ;
workflow-ro-crate:MainEntityPropertyMustExist a sh:NodeShape ;
sh:name "Main Workflow entity existence" ;
sh:description "The Main Workflow must be specified through a `mainEntity` property in the root data entity" ;
sh:targetClass ro-crate:RootDataEntity ;
Expand Down Expand Up @@ -63,13 +63,13 @@ workflow-ro-crate:MainWorkflowRequiredProperties a sh:NodeShape ;
sh:property [
a sh:PropertyShape ;
sh:name "Main Workflow type" ;
sh:description "The Main Workflow must have types File, SoftwareSourceCode, ComputationalWorfklow" ;
sh:description "The Main Workflow must have types File, SoftwareSourceCode, ComputationalWorkflow" ;
sh:path rdf:type ;
sh:hasValue schema:MediaObject ,
schema:SoftwareSourceCode ,
bioschemas:ComputationalWorkflow ;
sh:minCount 1 ;
sh:message "The Main Workflow must have types File, SoftwareSourceCode, ComputationalWorfklow" ;
sh:message "The Main Workflow must have types File, SoftwareSourceCode, ComputationalWorkflow" ;
] ;
sh:property [
a sh:PropertyShape ;
Expand Down
4 changes: 2 additions & 2 deletions rocrate_validator/profiles/workflow-ro-crate/profile.ttl
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
# it's in JSON-LD format
dct:format <https://w3id.org/mediatype/application/ld+json> ;

# it conforms to JSON-LD, here refered to by its namespace URI as a Profile
# it conforms to JSON-LD, here referred to by its namespace URI as a Profile
dct:conformsTo <https://www.w3.org/TR/json-ld11/> ;

# this profile resource plays the role of "Vocabulary"
Expand All @@ -62,7 +62,7 @@
# it's in HTML format
dct:format <https://w3id.org/mediatype/text/html> ;

# it conforms to HTML, here refered to by its namespace URI as a Profile
# it conforms to HTML, here referred to by its namespace URI as a Profile
dct:conformsTo <https://www.w3.org/TR/html/> ;

# this profile resource plays the role of "Specification"
Expand Down
4 changes: 2 additions & 2 deletions rocrate_validator/profiles/workflow-run-crate/profile.ttl
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
# it's in JSON-LD format
dct:format <https://w3id.org/mediatype/application/ld+json> ;

# it conforms to JSON-LD, here refered to by its namespace URI as a Profile
# it conforms to JSON-LD, here referred to by its namespace URI as a Profile
dct:conformsTo <https://www.w3.org/TR/json-ld11/> ;

# this profile resource plays the role of "Vocabulary"
Expand All @@ -63,7 +63,7 @@
# it's in HTML format
dct:format <https://w3id.org/mediatype/text/html> ;

# it conforms to HTML, here refered to by its namespace URI as a Profile
# it conforms to HTML, here referred to by its namespace URI as a Profile
dct:conformsTo <https://www.w3.org/TR/html/> ;

# this profile resource plays the role of "Specification"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
# it's in JSON-LD format
dct:format <https://w3id.org/mediatype/application/ld+json> ;

# it conforms to JSON-LD, here refered to by its namespace URI as a Profile
# it conforms to JSON-LD, here referred to by its namespace URI as a Profile
dct:conformsTo <https://www.w3.org/TR/json-ld11/> ;

# this profile resource plays the role of "Vocabulary"
Expand All @@ -61,7 +61,7 @@
# it's in HTML format
dct:format <https://w3id.org/mediatype/text/html> ;

# it conforms to HTML, here refered to by its namespace URI as a Profile
# it conforms to HTML, here referred to by its namespace URI as a Profile
dct:conformsTo <https://www.w3.org/TR/html/> ;

# this profile resource plays the role of "Specification"
Expand Down
2 changes: 1 addition & 1 deletion rocrate_validator/rocv_io/output/text/formatters.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def __rich_console__(self, console: Console, options: ConsoleOptions) -> RenderR

# Print validation details
# Print the list of failed requirements
yield Padding("\n[bold]The following requirements have not meet: [/bold]", (0, 2))
yield Padding("\n[bold]The following requirements have not been met: [/bold]", (0, 2))
for requirement in sorted(result.failed_requirements, key=lambda x: x.identifier):
yield Align(f"\n[profile: [magenta bold]{requirement.profile.name}[/magenta bold]]", align="right")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def test_main_workflow_bad_type():
Severity.REQUIRED,
False,
["Main Workflow definition"],
["The Main Workflow must have types File, SoftwareSourceCode, ComputationalWorfklow"],
["The Main Workflow must have types File, SoftwareSourceCode, ComputationalWorkflow"],
profile_identifier="workflow-ro-crate"
)

Expand Down