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] SWRL Temporal built-in problem

Martin O'Connor martin.oconnor at
Wed Apr 25 10:49:08 PDT 2007

SWRL's differentFrom construct works only with OWL individuals:

You are attempting to use it with datatypes.

Also, as far as I can tell from your email, every Environment individual 
has only one Date_Time property value so ?xDate and?yDate will always 
refer to the same value (which is why temporal:equals evaluates to 
true). I presume what you intend to do is to compare datetimes from two 
different environments, e.g.,

Environment(?e1) ^ Environment(?e2) ^ differentFrom(?e1, ?e2) ^ 
hasDateTime(?e1, ?dt1) ^ hasDateTime(?e2, ?dt2) ^
temporal:duration(3, ?dt1, ?dt2, temporal:Days) -> something...

As mentioned in the link above, all individuals of class Environment 
must have the owl:allDifferents restriction defined if the differentFrom 
clause is to work properly with them.


Trina wrote:

>Hi All,
>Are there any further examples for the SWRL temporal built-ins besides the Wiki
>and Martin's paper on querying time-oriented data? I have been trying the latest
>implementation (build 395) and am not having a great deal of success with the
>rules I am using (which is purely a lack of understanding on my part). 
>I am trying to compare the date_time properties of an 'Environment' class to
>test if there has been a duration of 3 days. The rule I used was:
>Environment(?x)  ∧
>Date_Time(?x, ?xDate)  ∧
>Date_Time(?x, ?yDate)  ∧
>differentFrom(?xDate, ?yDate)
>temporal:duration(3, ?xDate, ?yDate, temporal:Days) 
>  → tempBoolean(?x, true)  **this being an arbitrary property to test the
>The values of the Date_Time property has been set as:
>(assert (Date_Time Environment_1 "2007-04-25T14:29:43")) 
>(assert (Date_Time Environment_3 "2007-04-17T14:54:42")) 
>(assert (Date_Time Environment_4 "2007-04-27T14:08:59")) 
>(assert (Date_Time Environment_2 "2007-04-28T14:30:20")) 
>(assert (Date_Time Environment_5 "2007-04-29T15:03:55")) 
>When I run Jess, nil properties are asserted. If I take out the differentFrom
>restriction I get the same outcome. 
>If I use the temporal:equals instead of duration (just to test e.g.
>temporal:equals(?xDate, ?yDate, temporal:Days), all 'tempBoolean' properties are
>asserted to be true, even though they are all different dates. 
>Any advice would be appreciated
>protege-owl mailing list
>protege-owl at
>Instructions for unsubscribing: 

More information about the protege-owl mailing list