Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
b23eb46
feat(model): :sparkles: add method to identity dataset and file entities
kikkomep Oct 24, 2025
d3ce1b1
feat(utils): :sparkles: allow to use strings as URIs
kikkomep Oct 26, 2025
ffef193
refactor(model): :art: fix missing whitespaces
kikkomep Oct 26, 2025
45a5c49
refactor(model): :recycle: refactor entity availability check with ge…
kikkomep Oct 26, 2025
955b153
feat(model): :sparkles: add support for relative root path
kikkomep Oct 26, 2025
6ed5061
feat(model): :sparkles: always parse the path before processing it
kikkomep Oct 26, 2025
639e091
fix(model): :bug: catch exceptions when destroying a Zip RO-Crate
kikkomep Oct 26, 2025
da31734
feat(model): :bug: detect and notify access to nonexistent files
kikkomep Oct 26, 2025
bd8f6ad
refactor(model): :recycle: improve file and directory availability ch…
kikkomep Oct 26, 2025
c19a9ca
feat(model): :sparkles: add classes for handling BagIt-wrapped RO-Crates
kikkomep Oct 26, 2025
ce7a0cc
feat(model): :sparkles: add factory method to automatically instantia…
kikkomep Oct 26, 2025
9515006
fix(model): :bug: fix missing import
kikkomep Oct 26, 2025
eea7171
chore(model): :rotating_light: fix missing blank line
kikkomep Oct 26, 2025
c0da552
test(test-data): :white_check_mark: add test data: BagIt folder and B…
kikkomep Oct 26, 2025
cdcbcba
test(tests): :white_check_mark: test validation of Bagit RO-Crates
kikkomep Oct 26, 2025
ba18154
test(tests): :white_check_mark: add unit tests
kikkomep Oct 26, 2025
0eb5a2a
fix(tests): :rotating_light: fix linter warning E501
kikkomep Oct 27, 2025
3c656f3
fix(model): :rotating_light: fix linter warning E999
kikkomep Oct 27, 2025
85113c2
fix(model): :rotating_light: fix linter warnings W{2,3}91
kikkomep Oct 27, 2025
7cf1f94
fix(model): :bug: fix initialisation of Bagit objects
kikkomep Oct 27, 2025
d986a99
fix(model): :bug: fix fallback value for root path
kikkomep Oct 27, 2025
51355d0
feat(model): :bug: fix initialisation of BagitROCrate objects
kikkomep Oct 27, 2025
bd6e563
fix(model): :bug: use the custom class for remote Bagit RO-Crate objects
kikkomep Oct 27, 2025
3003004
test(model): :white_check_mark: test remote Bagit RO-Crates
kikkomep Oct 27, 2025
fa342dd
fix(model): :ambulance: fix availability check of external resources
kikkomep Oct 27, 2025
c87dc10
test(model): :white_check_mark: extend unti test
kikkomep Oct 27, 2025
3e8999e
test(utils): :bug: correct parsing of RO-Crate URI input
kikkomep Oct 27, 2025
3429335
test(tests): :white_check_mark: add integration test for remote RO-Crate
kikkomep Oct 27, 2025
4f51dc8
test(tests): :bug: fix RO-Crate path
kikkomep Oct 27, 2025
546e484
test(test-data): :white_check_mark: fix and extend test data
kikkomep Oct 28, 2025
efd32b1
refactor(model): :recycle: restructure utility methods
kikkomep Oct 28, 2025
124f930
chore(model): :art: reformat code
kikkomep Oct 28, 2025
71e7ab4
refactor(model): :art: refactor parse_path methods
kikkomep Oct 28, 2025
6447b34
refactor(model): :art: reformat code
kikkomep Oct 28, 2025
f4ef402
feat(cli): :sparkles: add support for relative root path option
kikkomep Oct 28, 2025
934510a
test(test-conf): :sparkles: extend base RO-Crate test method to suppo…
kikkomep Oct 28, 2025
58d4941
test(test-conf): :bug: fix crate path
kikkomep Oct 28, 2025
4be8ed0
test(model): :white_check_mark: fix and extend unit tests
kikkomep Oct 28, 2025
95b11da
test(model): :white_check_mark: test RO-Crate with relative root path
kikkomep Oct 28, 2025
caeea8e
refactor(cli): :art: reformat
kikkomep Oct 28, 2025
cc01205
fix(model): :rotating_light: fix E713
kikkomep Oct 28, 2025
ff5baa3
refactor(model): :fire: clean up
kikkomep Oct 29, 2025
165de81
test: :bug: fix test data path
kikkomep Nov 21, 2025
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
11 changes: 10 additions & 1 deletion rocrate_validator/cli/commands/validate.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,13 @@ def get_single_char(console: Optional[Console] = None, end: str = "\n",

@cli.command("validate")
@click.argument("rocrate-uri", callback=validate_uri, default=".")
@click.option(
'-rr',
'--relative-root-path',
help="Use root-relative paths for all file references in the RO-Crate",
default=None,
show_default=True
)
@click.option(
'-ff',
'--fail-fast',
Expand Down Expand Up @@ -269,6 +276,7 @@ def validate(ctx,
requirement_severity_only: bool = False,
skip_checks: list[str] = None,
rocrate_uri: Path = ".",
relative_root_path: Optional[Path] = None,
fail_fast: bool = False,
no_paging: bool = False,
verbose: bool = False,
Expand Down Expand Up @@ -330,6 +338,7 @@ def validate(ctx,
"requirement_severity_only": requirement_severity_only,
"enable_profile_inheritance": not disable_profile_inheritance,
"rocrate_uri": rocrate_uri,
"rocrate_relative_root_path": relative_root_path,
"abort_on_first": fail_fast,
"skip_checks": skip_checks_list
}
Expand Down Expand Up @@ -838,7 +847,7 @@ def show_validation_details(self, pager: Pager, enable_pager: bool = True):
Padding("\n[bold]The following requirements have not meet: [/bold]", (0, 2)), style="white")
for requirement in sorted(result.failed_requirements, key=lambda x: x.identifier):
console.print(
Align(f"\n[profile: [magenta bold]{requirement.profile.name }[/magenta bold]]", align="right")
Align(f"\n[profile: [magenta bold]{requirement.profile.name}[/magenta bold]]", align="right")
)
console.print(
Padding(
Expand Down
11 changes: 7 additions & 4 deletions rocrate_validator/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -1573,10 +1573,10 @@ def get_failed_checks_by_requirement_and_severity(
and check.severity == severity]

def __str__(self) -> str:
return f"Validation result: passed={len(self.failed_checks)==0}, {len(self._issues)} issues"
return f"Validation result: passed={len(self.failed_checks) == 0}, {len(self._issues)} issues"

def __repr__(self):
return f"ValidationResult(passed={len(self.failed_checks)==0},issues={self._issues})"
return f"ValidationResult(passed={len(self.failed_checks) == 0},issues={self._issues})"

def __eq__(self, other: object) -> bool:
if not isinstance(other, ValidationResult):
Expand Down Expand Up @@ -1641,6 +1641,8 @@ class ValidationSettings:
"""
#: The URI of the RO-Crate
rocrate_uri: URI
#: The relative root path of the RO-Crate
rocrate_relative_root_path: Optional[Path] = None
# Profile settings
#: The path to the profiles
profiles_path: Path = DEFAULT_PROFILES_PATH
Expand Down Expand Up @@ -1824,7 +1826,7 @@ def __str__(self) -> str:

def __repr__(self) -> str:
return f"RequirementCheckValidationEvent(event_type={self.event_type}, " \
f"requirement_check={self.requirement_check})"
f"requirement_check={self.requirement_check})"

def __eq__(self, other: object) -> bool:
if not isinstance(other, RequirementCheckValidationEvent):
Expand Down Expand Up @@ -1993,7 +1995,8 @@ def __init__(self, validator: Validator, settings: ValidationSettings):
self._properties = {}

# initialize the ROCrate object
self._rocrate = ROCrate.new_instance(settings.rocrate_uri)
self._rocrate = ROCrate.new_instance(settings.rocrate_uri,
relative_root_path=settings.rocrate_relative_root_path)
assert isinstance(self._rocrate, ROCrate), "Invalid RO-Crate instance"

@property
Expand Down
Loading