Comparing properties of individuals

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

Comparing properties of individuals

martingrant
Hello. I need some help with Protege. I am trying to see if I can place
object properties between individuals of the same class based on their data
properties. For example saying if an object is left or right of another
object depending on their position:

A and B have data property "Position" which is a number.
A has position 0 and B has position 10.
I want to say that A is connected to B via object property "leftOf" if A's
Position < B's Position.

Is this possible? If so can someone show me how this can be implemented?

Thanks



--
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: Comparing properties of individuals

Michael DeBellis-2
I think the easiest way to do this would be with a SWRL rule.  The rule would look something like this:

hasPosition(?a, ?p1) ^ hasPosition(?b, ?p2) ^ swrlb:lessThan(?p1, ?p2) -> leftOf(?a, ?b)

Michael

Sent from my iPad

> On Oct 11, 2018, at 8:20 AM, martingrant <[hidden email]> wrote:
>
> Hello. I need some help with Protege. I am trying to see if I can place
> object properties between individuals of the same class based on their data
> properties. For example saying if an object is left or right of another
> object depending on their position:
>
> A and B have data property "Position" which is a number.
> A has position 0 and B has position 10.
> I want to say that A is connected to B via object property "leftOf" if A's
> Position < B's Position.
>
> Is this possible? If so can someone show me how this can be implemented?
>
> Thanks
>
>
>
> --
> 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: Comparing properties of individuals

martingrant
Hi Michael,

This is exactly what I needed and it works, thanks so much! I had to get the
Pellet reasoner first as it seemed the default Hermit one could not handle
the swrlb operator.

Thanks



--
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