0

Say i have an individual has a starts_at datetime property, then i want to compare it's value with the current datetime in ontology using SWRL rules

I looked at time ontology in W3C, then i found the SWRLTemporalOntology from built in SWRL Rules, but it works only with SQWRL, not works with SWRL

SWRLTemporalOntologyApi: https://github.com/protegeproject/swrlapi/wiki/SWRLTemporalOntology

also i looked at SWRL built in tools: https://www.w3.org/Submission/SWRL/#8.5 but i can't solve the problem

so, Do you have any idea?

Taha
  • 61
  • 3
  • what means "compare"? Please show the intended rule. And not works means? With Pellet reasoner? If yes, then of course you can only use the official SWRL built-ins. – UninformedUser May 12 '19 at 06:14
  • I mean by "compare": i want to get the difference between two times, and compare the difference by a given value say i have the current time, and another individual has a property of a time, then i want to get the difference between these two times and compare it to "seconds" I tried built-in SWRL temporal:duration, but it is only working with the SQWRL i'm using Pellet reasoner of course, – Taha May 12 '19 at 09:59
  • Example: `temporal:add(?add, "2009-07-01T10:30:00", 1, "Minutes") ^ Test(?ts) ^ CurrentTime(?ct) ^ now(?ct, ?n) ^ swrlb:equal(?add, ?n) -> TestTime(?ts)` , it doesn't work for me, but if i use SQWRL it works, such as the following example: `temporal:add(?add, "2009-07-01T10:30:00", 1, "Minutes") ^ Test(?ts) ^ CurrentTime(?ct) ^ now(?ct, ?n) ^ swrlb:equal(?add, ?n) -> sqwrl:select(?add)` ,,,,,,,,,,,,,,, it works in SQWRL and it returns the new datetime after adding one minute to the original datetime value – Taha May 12 '19 at 10:00
  • not sure what the purpose of the rule would be, but no, this won't work with Pellet given that unknown built-ins are used. Pellet only works with standard SWRL built-ins, indeed any rule with custom built-ins has to be omitted because the reasoner does not know how to handle it. And SWRLAPI is a separate API with SWRL extensions beyond the standard and the SWRL API and SQWRL also uses the rule engine Drools and not the Pellet reasoner. – UninformedUser May 12 '19 at 10:32
  • Did you read this: https://github.com/protegeproject/swrlapi/wiki/SWRLTemporalOntology – Taha May 12 '19 at 10:34
  • Yes, I know this already? Why are you asking? `temporal:add` is not part of SWRL, so Pellet can't process the rule. Do you understand this? – UninformedUser May 12 '19 at 10:37
  • Moreover, Pellet support for time is limited anyways, see https://github.com/stardog-union/pellet/wiki/FAQ#does-pellet-support-rules-swrl-which-builtins - maybe they already added support for the other time built-ins, but nevertheless it has nothing to do with the SWRLAPI extensions – UninformedUser May 12 '19 at 10:38
  • I'm just wondering why is `temporal:duration` works with SQWRL, but didn't work with SWRL? – Taha May 12 '19 at 10:48
  • What means "but didn't work with SWRL" - where did you see that it didn't work? That'S what I was asking before. Do you run the rule in the SWRL Tab or are you just using the Pellet reasoner? – UninformedUser May 12 '19 at 10:49

0 Answers0