Skip to content

Plan, apply and roll back changes to a production ontology, with a blast radius report and a proof an auditor can re-check.

Closes #160: one graph per clash detector, and a twin that must stay clean (#244)

Fabio Rovai276b2fca5372
diff --git a/tests/clash_detector_coverage_test.rs b/tests/clash_detector_coverage_test.rs
new file mode 100644
index 00000000..eb4d2611
--- /dev/null
+++ b/tests/clash_detector_coverage_test.rs
@@ -0,0 +1,242 @@
+//! One graph per clash detector, and a near-miss twin for each that must stay clean.
+//!
+//! Issue #160: all 295 tracked RDF files sweep clean under the ten clash
+//! detectors, so the shipped corpus exercises the refutation producer **not at
+//! all**, and a single synthetic round-trip test was the only thing touching
+//! it. Ten more synthetic tests beside that one would leave the same hole:
+//! nothing would notice if a detector stopped firing on a shape it used to
+//! catch.
+//!
+//! So the fixtures live in `tests/fixtures/clash-coverage/`, one named for each
+//! detector, and this file asserts three things that together make a removed
+//! detector turn exactly one test red.
+//!
+//! **The list of detectors is read from the source, not typed here.**
+//! [`detectors_in_the_source`] scans the body of `find_clashes` in
+//! `src/reason.rs` for the rule names it constructs. An eleventh detector added
+//! without a fixture turns this file red on the day it lands, which a typed
+//! list of ten could never do.
+//!
+//! **Each fixture fires its own detector and no other.** Not "fires at least
+//! its own": the set of rules in `by_rule` must equal the singleton of the rule
+//! the file is named for. That makes the fixture-to-detector map injective, so
+//! removing one detector can only silence one fixture.
+//!
+//! **Each fixture ships with a twin that must come back clean.** A fixture that
+//! refutes proves nothing on its own, because a graph can be contradictory for
+//! a reason the fixture's author did not intend. `<rule>.clean.ttl` is the same
+//! graph with the one premise that closes the contradiction removed, and it
+//! must yield no clash at all. That is what makes each fixture evidence about
+//! the premise it was written for rather than about its vocabulary.
+//!
+//! These are TEST DATA and are excluded from the corpus, exactly as
+//! `tests/fixtures/horn-coverage/` is, for the reason that directory's README
+//! gives: a detector that earns its place on a file written to make it fire has
+//! earned nothing. [`the_fixtures_are_tracked_and_are_not_corpus`] is the guard
+//! that the exclusion is real rather than a stale path.
+
+mod common;
+
+use open_ontologies::graph::GraphStore;
+use open_ontologies::reason::{InferenceTarget, Reasoner};
+use std::collections::BTreeSet;
+use std::path::{Path, PathBuf};
+use std::sync::Arc;
+
+fn repo() -> PathBuf {
+ PathBuf::from(env!("CARGO_MANIFEST_DIR"))
+}
+
+fn fixture_dir() -> PathBuf {
+ repo().join("tests").join("fixtures").join("clash-coverage")
+}
+
+/// The rule names `find_clashes` actually constructs, read out of the source.
+///
+/// The scan is bounded to that one function: it starts at the signature and
+/// stops at the next item at column zero, so a `rule: "..."` literal anywhere
+/// else in the file cannot pad the list. If the scan ever returns an
+/// implausible number the caller fails rather than proceeding with a short
+/// list, because a source scan that silently matches nothing is a gate that
+/// cannot fail.
+fn detectors_in_the_source() -> BTreeSet<String> {
+ let src = std::fs::read_to_string(repo().join("src").join("reason.rs"))
+ .expect("read src/reason.rs");
+ let start = src.find("fn find_clashes(").expect(
+ "`fn find_clashes(` is gone from src/reason.rs. If it was renamed, this scan is \
+ reading nothing and every assertion below is vacuous",
+ );
+ let body = &src[start..];
+ // The next item at column zero ends the function.
+ let end = body[1..]
+ .find("\nfn ")
+ .or_else(|| body[1..].find("\npub fn "))
+ .map(|i| i + 1)
+ .unwrap_or(body.len());
+ let body = &body[..end];
+
+ let mut out = BTreeSet::new();
+ for (i, _) in body.match_indices("rule: \"") {
+ let rest = &body[i + "rule: \"".len()..];
+ if let Some(q) = rest.find('"') {
+ out.insert(rest[..q].to_string());
+ }
+ }
+ assert!(
+ out.len() >= 8,
+ "the scan of `find_clashes` found only {} rule names ({:?}). The construction \
+ spelling has changed and this file is now measuring nothing",
+ out.len(),
+ out
+ );
+ out
+}
+
+/// Reason over one fixture and return the set of clash rules that fired.
+///
+/// `owl-rl` because a clash needs the OWL vocabulary, and `materialize` is
+/// false so the fixture on disk is never written back into.
+fn rules_that_fire(path: &Path) -> BTreeSet<String> {
+ let store = Arc::new(GraphStore::new());
+ store
+ .load_file(&path.display().to_string())
+ .unwrap_or_else(|e| panic!("load {}: {e}", path.display()));
+ let out = Reasoner::run_full(&store, "owl-rl", false, InferenceTarget::DefaultGraph, None)
+ .unwrap_or_else(|e| panic!("reason over {}: {e}", path.display()));
+ let r: serde_json::Value = serde_json::from_str(&out).unwrap();
+ if r["inconsistency"]["found"] != serde_json::Value::Bool(true) {
+ return BTreeSet::new();
+ }
+ r["inconsistency"]["by_rule"]
+ .as_object()
+ .map(|m| m.keys().cloned().collect())
+ .unwrap_or_default()
+}
+
+#[test]
+fn every_detector_in_the_source_has_a_fixture_named_for_it() {
+ let detectors = detectors_in_the_source();
+ let mut missing = Vec::new();
+ for d in &detectors {
+ let f = fixture_dir().join(format!("{d}.ttl"));
+ if !f.exists() {
+ missing.push(f.display().to_string());
+ }
+ let twin = fixture_dir().join(format!("{d}.clean.ttl"));
+ if !twin.exists() {
+ missing.push(twin.display().to_string());
+ }
+ }
+ assert!(
+ missing.is_empty(),
+ "a clash detector exists in src/reason.rs with no fixture to exercise it. \
+ Write one graph that makes it fire and one twin that does not:\n {}",
+ missing.join("\n ")
+ );
+
+ // And the other direction: a fixture naming a detector that no longer
+ // exists is dead weight that reads as coverage.
+ let mut orphans = Vec::new();
+ for e in std::fs::read_dir(fixture_dir()).expect("read the fixture directory") {
+ let p = e.unwrap().path();
+ let Some(stem) = p.file_name().and_then(|s| s.to_str()) else { continue };
+ let Some(stem) = stem.strip_suffix(".ttl") else { continue };
+ let stem = stem.strip_suffix(".clean").unwrap_or(stem);
+ if !detectors.contains(stem) {
+ orphans.push(p.display().to_string());
+ }
+ }
+ assert!(
+ orphans.is_empty(),
+ "these fixtures are named for a rule `find_clashes` does not construct:\n {}",
+ orphans.join("\n ")
+ );
+ println!("{} detectors, each with a fixture: {detectors:?}", detectors.len());
+}
+
+#[test]
+fn each_fixture_fires_its_own_detector_and_no_other() {
+ let detectors = detectors_in_the_source();
+ let mut table = Vec::new();
+ for d in &detectors {
+ let fired = rules_that_fire(&fixture_dir().join(format!("{d}.ttl")));
+ let want: BTreeSet<String> = std::iter::once(d.clone()).collect();
+ assert_eq!(
+ fired, want,
+ "tests/fixtures/clash-coverage/{d}.ttl is supposed to fire {d} and nothing else. \
+ It fired {fired:?}. A fixture that trips a second detector makes the map from \
+ detectors to fixtures non-injective, and then removing a detector can be masked \
+ by another fixture still covering it"
+ );
+ table.push(d.clone());
+ }
+ println!("each of {} fixtures fires exactly its own rule: {table:?}", table.len());
+}
+
+#[test]
+fn each_twin_is_clean_so_the_fixture_is_evidence_about_its_premise() {
+ let detectors = detectors_in_the_source();
+ for d in &detectors {
+ let fired = rules_that_fire(&fixture_dir().join(format!("{d}.clean.ttl")));
+ assert!(
+ fired.is_empty(),
+ "tests/fixtures/clash-coverage/{d}.clean.ttl is the near miss and must not be \
+ refuted. It fired {fired:?}. Either the twin still carries the contradiction, \
+ in which case {d}.ttl is not evidence about the premise it removed, or a \
+ detector fires on the vocabulary alone"
+ );
+ }
+ println!("all {} twins are clean", detectors.len());
+}
+
+/// The exclusion is real, in the pattern `tests/fixtures/horn-coverage/` set.
+///
+/// These graphs were written to make a detector fire. Counted as corpus they
+/// would turn "the shipped corpus sweeps clean under the ten detectors" from a
+/// measurement into a statement about this directory.
+#[test]
+fn the_fixtures_are_tracked_and_are_not_corpus() {
+ const PREFIX: &str = "tests/fixtures/clash-coverage/";
+ let out = std::process::Command::new("git")
+ .args(["ls-files", "-z", "*.ttl"])
+ .current_dir(repo())
+ .output()
+ .expect("run git ls-files");
+ assert!(out.status.success(), "git ls-files failed");
+ let tracked: Vec<String> = String::from_utf8_lossy(&out.stdout)
+ .split('\0')
+ .filter(|p| !p.is_empty())
+ .map(|p| p.to_string())
+ .collect();
+ let here = tracked.iter().filter(|p| p.starts_with(PREFIX)).count();
+ assert!(
+ here >= 2 * detectors_in_the_source().len(),
+ "expected a fixture and a twin per detector tracked under {PREFIX}, found {here}. \
+ Untracked fixtures are invisible to every corpus sweep, including the ones that \
+ are supposed to exclude them"
+ );
+
+ // Every corpus walker must exclude them. The walkers enumerate from
+ // `git ls-files`, so an exclusion is a string in the walker's source; a
+ // walker that gained a corpus sweep without gaining the exclusion is the
+ // failure this checks for.
+ let walkers = [
+ "tests/projection_monotonicity_corpus_test.rs",
+ "tests/reason_rl_coverage_test.rs",
+ "tests/lean_certificate_test.rs",
+ ];
+ let mut blind = Vec::new();
+ for w in walkers {
+ let src = std::fs::read_to_string(repo().join(w)).unwrap_or_default();
+ if !src.contains(PREFIX) {
+ blind.push(w);
+ }
+ }
+ assert!(
+ blind.is_empty(),
+ "these corpus sweeps enumerate tracked RDF and do not exclude {PREFIX}, so graphs \
+ written to be contradictory are being swept as if they were real ontologies:\n {}",
+ blind.join("\n ")
+ );
+ println!("{here} fixture files tracked and excluded from {} sweeps", walkers.len());
+}
diff --git a/tests/fixtures/clash-coverage/README.md b/tests/fixtures/clash-coverage/README.md
new file mode 100644
index 00000000..13583b02
--- /dev/null
+++ b/tests/fixtures/clash-coverage/README.md
@@ -0,0 +1,60 @@
+# One graph per clash detector, and a near-miss twin for each
+
+`Reasoner::run_full` looks for a contradiction in the closure it reaches. Ten rules of
+OWL 2 RL are looked for; the rest are listed in `reason::CLASH_RULES_NOT_DETECTED` and
+are not. On 15 September 2026 all 295 RDF files this repository tracks swept **clean**
+under all ten, so the shipped corpus exercised the refutation producer not at all, and a
+single synthetic round-trip test was the only thing that touched it. That is issue #160.
+
+This directory holds two Turtle files per detector:
+
+* `<rule>.ttl` is the smallest graph that makes exactly that detector fire.
+* `<rule>.clean.ttl` is the same graph with the one premise that closes the
+ contradiction removed, and it must yield no clash at all.
+
+The twin is the half that makes the fixture mean something. A graph that is refuted
+proves only that it is contradictory, not that it is contradictory **for the reason its
+author intended**, and a detector that fired on the vocabulary alone would look identical
+from the outside. Removing one premise and getting a clean answer is what separates those
+two cases.
+
+Each file carries the W3C rule at the top, in the Profiles document's own notation, so a
+reader can check the fixture against the standard without leaving the file.
+
+## These are TEST DATA and are not part of the corpus
+
+They were written to make a detector fire. Swept as corpus they would turn "the shipped
+corpus sweeps clean under the ten detectors" from a measurement into a statement about
+this directory, which is measuring the ruler. So three corpus walkers exclude this
+prefix, in the pattern `tests/fixtures/horn-coverage/` set:
+
+ tests/projection_monotonicity_corpus_test.rs
+ tests/reason_rl_coverage_test.rs
+ tests/lean_certificate_test.rs
+
+`the_fixtures_are_tracked_and_are_not_corpus` in `tests/clash_detector_coverage_test.rs`
+asserts that each of those three still names the prefix, because an exclusion that has
+silently gone stale is worse than none: the sweep would report contradictory fixtures as
+if they were real ontologies.
+
+## What makes this coverage rather than ten more synthetic tests
+
+Adding ten tests beside the one the issue complains about would leave the same hole:
+nothing would notice if a detector stopped firing on a shape it used to catch. So the
+list of detectors is **read out of `find_clashes` in `src/reason.rs`** rather than typed
+in the test, and the acceptance criterion is that removing a detector turns exactly one
+test red. Both ways of removing one were run before this landed:
+
+| what was done to `cls-com` | what went red |
+| ---------------------------------------- | ------------------------------------------------------ |
+| its guard broken so it never fires | `each_fixture_fires_its_own_detector_and_no_other`, naming `cls-com.ttl` |
+| the detector deleted from the source | `every_detector_in_the_source_has_a_fixture_named_for_it`, as an orphaned fixture |
+
+In both cases the other three tests stayed green, which is what "exactly one" means.
+
+## Adding one
+
+Name the file after the rule exactly as `find_clashes` constructs it (`<rule>.ttl`), add
+`<rule>.clean.ttl` beside it, and put the W3C rule text in the header comment. The test
+discovers both by name; there is no list to update. A detector added without a fixture
+turns `every_detector_in_the_source_has_a_fixture_named_for_it` red on the day it lands.
diff --git a/tests/fixtures/clash-coverage/cax-dw.clean.ttl b/tests/fixtures/clash-coverage/cax-dw.clean.ttl
new file mode 100644
index 00000000..f73499ec
--- /dev/null
+++ b/tests/fixtures/clash-coverage/cax-dw.clean.ttl
@@ -0,0 +1,9 @@
+# The same graph with the second class assertion removed. The disjointness
+# axiom is still here; nothing is in both classes.
+@prefix : <http://ex.org/clash#> .
+@prefix owl: <http://www.w3.org/2002/07/owl#> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+
+:Herbivore owl:disjointWith :Carnivore .
+:leo a :Herbivore .
diff --git a/tests/fixtures/clash-coverage/cax-dw.ttl b/tests/fixtures/clash-coverage/cax-dw.ttl
new file mode 100644
index 00000000..35f932b3
--- /dev/null
+++ b/tests/fixtures/clash-coverage/cax-dw.ttl
@@ -0,0 +1,9 @@
+# cax-dw T(?c1, owl:disjointWith, ?c2) T(?x, rdf:type, ?c1) T(?x, rdf:type, ?c2) -> false
+# One individual in two classes an axiom says share no member.
+@prefix : <http://ex.org/clash#> .
+@prefix owl: <http://www.w3.org/2002/07/owl#> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+
+:Herbivore owl:disjointWith :Carnivore .
+:leo a :Herbivore , :Carnivore .
diff --git a/tests/fixtures/clash-coverage/cls-com.clean.ttl b/tests/fixtures/clash-coverage/cls-com.clean.ttl
new file mode 100644
index 00000000..76280d7b
--- /dev/null
+++ b/tests/fixtures/clash-coverage/cls-com.clean.ttl
@@ -0,0 +1,8 @@
+# The complement axiom with one class assertion.
+@prefix : <http://ex.org/clash#> .
+@prefix owl: <http://www.w3.org/2002/07/owl#> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+
+:Mortal owl:complementOf :Immortal .
+:leo a :Mortal .
diff --git a/tests/fixtures/clash-coverage/cls-com.ttl b/tests/fixtures/clash-coverage/cls-com.ttl
new file mode 100644
index 00000000..28eb68ed
--- /dev/null
+++ b/tests/fixtures/clash-coverage/cls-com.ttl
@@ -0,0 +1,10 @@
+# cls-com T(?c1, owl:complementOf, ?c2) T(?x, rdf:type, ?c1) T(?x, rdf:type, ?c2) -> false
+# The same shape as cax-dw over complement rather than disjointness. A separate
+# detector because no rule in the profile turns one vocabulary into the other.
+@prefix : <http://ex.org/clash#> .
+@prefix owl: <http://www.w3.org/2002/07/owl#> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+
+:Mortal owl:complementOf :Immortal .
+:leo a :Mortal , :Immortal .
diff --git a/tests/fixtures/clash-coverage/cls-maxc1.clean.ttl b/tests/fixtures/clash-coverage/cls-maxc1.clean.ttl
new file mode 100644
index 00000000..8e20f539
--- /dev/null
+++ b/tests/fixtures/clash-coverage/cls-maxc1.clean.ttl
@@ -0,0 +1,10 @@
+# The same restriction on an individual that has no value of the property.
+@prefix : <http://ex.org/clash#> .
+@prefix owl: <http://www.w3.org/2002/07/owl#> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+
+:NoChildren a owl:Restriction ;
+ owl:onProperty :parentOf ;
+ owl:maxCardinality "0"^^xsd:nonNegativeInteger .
+:bob a :NoChildren .
diff --git a/tests/fixtures/clash-coverage/cls-maxc1.ttl b/tests/fixtures/clash-coverage/cls-maxc1.ttl
new file mode 100644
index 00000000..07752d75
--- /dev/null
+++ b/tests/fixtures/clash-coverage/cls-maxc1.ttl
@@ -0,0 +1,13 @@
+# cls-maxc1 T(?x, owl:maxCardinality, "0"^^xsd:nonNegativeInteger)
+# T(?x, owl:onProperty, ?p) T(?u, rdf:type, ?x) T(?u, ?p, ?y) -> false
+# A restriction admitting no value of the property, on an individual that has one.
+@prefix : <http://ex.org/clash#> .
+@prefix owl: <http://www.w3.org/2002/07/owl#> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+
+:NoChildren a owl:Restriction ;
+ owl:onProperty :parentOf ;
+ owl:maxCardinality "0"^^xsd:nonNegativeInteger .
+:bob a :NoChildren ;
+ :parentOf :carol .
diff --git a/tests/fixtures/clash-coverage/cls-nothing2.clean.ttl b/tests/fixtures/clash-coverage/cls-nothing2.clean.ttl
new file mode 100644
index 00000000..d188eb0b
--- /dev/null
+++ b/tests/fixtures/clash-coverage/cls-nothing2.clean.ttl
@@ -0,0 +1,8 @@
+# The clash above is a single triple, so the twin cannot drop a premise and stay
+# the same graph. It types the same individual with an ordinary class instead.
+@prefix : <http://ex.org/clash#> .
+@prefix owl: <http://www.w3.org/2002/07/owl#> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+
+:ghost a :Apparition .
diff --git a/tests/fixtures/clash-coverage/cls-nothing2.ttl b/tests/fixtures/clash-coverage/cls-nothing2.ttl
new file mode 100644
index 00000000..25bdee9b
--- /dev/null
+++ b/tests/fixtures/clash-coverage/cls-nothing2.ttl
@@ -0,0 +1,9 @@
+# cls-nothing2 T(?x, rdf:type, owl:Nothing) -> false
+# The whole contradiction is one asserted triple: owl:Nothing has no members by
+# definition, so anything typed with it is a contradiction on its own.
+@prefix : <http://ex.org/clash#> .
+@prefix owl: <http://www.w3.org/2002/07/owl#> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+
+:ghost a owl:Nothing .
diff --git a/tests/fixtures/clash-coverage/eq-diff1.clean.ttl b/tests/fixtures/clash-coverage/eq-diff1.clean.ttl
new file mode 100644
index 00000000..04cbd013
--- /dev/null
+++ b/tests/fixtures/clash-coverage/eq-diff1.clean.ttl
@@ -0,0 +1,7 @@
+# The identity without the denial.
+@prefix : <http://ex.org/clash#> .
+@prefix owl: <http://www.w3.org/2002/07/owl#> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+
+:alice owl:sameAs :bob .
diff --git a/tests/fixtures/clash-coverage/eq-diff1.ttl b/tests/fixtures/clash-coverage/eq-diff1.ttl
new file mode 100644
index 00000000..4b347285
--- /dev/null
+++ b/tests/fixtures/clash-coverage/eq-diff1.ttl
@@ -0,0 +1,9 @@
+# eq-diff1 T(?x, owl:sameAs, ?y) T(?x, owl:differentFrom, ?y) -> false
+# Two names asserted to be the same thing and to be different things.
+@prefix : <http://ex.org/clash#> .
+@prefix owl: <http://www.w3.org/2002/07/owl#> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+
+:alice owl:sameAs :bob .
+:alice owl:differentFrom :bob .
diff --git a/tests/fixtures/clash-coverage/prp-asyp.clean.ttl b/tests/fixtures/clash-coverage/prp-asyp.clean.ttl
new file mode 100644
index 00000000..c04a80f4
--- /dev/null
+++ b/tests/fixtures/clash-coverage/prp-asyp.clean.ttl
@@ -0,0 +1,8 @@
+# One direction only.
+@prefix : <http://ex.org/clash#> .
+@prefix owl: <http://www.w3.org/2002/07/owl#> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+
+:taller a owl:AsymmetricProperty .
+:bob :taller :carol .
diff --git a/tests/fixtures/clash-coverage/prp-asyp.ttl b/tests/fixtures/clash-coverage/prp-asyp.ttl
new file mode 100644
index 00000000..cb8fdb21
--- /dev/null
+++ b/tests/fixtures/clash-coverage/prp-asyp.ttl
@@ -0,0 +1,10 @@
+# prp-asyp T(?p, rdf:type, owl:AsymmetricProperty) T(?x, ?p, ?y) T(?y, ?p, ?x) -> false
+# A property that cannot run both ways, running both ways.
+@prefix : <http://ex.org/clash#> .
+@prefix owl: <http://www.w3.org/2002/07/owl#> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+
+:taller a owl:AsymmetricProperty .
+:bob :taller :carol .
+:carol :taller :bob .
diff --git a/tests/fixtures/clash-coverage/prp-irp.clean.ttl b/tests/fixtures/clash-coverage/prp-irp.clean.ttl
new file mode 100644
index 00000000..0fcccd81
--- /dev/null
+++ b/tests/fixtures/clash-coverage/prp-irp.clean.ttl
@@ -0,0 +1,8 @@
+# The same irreflexive property between two different individuals.
+@prefix : <http://ex.org/clash#> .
+@prefix owl: <http://www.w3.org/2002/07/owl#> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+
+:parentOf a owl:IrreflexiveProperty .
+:bob :parentOf :carol .
diff --git a/tests/fixtures/clash-coverage/prp-irp.ttl b/tests/fixtures/clash-coverage/prp-irp.ttl
new file mode 100644
index 00000000..b0f10507
--- /dev/null
+++ b/tests/fixtures/clash-coverage/prp-irp.ttl
@@ -0,0 +1,9 @@
+# prp-irp T(?p, rdf:type, owl:IrreflexiveProperty) T(?x, ?p, ?x) -> false
+# A property nothing may bear to itself, borne to itself.
+@prefix : <http://ex.org/clash#> .
+@prefix owl: <http://www.w3.org/2002/07/owl#> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+
+:parentOf a owl:IrreflexiveProperty .
+:bob :parentOf :bob .
diff --git a/tests/fixtures/clash-coverage/prp-npa1.clean.ttl b/tests/fixtures/clash-coverage/prp-npa1.clean.ttl
new file mode 100644
index 00000000..6f0e72c4
--- /dev/null
+++ b/tests/fixtures/clash-coverage/prp-npa1.clean.ttl
@@ -0,0 +1,10 @@
+# The denial alone. Nothing asserts the relation it denies.
+@prefix : <http://ex.org/clash#> .
+@prefix owl: <http://www.w3.org/2002/07/owl#> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+
+:denial a owl:NegativePropertyAssertion ;
+ owl:sourceIndividual :bob ;
+ owl:assertionProperty :parentOf ;
+ owl:targetIndividual :carol .
diff --git a/tests/fixtures/clash-coverage/prp-npa1.ttl b/tests/fixtures/clash-coverage/prp-npa1.ttl
new file mode 100644
index 00000000..0578c1a3
--- /dev/null
+++ b/tests/fixtures/clash-coverage/prp-npa1.ttl
@@ -0,0 +1,13 @@
+# prp-npa1 T(?x, owl:sourceIndividual, ?i1) T(?x, owl:assertionProperty, ?p)
+# T(?x, owl:targetIndividual, ?i2) T(?i1, ?p, ?i2) -> false
+# A graph that denies a relation between two individuals and then asserts it.
+@prefix : <http://ex.org/clash#> .
+@prefix owl: <http://www.w3.org/2002/07/owl#> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+
+:denial a owl:NegativePropertyAssertion ;
+ owl:sourceIndividual :bob ;
+ owl:assertionProperty :parentOf ;
+ owl:targetIndividual :carol .
+:bob :parentOf :carol .
diff --git a/tests/fixtures/clash-coverage/prp-npa2.clean.ttl b/tests/fixtures/clash-coverage/prp-npa2.clean.ttl
new file mode 100644
index 00000000..331b4298
--- /dev/null
+++ b/tests/fixtures/clash-coverage/prp-npa2.clean.ttl
@@ -0,0 +1,11 @@
+# The denial with a different value asserted.
+@prefix : <http://ex.org/clash#> .
+@prefix owl: <http://www.w3.org/2002/07/owl#> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+
+:denial a owl:NegativePropertyAssertion ;
+ owl:sourceIndividual :bob ;
+ owl:assertionProperty :nickname ;
+ owl:targetValue "Bobby" .
+:bob :nickname "Robert" .
diff --git a/tests/fixtures/clash-coverage/prp-npa2.ttl b/tests/fixtures/clash-coverage/prp-npa2.ttl
new file mode 100644
index 00000000..9dd665af
--- /dev/null
+++ b/tests/fixtures/clash-coverage/prp-npa2.ttl
@@ -0,0 +1,14 @@
+# prp-npa2 T(?x, owl:sourceIndividual, ?i) T(?x, owl:assertionProperty, ?p)
+# T(?x, owl:targetValue, ?lt) T(?i, ?p, ?lt) -> false
+# The same denial over a literal value rather than an individual. A separate
+# detector because the target sits under a different predicate.
+@prefix : <http://ex.org/clash#> .
+@prefix owl: <http://www.w3.org/2002/07/owl#> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+
+:denial a owl:NegativePropertyAssertion ;
+ owl:sourceIndividual :bob ;
+ owl:assertionProperty :nickname ;
+ owl:targetValue "Bobby" .
+:bob :nickname "Bobby" .
diff --git a/tests/fixtures/clash-coverage/prp-pdw.clean.ttl b/tests/fixtures/clash-coverage/prp-pdw.clean.ttl
new file mode 100644
index 00000000..cb2bb4d6
--- /dev/null
+++ b/tests/fixtures/clash-coverage/prp-pdw.clean.ttl
@@ -0,0 +1,8 @@
+# The disjointness axiom with one of the two assertions.
+@prefix : <http://ex.org/clash#> .
+@prefix owl: <http://www.w3.org/2002/07/owl#> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+
+:parentOf owl:propertyDisjointWith :siblingOf .
+:bob :parentOf :carol .
diff --git a/tests/fixtures/clash-coverage/prp-pdw.ttl b/tests/fixtures/clash-coverage/prp-pdw.ttl
new file mode 100644
index 00000000..5bd59d7f
--- /dev/null
+++ b/tests/fixtures/clash-coverage/prp-pdw.ttl
@@ -0,0 +1,10 @@
+# prp-pdw T(?p1, owl:propertyDisjointWith, ?p2) T(?x, ?p1, ?y) T(?x, ?p2, ?y) -> false
+# One pair of individuals joined by two properties an axiom says never share a pair.
+@prefix : <http://ex.org/clash#> .
+@prefix owl: <http://www.w3.org/2002/07/owl#> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+
+:parentOf owl:propertyDisjointWith :siblingOf .
+:bob :parentOf :carol .
+:bob :siblingOf :carol .
diff --git a/tests/lean_certificate_test.rs b/tests/lean_certificate_test.rs
index 80b7397d..e3a18d8e 100644
--- a/tests/lean_certificate_test.rs
+++ b/tests/lean_certificate_test.rs
@@ -294,6 +294,14 @@ fn corpus() -> Vec<PathBuf> {
let mut files: Vec<PathBuf> = String::from_utf8_lossy(&out.stdout)
.split('\0')
.filter(|p| !p.is_empty())
+ // `tests/fixtures/clash-coverage/` holds one contradictory graph per clash
+ // detector, each written to make exactly that detector fire (#160), plus a
+ // near-miss twin. They are test data and not ontologies: swept as corpus they
+ // would turn a measurement of the shipped corpus into a statement about this
+ // repository's own fixtures, which is measuring the ruler. The same reasoning
+ // and the same treatment as `tests/fixtures/horn-coverage/`.
+ // `tests/clash_detector_coverage_test.rs` asserts this exclusion is still here.
+ .filter(|p| !p.starts_with("tests/fixtures/clash-coverage/"))
.filter(|p| !SKIP_DIRS.iter().any(|d| p.split('/').any(|seg| seg == *d)))
.map(|p| repo().join(p))
.collect();
diff --git a/tests/projection_monotonicity_corpus_test.rs b/tests/projection_monotonicity_corpus_test.rs
index d93301ca..47c99437 100644
--- a/tests/projection_monotonicity_corpus_test.rs
+++ b/tests/projection_monotonicity_corpus_test.rs
@@ -91,6 +91,14 @@ fn corpus() -> Vec<PathBuf> {
let mut files: Vec<PathBuf> = String::from_utf8_lossy(&out.stdout)
.split('\0')
.filter(|p| !p.is_empty())
+ // `tests/fixtures/clash-coverage/` holds one contradictory graph per clash
+ // detector, each written to make exactly that detector fire (#160), plus a
+ // near-miss twin. They are test data and not ontologies: swept as corpus they
+ // would turn a measurement of the shipped corpus into a statement about this
+ // repository's own fixtures, which is measuring the ruler. The same reasoning
+ // and the same treatment as `tests/fixtures/horn-coverage/`.
+ // `tests/clash_detector_coverage_test.rs` asserts this exclusion is still here.
+ .filter(|p| !p.starts_with("tests/fixtures/clash-coverage/"))
.filter(|p| !SKIP_DIRS.iter().any(|d| p.split('/').any(|seg| seg == *d)))
.map(|p| repo().join(p))
.collect();
diff --git a/tests/reason_rl_coverage_test.rs b/tests/reason_rl_coverage_test.rs
index 44bdc8f9..0c303387 100644
--- a/tests/reason_rl_coverage_test.rs
+++ b/tests/reason_rl_coverage_test.rs
@@ -511,6 +511,14 @@ fn the_new_rules_earn_their_place_on_the_shipped_corpus() {
let mut files: Vec<PathBuf> = tracked
.iter()
.filter(|p| !p.starts_with(COVERAGE_FIXTURES))
+ // `tests/fixtures/clash-coverage/` holds one contradictory graph per clash
+ // detector, each written to make exactly that detector fire (#160), plus a
+ // near-miss twin. They are test data and not ontologies: swept as corpus they
+ // would turn a measurement of the shipped corpus into a statement about this
+ // repository's own fixtures, which is measuring the ruler. The same reasoning
+ // and the same treatment as `tests/fixtures/horn-coverage/`.
+ // `tests/clash_detector_coverage_test.rs` asserts this exclusion is still here.
+ .filter(|p| !p.starts_with("tests/fixtures/clash-coverage/"))
.filter(|p| !SKIP_DIRS.iter().any(|d| p.split('/').any(|seg| seg == *d)))
.map(|p| repo().join(p))
.collect();