Test-only application of subproperty and transitivity rules. Production KG queries do not run an OWL reasoner; keep that boundary explicit below.
(mut facts: BTreeSet<Fact>)
| 25 | // Test-only application of subproperty and transitivity rules. Production KG |
| 26 | // queries do not run an OWL reasoner; keep that boundary explicit below. |
| 27 | fn declared_closure(mut facts: BTreeSet<Fact>) -> BTreeSet<Fact> { |
| 28 | loop { |
| 29 | let previous = facts.clone(); |
| 30 | for &(subject, predicate, object) in &previous { |
| 31 | if let Some(parent) = predicate.super_predicate() { |
| 32 | facts.insert((subject, parent, object)); |
| 33 | } |
| 34 | if predicate.is_transitive() { |
| 35 | for &(next_subject, next_predicate, next_object) in &previous { |
| 36 | if object == next_subject && predicate == next_predicate { |
| 37 | facts.insert((subject, predicate, next_object)); |
| 38 | } |
| 39 | } |
| 40 | } |
| 41 | } |
| 42 | if facts == previous { |
| 43 | return facts; |
| 44 | } |
| 45 | } |
| 46 | } |
| 47 | |
| 48 | #[test] |
| 49 | fn turtle_and_registry_link_child_to_ancestor_not_the_reverse() { |
no test coverage detected