AtomIVariable x = new AtomIVariable( "x" );
AtomDVariable xDate = new AtomDVariable( "xDate" ), xYear = new AtomDVariable( "xYear" ), xMonth = new AtomDVariable(
"xMonth" ), xDay = new AtomDVariable( "xDay" ), xTZ = new AtomDVariable( "xTZ" );
RuleAtom dateBuiltIn = new BuiltInAtom( SWRLB + "date", xDate, xYear, xMonth, xDay );
RuleAtom dateBuiltInTZ = new BuiltInAtom( SWRLB + "date", xDate, xYear, xMonth, xDay, xTZ );
RuleAtom bDateAtom = new DatavaluedPropertyAtom( bDate, x, xDate );
RuleAtom bYearAtom = new DatavaluedPropertyAtom( bYear, x, xYear );
RuleAtom bMonthAtom = new DatavaluedPropertyAtom( bMonth, x, xMonth );
RuleAtom bDayAtom = new DatavaluedPropertyAtom( bDay, x, xDay );
RuleAtom bTZAtom = new DatavaluedPropertyAtom( bTZ, x, xTZ );
Rule fromDate = new Rule( Arrays
.asList( new RuleAtom[] { bYearAtom, bMonthAtom, bDayAtom } ), Arrays
.asList( new RuleAtom[] { dateBuiltIn, bDateAtom } ) );
kb.addRule( fromDate );