According to the documentation here: https://github.com/protegeproject/swrlapi/wiki/SWRLTemporalBuiltinsAdvanced the first two arguments to during have to be instants or intervals. I haven't used the temporal operators much but as far as I know the string "now" is neither an instant nor an interval. If you look at the error message that seems to be what it's complaining about, that duration expected it's first argument to be an instant or interval and instead it's getting a string.
I see why you thought that might work though. It does say here: https://github.com/protegeproject/swrlapi/wiki/ModellingTime that: "The model may also use a distinguished time called now to refer to the current time. ‘Now’ is a special kind of datetime, rather than an interval or period." I tried the variable temporal:now and temporal:Now and neither seem to be defined. Also, it seems to me that using a variable called Now with SWRL wouldn't work for the same reason as the previous question: not supporting non-monotonic reasoning. As Heraclitus said: "you can't have a monotonic variable set to Now" Actually it was "you can't step into the same river twice" but it's the same point, Now is the ultimate non-monotonic variable so I'm not sure why the documentation on ModellingTime mentions it, except to make the point that it's part of the classic Allen Model which the SWRL temporals are based on.
Perhaps Martin or Igor or Lorenz or someone else who has more experience with the Temporal model can shed more light but I think the main point is that just giving it a string is neither a valid instant nor interval.
Rimel, One other suggestion: you might want to load the Temporal ontology into your ontology. The description for the temporal ontology can be found here: https://github.com/protegeproject/swrlapi/wiki/SWRLTemporalOntology I noticed you defined properties has-finish, has-start, it might be better to load the temporal ontology and use it's properties: hasFinishTime, hasStartTime. I still don't think that will give you a Now variable but it will give you access to the more powerful SWRL capabilities for defining the granularities of intervals and instants.
Moreover, as you can see (or maybe I found no better way) you
can only bind the value of validity to a particular boolean value
(true here with "now" being contained in the
interval). That means we need two more rules (we don't have
disjunction in SWRL) that assign false
to the validity if either now is before start
Normally when you need updating your files with small data items on a regular basis, the common pattern is using scripting. For updating the current date and time I recommend:
- Create a tiny ontology module as an OWL file to specify the current date and time.
- Create a script (I recommend a Python script) to inject the current date and time property assertion into the OWL file.
- Call this script from the Protégé start-up script.
- Import the OWL file into your ontology.