Finding maximum value for a class?

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

Finding maximum value for a class?

Michael DeBellis-2
If I have a class with some data property is there any way I can use DL or SWRL to find the object with the greatest value. E.g., if I have Person with hasAge an integer could I have the class OldestPerson such that it is the individual(s) whose age is >= the age of all the other instances of Person? My guess is the answer is no, due to monotonicity or OWA but wanted to double check. 

Michael

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

Re: Finding maximum value for a class?

Matthew Horridge-2
Administrator
Hi Michael,

This is not possible using standard reasoning service (that the DL Query tab uses).  SWRL isn’t a query query language, but it might be possible to do this using Martin O’Conner’s SQWRL query language (he might chime in).  

With other tools, you could use SPARQL to query for the *known* ages of individuals and then order these descending and then pick the first one in the list (using limit).  This isn’t perfect, but it might provide you with satisfactory enough answers for your application.

Cheers,

Matthew



> On 15 May 2017, at 17:55, Michael DeBellis <[hidden email]> wrote:
>
> If I have a class with some data property is there any way I can use DL or SWRL to find the object with the greatest value. E.g., if I have Person with hasAge an integer could I have the class OldestPerson such that it is the individual(s) whose age is >= the age of all the other instances of Person? My guess is the answer is no, due to monotonicity or OWA but wanted to double check.
>
> Michael
> _______________________________________________
> 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: Finding maximum value for a class?

Igor Toujilov-2
You can recursively calculate maximum and minimum values (as well as other aggregation values) over a linked list of individuals with a help of simple SWRL rules, and then use DL Query. But the linked list should be well-formed, and some additional efforts are needed for maintaining the list.

Cheers,
Igor


> Sent: Tuesday, May 16, 2017 at 3:17 AM
> From: "Matthew Horridge" <[hidden email]>
> To: "User support for WebProtege and Protege Desktop" <[hidden email]>
> Subject: Re: [protege-user] Finding maximum value for a class?
>
> Hi Michael,
>
> This is not possible using standard reasoning service (that the DL Query tab uses).  SWRL isn’t a query query language, but it might be possible to do this using Martin O’Conner’s SQWRL query language (he might chime in).  
>
> With other tools, you could use SPARQL to query for the *known* ages of individuals and then order these descending and then pick the first one in the list (using limit).  This isn’t perfect, but it might provide you with satisfactory enough answers for your application.
>
> Cheers,
>
> Matthew
>
>
>
> > On 15 May 2017, at 17:55, Michael DeBellis <[hidden email]> wrote:
> >
> > If I have a class with some data property is there any way I can use DL or SWRL to find the object with the greatest value. E.g., if I have Person with hasAge an integer could I have the class OldestPerson such that it is the individual(s) whose age is >= the age of all the other instances of Person? My guess is the answer is no, due to monotonicity or OWA but wanted to double check.
> >
> > Michael
> > _______________________________________________
> > 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: Finding maximum value for a class?

Michael DeBellis-2
I've been using the List ontology at: http://lov.okfn.org/dataset/lov/vocabs/coll  I figured out how to recurse over it to do basic things like add up the times for each item (the real domain here is process modeling, e.g., for project plans). Its quite elegant, classic mathematical induction, one rule for the initial case and then another for all the rest. Still haven't figured out the best way to find the maximum but I think I'm getting there. 

But that brings me to another question I had last week. I imported the list ontology using the Direct Imports and then selecting "Import an ontology from the web" radio button and specifying the URI for the list ontology. A few days ago that particular ontology was not available online, I think they made some maintenance changes to it but it was unavailable for several hours. The problem was that my ontology that had the List as a direct import wouldn't open. It just hung trying to find the imported ontology. 

I would like to avoid this in the future. Especially if I send an ontology to other users I don't want them to get stuck. What I did instead once the List ontology was back up was to download the ontology and save it locally on my desktop, load that local ontology and then proceed to build on it. Now the imported ontology info shows up in Annotations. However, the List ontology also imports an ontology for error handling and that still shows up as a Direct Import (so I think there is still a risk that if the error handling ontology is offline, my ontology will be unusable).

My question is, what is the best way to import ontologies so that the reference info about the original ontology remains but so that there is no risk that if some imported ontology's site goes down that the ontology using it will be unusable?

Michael 

On Tue, May 16, 2017 at 2:59 PM, Igor Toujilov <[hidden email]> wrote:
You can recursively calculate maximum and minimum values (as well as other aggregation values) over a linked list of individuals with a help of simple SWRL rules, and then use DL Query. But the linked list should be well-formed, and some additional efforts are needed for maintaining the list.

Cheers,
Igor


> Sent: Tuesday, May 16, 2017 at 3:17 AM
> From: "Matthew Horridge" <[hidden email]>
> To: "User support for WebProtege and Protege Desktop" <[hidden email]>
> Subject: Re: [protege-user] Finding maximum value for a class?
>
> Hi Michael,
>
> This is not possible using standard reasoning service (that the DL Query tab uses).  SWRL isn’t a query query language, but it might be possible to do this using Martin O’Conner’s SQWRL query language (he might chime in).
>
> With other tools, you could use SPARQL to query for the *known* ages of individuals and then order these descending and then pick the first one in the list (using limit).  This isn’t perfect, but it might provide you with satisfactory enough answers for your application.
>
> Cheers,
>
> Matthew
>
>
>
> > On 15 May 2017, at 17:55, Michael DeBellis <[hidden email]> wrote:
> >
> > If I have a class with some data property is there any way I can use DL or SWRL to find the object with the greatest value. E.g., if I have Person with hasAge an integer could I have the class OldestPerson such that it is the individual(s) whose age is >= the age of all the other instances of Person? My guess is the answer is no, due to monotonicity or OWA but wanted to double check.
> >
> > Michael
> > _______________________________________________
> > 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


_______________________________________________
protege-user mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-user