Fwd: rule with dates

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

Fwd: rule with dates

Luis Enrique Ramos García


Dear friends, 

I am trying to do the following operation with swrl rules:

 ownershipStarted(?o, ?os) ^ todayIs(?o, ?ti) ^ temporal:before(?os, ?ti) -> propertyValidity(?o, true)


where ?o and ?ti correspond to dates in the format "2019-07-31T10:00:00"^^xsd:dateTime, related to ?o by datatype properties in protege 5. 


when I apply the rule, it seems it is not evaluated, but when I change variables by string values, as follows:


 ownershipStarted(?o, ?os) ^ todayIs(?o, ?ti) ^ temporal:before("2000-02-01T11:12:12.000", "2019-01-01T12:00:00") -> propertyValidity(?o, true)


the rule is evaluated and propertyValidity changes to true. 


The question is what I am doing wrong?, in both case it should work, but it seems something is going wrong when variables ?os and ?ti values are assigned. 


Thanks in advanced


Luis Ramos







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

Re: Fwd: rule with dates

Martin O'Connor-2

Are you using the latest Protege 5.5 and 2.0.6 version of the SWRLTab plugin? If not, I would upgrade and try again.

Martin

On Jul 31, 2019, at 4:59 AM, Luis Enrique Ramos García <[hidden email]> wrote:



Dear friends, 

I am trying to do the following operation with swrl rules:

 ownershipStarted(?o, ?os) ^ todayIs(?o, ?ti) ^ temporal:before(?os, ?ti) -> propertyValidity(?o, true)


where ?o and ?ti correspond to dates in the format "2019-07-31T10:00:00"^^xsd:dateTime, related to ?o by datatype properties in protege 5. 


when I apply the rule, it seems it is not evaluated, but when I change variables by string values, as follows:



 ownershipStarted(?o, ?os) ^ todayIs(?o, ?ti) ^ temporal:before("2000-02-01T11:12:12.000", "2019-01-01T12:00:00") -> propertyValidity(?o, true)


the rule is evaluated and propertyValidity changes to true. 


The question is what I am doing wrong?, in both case it should work, but it seems something is going wrong when variables ?os and ?ti values are assigned. 


Thanks in advanced


Luis Ramos






_______________________________________________
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: Fwd: rule with dates

Michael DeBellis-2
In reply to this post by Luis Enrique Ramos García
I agree with Martin, make sure you are using the latest version. Also, have you tried using SQWRL to make sure those variables are actually getting bound as you think they are? You can do that by writing a rule where the left hand side is exactly as you have it but rather than setting properValidity to true on the right hand side after the arrow you have: sqwrl:select(?o, ?os, ?ti) 

If you try this make sure to write the rule in the SQWRL tab. Then you can select the new SQWRL rule and run it. It will create a new tab in the bottom pane and print out the values of each variable every time the right side is satisfied and fires. You can put as many variables as you want in the select statement.

Also, if you are still having trouble and your ontology isn’t too large you can attach it to your email. It’s a lot easier to help debug if we can see the actual ontology.

Michael 



On Jul 31, 2019, at 4:59 AM, Luis Enrique Ramos García <[hidden email]> wrote:



Dear friends, 

I am trying to do the following operation with swrl rules:

 ownershipStarted(?o, ?os) ^ todayIs(?o, ?ti) ^ temporal:before(?os, ?ti) -> propertyValidity(?o, true)


where ?o and ?ti correspond to dates in the format "2019-07-31T10:00:00"^^xsd:dateTime, related to ?o by datatype properties in protege 5. 


when I apply the rule, it seems it is not evaluated, but when I change variables by string values, as follows:


 ownershipStarted(?o, ?os) ^ todayIs(?o, ?ti) ^ temporal:before("2000-02-01T11:12:12.000", "2019-01-01T12:00:00") -> propertyValidity(?o, true)


the rule is evaluated and propertyValidity changes to true. 


The question is what I am doing wrong?, in both case it should work, but it seems something is going wrong when variables ?os and ?ti values are assigned. 


Thanks in advanced


Luis Ramos






_______________________________________________
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: Fwd: rule with dates

Luis Enrique Ramos García
In reply to this post by Martin O'Connor-2
Hi Martin, 

I just checked, and I am using the last version of protege, and swrl, but I and solving another issue in other thread, as soon as I solve it, I will return with this. 


Luis 

El mié., 31 jul. 2019 a las 17:00, Martin O'Connor (<[hidden email]>) escribió:

Are you using the latest Protege 5.5 and 2.0.6 version of the SWRLTab plugin? If not, I would upgrade and try again.

Martin

On Jul 31, 2019, at 4:59 AM, Luis Enrique Ramos García <[hidden email]> wrote:



Dear friends, 

I am trying to do the following operation with swrl rules:

 ownershipStarted(?o, ?os) ^ todayIs(?o, ?ti) ^ temporal:before(?os, ?ti) -> propertyValidity(?o, true)


where ?o and ?ti correspond to dates in the format "2019-07-31T10:00:00"^^xsd:dateTime, related to ?o by datatype properties in protege 5. 


when I apply the rule, it seems it is not evaluated, but when I change variables by string values, as follows:



 ownershipStarted(?o, ?os) ^ todayIs(?o, ?ti) ^ temporal:before("2000-02-01T11:12:12.000", "2019-01-01T12:00:00") -> propertyValidity(?o, true)


the rule is evaluated and propertyValidity changes to true. 


The question is what I am doing wrong?, in both case it should work, but it seems something is going wrong when variables ?os and ?ti values are assigned. 


Thanks in advanced


Luis Ramos






_______________________________________________
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

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

Re: Fwd: rule with dates

Rimel
In reply to this post by Luis Enrique Ramos García
Hello,

I don't have any suggestion about your issue, but I have a question.

Yesterday I asked a question on how to recuperate the actual time (system
time) and store it in the data-property(Today).

I see that you do like this (today's(?o, ?ti)).

Please can you give me more details about your proposal

Thanks  a lot

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