use of org.apache.jena.datatypes.xsd.XSDDateTime in project jena by apache.
the class Now method bodyCall.
/**
* This method is invoked when the builtin is called in a rule body.
* @param args the array of argument values for the builtin, this is an array
* of Nodes, some of which may be Node_RuleVariables.
* @param context an execution context giving access to other relevant data
* @return return true if the buildin predicate is deemed to have succeeded in
* the current environment
*/
@Override
public boolean bodyCall(Node[] args, int length, RuleContext context) {
checkArgs(length, context);
BindingEnvironment env = context.getEnv();
Node now = NodeFactory.createLiteral(LiteralLabelFactory.createTypedLiteral(new XSDDateTime(Calendar.getInstance())));
return env.bind(args[0], now);
}
Aggregations