Search Mailing List Archives

Limit search to: Subject & Body Subject Author
Sort by: Reverse Sort
Limit to: All This Week Last Week This Month Last Month
Select Date Range     through    

[protege-owl] Calculating duration using SWRL built-in swrlb:subtractDates

Martin O'Connor martin.oconnor at
Wed Jan 16 13:40:15 PST 2008

If by pure SWRL you mean using the core built-in library [1], you can do
something like:

Project(?pr) ^ hasStartDate(?pr, ?start) ^ hasEndDate(?pr, ?end) ^
swrlb:subtractTimes(?d, ?start, ?end) -> hasDuration(?pr, ?d)

The duration must be of type xsd:duration and you will get an
dayTimeDuration value.

The temporal built-ins in the core library are not released yet but will
be available in late February.



Martin Becker wrote:

>your rule works as intended - thank you very much. After creating the
>hasDuration datatype property I was able to hold the calculated value:
>Project(?pr)  ∧
>hasStartDate(?pr, ?date1)  ∧
>hasEndDate(?pr, ?date2)  ∧
>temporal:duration(?d, ?date1, ?date2, temporal:Days) 
>→ hasDuration(?pr, ?d)
>However, do you see a way to express this without reference to the temporal
>library only by means of pure SWRL?
>Best regards, 
>protege-owl mailing list
>protege-owl at
>Instructions for unsubscribing: 

More information about the protege-owl mailing list