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 stanford.edu
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

[1] http://www.daml.org/2004/04/swrl/builtins.html#8.5

Martin Becker wrote:

>Martin,
>
>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, 
>
>Martin
>
>
>  
>
>------------------------------------------------------------------------
>
>_______________________________________________
>protege-owl mailing list
>protege-owl at lists.stanford.edu
>https://mailman.stanford.edu/mailman/listinfo/protege-owl
>
>Instructions for unsubscribing: http://protege.stanford.edu/doc/faq.html#01a.03 
>  
>




More information about the protege-owl mailing list