SWRL Temporal Builtins

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

SWRL Temporal Builtins

Rimel
Hello,

I try to execute the following SWRL rule that contains the temporal builtins
temporal:during
"Temperature(?t) ^ Interval(?d) ^ has-duration(?t, ?d) ^
temporal:during("now", ?d) -> validity(?t, true)"

when I try to execute this rule I find several errors as shown in the
attached figures.

<http://protege-project.136.n4.nabble.com/file/t377087/errors.png>

you find attached the ontology that I work on it.

example.owl
<http://protege-project.136.n4.nabble.com/file/t377087/example.owl>  

Thank you for your help

Best,









--
Sent from: http://protege-project.136.n4.nabble.com/Protege-User-f4659818.html
_______________________________________________
protege-user mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-user
Reply | Threaded
Open this post in threaded view
|

Re: SWRL Temporal Builtins

Michael DeBellis-2
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. 


On Fri, Aug 2, 2019 at 6:09 AM Rimel <[hidden email]> wrote:
Hello,

I try to execute the following SWRL rule that contains the temporal builtins
temporal:during
"Temperature(?t) ^ Interval(?d) ^ has-duration(?t, ?d) ^
temporal:during("now", ?d) -> validity(?t, true)"

when I try to execute this rule I find several errors as shown in the
attached figures.

<http://protege-project.136.n4.nabble.com/file/t377087/errors.png>

you find attached the ontology that I work on it.

example.owl
<http://protege-project.136.n4.nabble.com/file/t377087/example.owl

Thank you for your help

Best,









--
Sent from: http://protege-project.136.n4.nabble.com/Protege-User-f4659818.html
_______________________________________________
protege-user mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-user

_______________________________________________
protege-user mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-user
Reply | Threaded
Open this post in threaded view
|

Re: SWRL Temporal Builtins

Michael DeBellis-2
In reply to this post by Rimel
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. 

On Fri, Aug 2, 2019 at 6:09 AM Rimel <[hidden email]> wrote:
Hello,

I try to execute the following SWRL rule that contains the temporal builtins
temporal:during
"Temperature(?t) ^ Interval(?d) ^ has-duration(?t, ?d) ^
temporal:during("now", ?d) -> validity(?t, true)"

when I try to execute this rule I find several errors as shown in the
attached figures.

<http://protege-project.136.n4.nabble.com/file/t377087/errors.png>

you find attached the ontology that I work on it.

example.owl
<http://protege-project.136.n4.nabble.com/file/t377087/example.owl

Thank you for your help

Best,









--
Sent from: http://protege-project.136.n4.nabble.com/Protege-User-f4659818.html
_______________________________________________
protege-user mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-user

_______________________________________________
protege-user mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-user
Reply | Threaded
Open this post in threaded view
|

Re: SWRL Temporal Builtins

Rimel
Dear,

Thank you for your answer,

I understand that "now" is not a temporal variable. But I need to verify
that the time when I use this data is still valid.

Can you help me please with an idea?

How may I, for example, store the current time in a variable and then use
it?

Thanks in advance


 



--
Sent from: http://protege-project.136.n4.nabble.com/Protege-User-f4659818.html
_______________________________________________
protege-user mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-user
Reply | Threaded
Open this post in threaded view
|

Re: SWRL Temporal Builtins

Lorenz Buehmann
In reply to this post by Rimel
Hello everyone,


your rule is a bit strange or too optimistic. I mean, in your ontology you have

Temperature connected to Interval via property has-duration, so far so good we can cover this by

Temperature(?t) ^ has-duration(?t, ?d) ^ Interval(?d)

But then, you're using

temporal:during("now", ?d)

during(a, b) is true if interval a is inside interval b

Neither denotes "now" an interval, nor do I understand how the SWRL API should automatically be able to use your custom Interval class.

Your custom Interval class has two properties has-start and has-finish. How should SWRL API be able to understand resp. process the interval?

It's quite obvious that you and only you have to make use those properties explicitly in the rule:

untitled-ontology-5:Temperature(?t) ^ untitled-ontology-5:has-duration(?t, ?d) ^ untitled-ontology-5:has-start(?d, ?s) ^ untitled-ontology-5:has-finish(?d, ?e) ^ temporal:before(?s, "now") ^ temporal:after(?e, "now") -> untitled-ontology-5:validity(?t, true)

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

untitled-ontology-5:Temperature(?t) ^ untitled-ontology-5:has-duration(?t, ?d) ^ untitled-ontology-5:has-start(?d, ?s) ^ temporal:before("now", ?s) -> untitled-ontology-5:validity(?t, false)

or after end:

untitled-ontology-5:Temperature(?t) ^ untitled-ontology-5:has-duration(?t, ?d) ^ untitled-ontology-5:has-finish(?d, ?e) ^ temporal:after("now", ?e) -> untitled-ontology-5:validity(?t, false)


And I agree with Michael, I'd go with Martins SWRL Temporal Ontology or at least use OWL Time ontology. Both great work done for a complex topic.



Just my two cents, other might come up with better solutions.

Hello, 

I try to execute the following SWRL rule that contains the temporal builtins
temporal:during
"Temperature(?t) ^ Interval(?d) ^ has-duration(?t, ?d) ^
temporal:during("now", ?d) -> validity(?t, true)"

when I try to execute this rule I find several errors as shown in the
attached figures. 

<http://protege-project.136.n4.nabble.com/file/t377087/errors.png> 

you find attached the ontology that I work on it. 

example.owl
<http://protege-project.136.n4.nabble.com/file/t377087/example.owl>  

Thank you for your help 

Best,









--
Sent from: http://protege-project.136.n4.nabble.com/Protege-User-f4659818.html
_______________________________________________
protege-user mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-user


-- 
Lorenz Bühmann
AKSW group, University of Leipzig
Group: http://aksw.org - semantic web research center

_______________________________________________
protege-user mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-user
Reply | Threaded
Open this post in threaded view
|

Re: SWRL Temporal Builtins

Igor Toujilov-2
In reply to this post by Rimel
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.

Cheers,
Igor


> Sent: Friday, August 02, 2019 at 7:21 PM
> From: "Rimel" <[hidden email]>
> To: [hidden email]
> Subject: Re: [protege-user] SWRL Temporal Builtins
>
> Dear,
>
> Thank you for your answer,
>
> I understand that "now" is not a temporal variable. But I need to verify
> that the time when I use this data is still valid.
>
> Can you help me please with an idea?
>
> How may I, for example, store the current time in a variable and then use
> it?
>
> Thanks in advance
>
>
>  
>
>
>
> --
> Sent from: http://protege-project.136.n4.nabble.com/Protege-User-f4659818.html
> _______________________________________________
> protege-user mailing list
> [hidden email]
> https://mailman.stanford.edu/mailman/listinfo/protege-user
>
_______________________________________________
protege-user mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-user