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
Tue Jan 15 09:45:22 PST 2008

The temporal built-ins in the core SWRL built-in library have not yet
been released. They will be at the end of February.

However, the temporal library [1] alone will work:

Project(?pr) ^ hasStartDate(?pr, ?date1) ^ hasEndDate(?pr, ?date2) ^
temporal:duration(?d, ?date1, ?date2, temporal:Days) -> sqwrl:select(?d)

I'm not sure what you are trying to do in the consequent of the rule
below. If you want to store a duration property you will have to create
a specific property first to hold the value before writing the rule.



Martin Becker wrote:

>Hi everybody,
>I would like to calculate the duration of projects by using the SWRL
>built-in swrlb:subtractDates. Suppose you have a project 'pr1' with a start
>date 'date1' and a finish date 'date2' and you now want to calculate the
>duration between 'date1' and 'date2'. 
>My idea was as follows:
>Project(?pr)  ∧
>hasStartDate(?pr, ?date1)  ∧
>hasEndDate(?pr, ?date2)  ∧
>swrlb:subtractDates(?date2, ?date1) 
>→ temporal:duration(?pr)
>Where 'hasStartDate' and 'hasEndDate' are datatype properties with class
>'Project' as domain and 'xsd:date' as range.
>The project 'pr1' should then get the calculated value as duration. Does
>anyone of you have a clue how to implement this. Any reply is greatly
>Best, Martin
>protege-owl mailing list
>protege-owl at
>Instructions for unsubscribing: 

More information about the protege-owl mailing list