Skip to content

Commit a8c049e

Browse files
committed
release: 🔖 version 0.8.0
2 parents de8103e + d8b9d27 commit a8c049e

File tree

296 files changed

+8033
-2961
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

296 files changed

+8033
-2961
lines changed

.github/workflows/release.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
# Copyright (c) 2024-2026 CRS4
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
115
# This workflow is triggered on push to tags and runs the following steps:
216
# 1. Check and Build Distribution
317
# 2. Publish to TestPyPI

.github/workflows/testing.yaml

Lines changed: 26 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
# Copyright (c) 2024-2026 CRS4
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
115
name: 🧪 CI Pipeline 1 -- Testing
216

317
# Controls when the action will run. Triggers the workflow on push or pull request
@@ -22,11 +36,12 @@ env:
2236
TERM: xterm
2337
VENV_PATH: .venv
2438
PYTHON_VERSION: "3.11"
39+
FORCE_COLOR: "1" # Force color output in CI
2540

2641
jobs:
27-
# Verifies pep8, pyflakes and circular complexity
28-
flake8:
29-
name: 🚨 Lint Python Code
42+
# Verifies pep8, pyflakes, circular complexity, and spelling
43+
lint:
44+
name: 🚨 Lint and spellcheck
3045
runs-on: ubuntu-latest
3146
steps:
3247
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
@@ -38,14 +53,16 @@ jobs:
3853
python-version: ${{ env.PYTHON_VERSION }}
3954
- name: 🔽 Install flake8
4055
run: pip install flake8
41-
- name: Run checks
56+
- name: Lint Python code
4257
run: flake8 -v rocrate_validator tests
58+
- name: ⌛ Spell check code and profiles (covers Python and SHACL)
59+
uses: crate-ci/[email protected]
4360

4461
# Runs the tests
4562
test:
4663
name: ⌛ Run tests
4764
runs-on: ubuntu-latest
48-
needs: [flake8]
65+
needs: [lint]
4966
steps:
5067
- name: ⬇️ Checkout
5168
uses: actions/checkout@v4
@@ -65,3 +82,7 @@ jobs:
6582
run: poetry install --no-interaction --no-ansi
6683
- name: ⌛ Run tests
6784
run: poetry run pytest
85+
env:
86+
TERM: "dumb"
87+
LINES: "50"
88+
COLUMNS: "120"

.gitignore

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
# Copyright (c) 2024-2026 CRS4
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
115
.DS_Store
216
**/__pycache__
317
**/*.pyc
@@ -13,3 +27,7 @@ docs/_build
1327
**/.coverage
1428
**/.coverage.*
1529
**/.report
30+
31+
# ignore IDE files
32+
.vscode/
33+
.idea/

.gitlab-ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (c) 2024-2025 CRS4
1+
# Copyright (c) 2024-2026 CRS4
22
#
33
# Licensed under the Apache License, Version 2.0 (the "License");
44
# you may not use this file except in compliance with the License.

.readthedocs.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
# Copyright (c) 2024-2026 CRS4
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
115
# Read the Docs configuration file for Sphinx projects
216
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
317

CITATION.cff

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
cff-version: 1.2.0
2+
message: "If you use this software, please cite it using these metadata."
3+
title: "rocrate-validator"
4+
abstract: "A Python package to validate RO-Crates."
5+
type: software
6+
authors:
7+
- family-names: "Piras"
8+
given-names: "Marco Enrico"
9+
orcid: https://orcid.org/0000-0002-5207-0030
10+
- family-names: "Leo"
11+
given-names: "Simone"
12+
orcid: https://orcid.org/0000-0001-8271-5429
13+
- family-names: "Pireddu"
14+
given-names: "Luca"
15+
orcid: https://orcid.org/0000-0002-4663-5613
16+
- family-names: Chadwick
17+
given-names: Eli
18+
orcid: https://orcid.org/0000-0002-0035-6475
19+
- family-names: Bauer
20+
given-names: Daniel
21+
orcid: https://orcid.org/0000-0001-9447-460X
22+
repository-code: "https://github.com/crs4/rocrate-validator"
23+
url: "https://github.com/crs4/rocrate-validator"
24+
keywords:
25+
- "RO-Crate"
26+
- "validation"
27+
- "metadata"
28+
- "FAIR"
29+
license: "Apache-2.0"

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ report positive and negative feedback. We also welcome contributions, but we sug
3232

3333
## Installation
3434

35-
You can install the package using `pip` or `poetry`. The following instructions assume you have Python 3.8 or later installed.
35+
You can install the package using `pip` or `poetry`. The following instructions assume you have Python 3.9 or later installed.
3636

3737
#### [Optional Step: Create a Virtual Environment](#optional-step-create-a-virtual-environment)
3838

docs/0_toc.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
:maxdepth: 5
2727
:caption: Resources
2828

29+
12_validation_profiles
2930
11_writing_a_profile
3031
10_api
3132
genindex

docs/11_writing_a_profile.rst

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,25 @@ These instructions assume you are familiar with code development using Python an
6363
checks to write, you can create multiple files - the validator will
6464
collect them all automatically at runtime.
6565

66-
* Note: some profiles split the checks into folders called ``must/``,
66+
.. note::
67+
68+
Some profiles split the checks into folders called ``must/``,
6769
``should/`` and ``may/`` according to the requirement severity. This
6870
is not mandatory - you can also label individual checks/shapes with
6971
``sh:severity`` in the SHACL code instead.
7072

73+
#. Optionally, associate an ontology graph with the profile by providing
74+
an ``ontology.ttl`` file alongside the SHACL files.
75+
This graph is merged into the crate's data graph at validation time,
76+
allowing you to define formal relationships and additional definitions
77+
between profile entities (e.g., using ``rdfs:subClassOf``,
78+
``owl:equivalentClass``, etc.).
79+
80+
.. warning::
81+
82+
Including an ontology can significantly impact validation times and
83+
overall performance, especially for large graphs. Use with caution.
84+
7185
#. From the root folder of the repo, create a test folder for the profile
7286
under
7387
`tests/integration/profiles <https://github.com/crs4/rocrate-validator/tree/develop/tests/integration/profiles>`_. The name should match the folder you made earlier.
@@ -90,4 +104,6 @@ When running the validator manually, use ``--profile-identifier`` to select the
90104

91105
The crates in ``tests/data/crates``` can be used as examples for running the validator. For example: ::
92106

93-
rocrate-validator validate --profile-identifier your-profile-name tests/data/crates/invalid/1_wroc_crate/no_mainentity/
107+
rocrate-validator validate \
108+
--profile-identifier your-profile-name \
109+
tests/data/crates/invalid/1_wroc_crate/no_mainentity/

docs/12_validation_profiles.rst

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
Validation Profiles
2+
===================
3+
4+
The system comes with a set of **predefined validation profiles** that are loaded
5+
automatically when the application starts (see `supported profiles <../#features>`_).
6+
These profiles define the standard rules and checks that are applied during RO-Crate validation.
7+
8+
Additional Profiles
9+
-------------------
10+
11+
You can **extend or override** the predefined validation profiles by specifying
12+
the path to additional profiles using the ``--extra-profiles-path`` option on the command line.
13+
14+
CLI Usage
15+
^^^^^^^^^
16+
17+
.. code-block:: bash
18+
19+
rocrate-validator validate --extra-profiles-path /path/to/additional/profiles <other_options> <path_to_rocrate>
20+
21+
API Usage
22+
^^^^^^^^^^^^^
23+
24+
.. code-block:: python
25+
26+
# Import the `services` and `models` module from the rocrate_validator package
27+
from rocrate_validator import services, models
28+
29+
# Create an instance of `ValidationSettings` class to configure the validation
30+
settings = services.ValidationSettings(
31+
# ... value for other settings ...
32+
33+
# Define the path to additional validation profiles
34+
extra_profiles_path="/path/to/additional/profiles" # Path to additional validation profiles
35+
)
36+
37+
# Call the validation service with the settings
38+
result = services.validate(settings)
39+
40+
# process the validation result
41+
...
42+
43+
44+
Behavior
45+
^^^^^^^^
46+
47+
* Profiles provided via ``--extra-profiles-path`` are **loaded in addition to** the system’s predefined profiles.
48+
* If an additional profile has the **same name** as a predefined profile, the additional profile **overrides** the predefined one.
49+
50+
This mechanism allows you to:
51+
52+
* **Add new custom validation profiles** to implement project-specific checks.
53+
* **Modify existing profiles** without altering the system’s predefined configuration files.
54+
* **Maintain a clear separation** between standard validation logic and project-specific customizations.

0 commit comments

Comments
 (0)