Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
rudof_cli
The command-line interface for the Rudof toolkit, that provides a comprehensive suite of tools for working with RDF data and schema languages. It enables users to inspect and validate RDF data using ShEx or SHACL, as well as convert between different RDF modeling languages such as ShEx, SHACL, and DCTAP.
Architecture and Package Structure
The rudof_cli crate is organized around a command pattern with the following layers:
1. CLI Layer (cli/)
Handles command-line argument parsing using Clap, defining the user interface and available commands.
-
parser.rs: Defines the complete CLI structure using Clap's derive macros, including all commands, subcommands, and their arguments. -
wrappers.rs: Provides CLI-friendly wrappers for core library types using a macro-based approach. This abstraction layer keeps the CLI parsing separate from the core library, allowing independent evolution of both.
2. Command Layer (commands/)
Implements each command using a unified trait-based approach defined in commands/base.rs:
-
base.rs: The foundation of the command system, containing three key components:-
Commandtrait: The core interface that all commands must implement. -
CommandContext: The shared execution environment. -
CommandFactory: A factory pattern implementation that maps CLI command variants to their correspondingCommandtrait objects, centralizing command instantiation logic.
-
-
Individual command modules (
shex.rs,shacl.rs,validate.rs, etc.): Each implements theCommandtrait to provide specific functionality.
3. Output Layer (output/)
Manages output formatting with automatic color support detection and configurable writers.
color.rs: Detects terminal color capabilitieswriter.rs: Creates appropriate output writers (stdout, files, etc.)
Command Lifecycle
The main.rs orchestrates the complete command lifecycle:
- Setup: Initialize logging with tracing, load environment variables, configure signal handling
- Parsing: Parse CLI arguments using Clap into structured
Commandenum - Factory: Use
CommandFactory::create()to instantiate the appropriate command - Context: Build
CommandContextwith configuration, output writers, and color support - Execution: Call
command.execute(&mut ctx)to run the command logic
Dependencies
Main Dependencies
The CLI relies on the following external crates:
clap: Command-line argument parsing with derive macrosclap_complete_command: Shell completion generationtokio: Async runtime for concurrent operationsanyhow/thiserror: Error handlingtracing/tracing-subscriber: Structured loggingtabled: Table formatting for outputsupports-color: Terminal color capability detectionclientele: CLI utility helpers