I'm trying to implement a rule that substract 1 years to a datetime and asign it to a data property using only SWRL
I've got an entity Product
which got a data property creationDate
equal to 2019-07-15T00:00:00
.
My SWRL rule is the following :
Product(?p) ^ creationDate(?p, ?cd) ^ swrlb:yearMonthDuration(?dur, 1, 0)
^ swrlb:subtractYearMonthDurationFromDateTime(?result, ?cd, ?dur)
-> Product(?p) ^ yearBeforeCreation(?p, ?result)
I expect to get yearBeforeCreation equal to 2018-07-15T00:00:00
Right now I've tried the SWRL with Pellet and Drools
Thanks for your help !