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 age of a person using SWRL

Martin O'Connor martin.oconnor at stanford.edu
Fri Jan 18 07:47:33 PST 2008


The core library has no concept of the current time. The temporal 
library has support but it seems to be broken at the moment. I will fix 
it for the next beta.

When it works, you can write:

Person(?p) ^ hasBirthDate(?p, ?dob) ^ temporal:duration(?age, ?dob, 
"now", temporal:Years) -> sqwrl:select(?p, ?age)

Assigning the result of this calculation to a property may be 
problematic though because it can lead to nonmonotonicity.

Martin

Martin Becker wrote:

>Dear all,
>
>I want to calculate the age of a person based on his or her birthdate using
>a SWRL rule. 
>
>Suppose that you have a class 'Person' and a datatype property
>'hasBirthDate' having xsd:date as range.
>Now I want to calculate the age of that person and store the value in a
>datatype property 'hasAge'.
>
>Question: Does the Core SWRL library built-in or the temporal library
>built-in provide a function that would enable me to calculate the age of a
>person by subtracting the birthdate from the current date?
>
>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