Skip to content

Commit 2a06fb0

Browse files
committed
Add test_quality tool implementing OQuaRE ontology quality evaluation
Implement the OQuaRE framework (based on ISO/IEC 25000 SQuaRE) as a new MCP tool and CLI command. Uses whelk-rs for native OWL EL reasoning to compute inferred class hierarchy, matching the behavior of the Java reference implementation. The tool computes 19 metrics, scales them to 1-5, aggregates into 22 subcharacteristics, 7 quality characteristics, and an overall OQuaRE score.
1 parent 864bbcc commit 2a06fb0

7 files changed

Lines changed: 1299 additions & 2 deletions

File tree

Cargo.lock

Lines changed: 135 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ rust-mcp-sdk = { version = "0.8", default-features = false, features = [
2222
"sse",
2323
] }
2424
horned-owl = "1.4"
25+
whelk = { git = "https://github.com/INCATools/whelk-rs" }
2526
curie = "0.1"
2627
tokio = { version = "1", features = ["full"] }
2728
serde = { version = "1", features = ["derive"] }

src/cli.rs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,13 @@ pub enum CliCommand {
122122
version_iri: Option<String>,
123123
},
124124

125+
/// Evaluate ontology quality using the OQuaRE framework
126+
TestQuality {
127+
/// Absolute path to the OWL file
128+
#[arg(long)]
129+
file: String,
130+
},
131+
125132
/// Scan an OWL ontology for common modeling pitfalls
126133
TestPitfalls {
127134
/// Absolute path to the OWL file
@@ -259,6 +266,15 @@ pub async fn dispatch(cmd: CliCommand, manager: Manager) {
259266
)
260267
.await
261268
}
269+
CliCommand::TestQuality { file } => {
270+
tools::TestQuality::run_tool(
271+
tools::TestQuality {
272+
owl_file_path: file,
273+
},
274+
&manager,
275+
)
276+
.await
277+
}
262278
CliCommand::TestPitfalls { file, pitfalls } => {
263279
tools::TestPitfalls::run_tool(
264280
tools::TestPitfalls {

src/handler.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ impl ServerHandler for OwlMcpHandler {
5959
OwlTools::OntologyMetadata(p) => OntologyMetadata::run_tool(p, mgr).await,
6060
OwlTools::GetLabelsForIri(p) => GetLabelsForIri::run_tool(p, mgr).await,
6161
OwlTools::SetOntologyIri(p) => SetOntologyIri::run_tool(p, mgr).await,
62+
OwlTools::TestQuality(p) => TestQuality::run_tool(p, mgr).await,
6263
OwlTools::TestPitfalls(p) => TestPitfalls::run_tool(p, mgr).await,
6364
}
6465
}

src/main.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ mod cli;
22
mod handler;
33
mod ontology;
44
mod pitfalls;
5+
mod quality;
56
mod tools;
67

78
use std::sync::Arc;

0 commit comments

Comments
 (0)