Score +1

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

Score +1

Rimel
Hello,

With SWRL Builtins can we add + 1 in a data property.

For example, I want to calculate the occurrence of data value that achieves
the threshold. The rule I Want to propose is something like this:

Patient(?p)^temperature(?t)^has-measure(?p,?t)^has-value(?t,?v)^has-maxthreshold(?t,?th)^detected-in(?t,?i)^swrlb:greaterOrequalThan(?v,?th)->has-score(?t,
?s+1)

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: Score +1

Michael DeBellis-2
Rimel, I don't think SWRL will do what you want it to unfortunately. First though, there were some things in your rule that seemed a bit odd to me. The first two expressions: 

Patient(?p)^temperature(?t) 

Will probably not do what you expect them to do. My guess is you are trying to get a temperature associated with an individual patient. If that is the case the expression above won't do that. Instead it will iterate through all the instances of the Patient class and all the instances of the temperature class each time binding ?p and ?t to a different instance. I would expect something like: 

Patient(?p) ^ hasTemperature(?p, ?t)   

Where hasTemperature is a data property with domain Patient and Range a real number. Similarly,  with the consequent of your rule: "has-score(?t,
?s+1)"  You can't do that in SWRL. What you need to do is to first on the left hand side use the SWRL bultin: swrlb:add(?s, 1). The SWRL builtins can be found here:  https://www.w3.org/Submission/SWRL/  

The bigger issue though is that if I'm understanding what you want to do, you want to use the rule to iteratively change the value of some property. I.e., every time the rule fires you add one to the property. If that's the case SWRL can't do that. That is what's called non-monotonic reasoning. It seems straight forward since virtually all programming languages work that way but SWRL is a logical language and doesn't support non-monotonic reasoning. I suggest you look at this presentation: https://protege.stanford.edu/conference/2009/slides/SWRL2009ProtegeConference.pdf   Especially slides 23-26.

Also, you might want to check out my SWRL tutorial: https://symbolicshacker.blogspot.com/2017/06/swrl-process-modeling-tutorial.html  

Michael

On Tue, Aug 13, 2019 at 11:56 AM Rimel <[hidden email]> wrote:
Hello,

With SWRL Builtins can we add + 1 in a data property.

For example, I want to calculate the occurrence of data value that achieves
the threshold. The rule I Want to propose is something like this:

Patient(?p)^temperature(?t)^has-measure(?p,?t)^has-value(?t,?v)^has-maxthreshold(?t,?th)^detected-in(?t,?i)^swrlb:greaterOrequalThan(?v,?th)->has-score(?t,
?s+1)

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