@Test public void ruleTest6() throws Exception { final OWLAxiom[] axioms = { OWL.propertyAssertion(_a, _p, _b), OWL.classAssertion(_b, _B), SWRL.rule(SWRL.antecedent(SWRL.classAtom(OWL.some(_p, _B), _x)), SWRL.consequent(SWRL.classAtom(_C, _x))) }; setupGenerators(Stream.of(axioms)); testExplanations(OWL.classAssertion(_a, _C), 1, axioms); }
@Test public void ruleTest4() throws Exception { final OWLAxiom[] axioms = { OWL.classAssertion(_a, _A), SWRL.rule(SWRL.antecedent(SWRL.classAtom(_A, _x)), SWRL.consequent(SWRL.classAtom(_B, _x), SWRL.classAtom(_C, _x))) }; setupGenerators(Stream.of(axioms)); testExplanations(OWL.classAssertion(_a, _B), 1, axioms); testExplanations(OWL.classAssertion(_a, _C), 1, axioms); }
@Test public void ruleTest2() throws Exception { final OWLAxiom[] axioms = { OWL.subPropertyOf(_q, _p), OWL.propertyAssertion(_a, _q, _b), OWL.classAssertion(_b, _B), SWRL.rule(SWRL.antecedent(SWRL.propertyAtom(_p, _x, _y), SWRL.classAtom(_B, _y)), SWRL.consequent(SWRL.classAtom(_A, _x))) }; setupGenerators(Stream.of(axioms)); testExplanations(OWL.classAssertion(_a, _A), 1, axioms); }
@Test public void ruleTest5() throws Exception { final OWLAxiom[] axioms = { OWL.propertyAssertion(_a, _p, _b), SWRL.rule(SWRL.antecedent(SWRL.propertyAtom(_p, _x, _y)), SWRL.consequent(SWRL.classAtom(_A, _x), SWRL.classAtom(_B, _y))) }; setupGenerators(Stream.of(axioms)); testExplanations(OWL.classAssertion(_a, _A), 1, axioms); testExplanations(OWL.classAssertion(_b, _B), 1, axioms); }
SWRL.consequent(SWRL.classAtom(ClsB, varA))// )); SWRL.consequent(SWRL.classAtom(ClsC, varA))// )); SWRL.consequent(SWRL.classAtom(ClsE, varA))// )); SWRL.consequent(SWRL.classAtom(ClsG, varA))// ); SWRL.consequent(SWRL.classAtom(ClsG, varA))// );
@Test public void ruleTest1b() throws Exception { final OWLAxiom[] axioms = { OWL.classAssertion(_a, _A), OWL.classAssertion(_b, _B), OWL.propertyAssertion(_a, _p, _b), SWRL.rule(SWRL.antecedent(SWRL.classAtom(_A, _x)), SWRL.consequent(SWRL.classAtom(_B, _x))), SWRL.rule(SWRL.antecedent(SWRL.classAtom(_B, _x), SWRL.propertyAtom(_p, _x, _y), SWRL.classAtom(_B, _y)), SWRL.consequent(SWRL.classAtom(_C, _x))) }; setupGenerators(Stream.of(axioms)); testExplanations(OWL.classAssertion(_a, _A), 0, new OWLAxiom[] { axioms[0] }); testExplanations(OWL.classAssertion(_a, _B), 0, new OWLAxiom[] { axioms[0], axioms[3] }); testExplanations(OWL.classAssertion(_a, _C), 1, axioms); }
@Test public void ruleTest3() throws Exception { final OWLAxiom[] axioms = { OWL.inverseProperties(_q, _p), OWL.propertyAssertion(_b, _q, _a), OWL.classAssertion(_b, _B), SWRL.rule(SWRL.antecedent(SWRL.propertyAtom(_p, _x, _y), SWRL.classAtom(_B, _y)), SWRL.consequent(SWRL.classAtom(_A, _x))) }; setupGenerators(Stream.of(axioms)); testExplanations(OWL.classAssertion(_a, _A), 1, axioms); }
@Test public void ruleTest1() throws Exception { final OWLAxiom[] axioms = { OWL.classAssertion(_a, _A), OWL.classAssertion(_b, _B), OWL.propertyAssertion(_a, _p, _b), SWRL.rule(SWRL.antecedent(SWRL.classAtom(_A, _x)), SWRL.consequent(SWRL.classAtom(_B, _x))), SWRL.rule(SWRL.antecedent(SWRL.classAtom(_B, _x), SWRL.propertyAtom(_p, _x, _y), SWRL.classAtom(_B, _y)), SWRL.consequent(SWRL.classAtom(_C, _x))) }; setupGenerators(Stream.of(axioms)); testExplanations(OWL.classAssertion(_a, _A), 0, new OWLAxiom[] { axioms[0] }); testExplanations(OWL.classAssertion(_a, _B), 0, new OWLAxiom[] { axioms[0], axioms[3] }); testExplanations(OWL.classAssertion(_a, _C), 1, axioms); }
SWRL.consequent(SWRL.classAtom(ClsB, varA))// )); SWRL.consequent(SWRL.classAtom(ClsC, varA))// )); SWRL.consequent(SWRL.classAtom(ClsE, varA))// )); SWRL.consequent(SWRL.classAtom(ClsG, varA))// ); SWRL.consequent(SWRL.classAtom(ClsG, varA))// );
@Test public void ruleBuiltinTest1() throws Exception { final OWLAxiom[] axioms = { OWL.classAssertion(_a, _A), OWL.propertyAssertion(_a, dp, OWL.constant(9)), SWRL.rule(SWRL.antecedent(SWRL.classAtom(_A, _x), SWRL.propertyAtom(dp, _x, _dx), SWRL.lessThan(_dx, SWRL.constant(10))), SWRL.consequent(SWRL.classAtom(_B, _x))) }; setupGenerators(Stream.of(axioms)); testExplanations(OWL.classAssertion(_a, _B), 0, axioms); }
@Test public void ruleBuiltinTest2() throws Exception { final OWLAxiom[] axioms = { OWL.classAssertion(_a, _A), OWL.propertyAssertion(_a, dp, OWL.constant(9)), SWRL.rule(SWRL.antecedent(SWRL.classAtom(_A, _x), SWRL.propertyAtom(dp, _x, _dx), SWRL.greaterThan(_dx, SWRL.constant(5)), SWRL.lessThan(_dx, SWRL.constant(10))), SWRL.consequent(SWRL.classAtom(_B, _x))) }; setupGenerators(Stream.of(axioms)); testExplanations(OWL.classAssertion(_a, _B), 0, axioms); }
@Test public void ruleBuiltinTest3() throws Exception { final SWRLVariable y = SWRL.variable(ontologyURI + "year"); final SWRLVariable m = SWRL.variable(ontologyURI + "month"); final SWRLVariable d = SWRL.variable(ontologyURI + "day"); final OWLDataProperty year = OWL.DataProperty(ontologyURI + "year"); final OWLDataProperty month = OWL.DataProperty(ontologyURI + "month"); final OWLDataProperty day = OWL.DataProperty(ontologyURI + "day"); final OWLAxiom[] axioms = { // OWL.propertyAssertion(_a, dp, // OWL.constant("2009-01-02", XSD.DATE)), // SWRL.rule(// SWRL.antecedent(SWRL.propertyAtom(dp, _x, _dx), // SWRL.builtIn(SWRLBuiltInsVocabulary.DATE, _dx, y, m, d)), // SWRL.consequent(SWRL.propertyAtom(year, _x, y), // SWRL.propertyAtom(month, _x, m), // SWRL.propertyAtom(day, _x, d)// )// ) // }; setupGenerators(Stream.of(axioms)); testExplanations(OWL.propertyAssertion(_a, year, OWL.constant(2009)), 1, new OWLAxiom[] { axioms[0], axioms[1] }); }
SWRL.consequent(SWRL.propertyAtom(dpB, swrlIndA, sup)))); SWRL.consequent(SWRL.propertyAtom(dpB, swrlIndA, inf))));
SWRL.consequent(SWRL.propertyAtom(dpB, swrlIndA, sup)))); SWRL.consequent(SWRL.propertyAtom(dpB, swrlIndA, inf))));
SWRL.consequent(SWRL.propertyAtom(dpB, swrlIndA, sup)))); SWRL.consequent(SWRL.propertyAtom(dpB, swrlIndA, inf))));
SWRL.consequent(SWRL.propertyAtom(dpB, swrlIndA, sup)))); SWRL.consequent(SWRL.propertyAtom(dpB, swrlIndA, inf))));