Hi Luis Ramos, where can we find this substractDates builtin? I cannot find it 
in the source code:

https://github.com/apache/jena/tree/master/jena-core/src/main/java/org/apache/jena/reasoner/rulesys/builtins

or the documentation:

https://jena.apache.org/documentation/inference/#builtin-primitives

There are lessThan, greaterThan builtins that evaluate to true if one data is 
more recent than another.

Regards, Barry

-----Original Message-----
From: Luis Enrique Ramos García <[email protected]> 
Sent: dinsdag 21 januari 2020 10:56
To: [email protected]
Subject: substractDate built in

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
This message may contain information that is not intended for you. If you are 
not the addressee or if this message was sent to you by mistake, you are 
requested to inform the sender and delete the message. TNO accepts no liability 
for the content of this e-mail, for the manner in which you use it and for 
damage of any kind resulting from the risks inherent to the electronic 
transmission of messages.

Reply via email to