Dear friends,

I a trying to perform some operations with dates using rules in jena. One
of those is calculating ages. I found the built in subtractDates(x1, x2,
x3), and at first I wonder if this is a valid jena built in?, at second, I
implemented it with the rule 1 however it does not trigger as expected,
thus I wonder if the built in is properly implemented?. The date format I
am using is yyyy-MM-dd.

@prefix ex: <http://www.example.com#>.

[*rule1:* (?a  ex:birthday ?d1) (?b  ex:currentdate ?d2) subtractDates(?d1,
?d2 ,?age)   -> (?a ex:currentage ?age )]

Where, d1 and d2 are xsd date time values, and age is decimal.

I also implemented the greater than with integer numbers, and I got the
expected result, but I would like to know if there is a built in for date,
where I could evaluate to true when a date is more recent than another?.


Best regards


Luis Ramos

Reply via email to