Suppose i have Event e, which hasStartTime t1 and hasEndTime t2. To calculate the duration using SWRL of the event in minutes i use this rule :
Event(?e) ∧
hasStartTime(?e, ?t1) ∧
hasEndTime(?e, ?t2) ∧
temporal:duration(?d, ?t1, ?t2, temporal:Minutes)
→ hasDuration(?e, ?d)
?d is return value in a minute .
March 8, 2008 at 10:52 am
Jena SPARQL implementation uses ARQ engine that is highly extensible. It allows API users to create custom property and filter functions that adds more control to data within the RDF graph. I used that extensibility to compute for the duration for my project (though mine was more of a filter function that checks if the 2 dateTimes have at least some duration). I find using SWRL to be a bit computationally expensive for the task (due to the additional rule engine).
March 25, 2008 at 12:20 pm
Good post., bro