0

I need to define a SWRL rule that checks whether the time of a xsd:dateTime datatype is between two specific times. How can i do that? I would need something that is compatible with Protégé.

Thanks a lot.

Cilla
  • 419
  • 5
  • 16
  • Have you looked at the [SWRL docs](https://www.w3.org/Submission/SWRL/#8.5)? – UninformedUser Jan 11 '18 at 19:49
  • And have you looked at the [SWRL API docs](https://github.com/protegeproject/swrlapi/wiki/SWRLTemporalBuiltinsAdvanced)? – UninformedUser Jan 11 '18 at 19:52
  • yes but i get an error launching the reasoner, something like "built-ins atoms are not supported yet". – Cilla Jan 11 '18 at 22:21
  • Well, now you mentioned an information that I could **not** see in your question...there is a difference between the OWL reasoners like Pellet, HermiT, etc and the SWRLTab (based on SWRL API based on Drools rule engine). Don't mix up both things. – UninformedUser Jan 12 '18 at 04:27
  • Have you tried Pellet? It supports [some](https://github.com/stardog-union/pellet/wiki/FAQ#does-pellet-support-rules-swrl-which-builtins) of the SWRL built-ins:*"We only support the first 5 Builtins for Date, Time, and Duration"* Reading the documentation (what you should have done instead of me...), those are `swrlb:yearMonthDuration, swrlb:dayTimeDuration, swrlb:dateTime, swrlb:date, swrlb:time ` You see, `*subtract*` for instance isn't covered by Pellet. – UninformedUser Jan 12 '18 at 04:30
  • Or do you use HermiT (IIRC, it doesn't support SWRL at all, that's where the warning comes from) - if so, try Pellet (if you don't use any of the unsupported built-ins) – UninformedUser Jan 12 '18 at 04:30
  • And most importantly, it would be good to show the rule you tried. Provide more information - obviously, you already tried something, this could avoid that others here try the same first and then recognize that this doesn't work. Cheers – UninformedUser Jan 12 '18 at 04:32
  • @Cilla, what about OWL capabilities? Something like `Class: SomeClass SubClassOf: someProperty only xsd:dateTime[>= "1982-06-09T03:15:00"^^xsd:dateTime , <= "2018-01-12T08:43:00"^^xsd:dateTime]`. – Stanislav Kralin Jan 12 '18 at 08:43
  • @StanislavKralin yes but i don't know how would i do that. I try to explain better what the problem is. Suppose that there is an individual representing a show of a cinema, this individual has a property of type dateTime with the following value 2018-01-12T17: 00: 00, based on the time (17 or 5PM if you prefer) I would like to categorize it in the afternoon class of shows, that contains all the shows with starting time between 13 (1PM) and 19 (7PM). How can I define a rule like this? – Cilla Jan 12 '18 at 13:12

0 Answers0