@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] });
}