# Representing distances between objects Classic List Threaded 6 messages Open this post in threaded view
|

## Representing distances between objects

 Hi.What is the best way of representing the distance between two objects?Let us suppose two objects o1 and o1. I would like to represent that the distance between these two objects is X. What is the best way of doing this?Best regards. _______________________________________________ protege-user mailing list [hidden email] https://mailman.stanford.edu/mailman/listinfo/protege-user
Open this post in threaded view
|

## Re: Representing distances between objects

 I think 0 (zero) would be the appropriate answer for the distance between o1 and o1  ;) However, if you meant o1 and o2 then it depends on the problem domain. For everyday objects the standard unit of measurement is the metre, but if the objects are well dispersed Km may be more appropriate. For things like the cities of the world, then distances along the great circles in Km would be appropriate. For astronomy light years or parsecs. For quantum mechanics nano-metres would be appropriate - but then the whole concept of distance becomes a bit fuzzy. Brenton On Mon, 2017-08-07 at 09:16 -0300, Marcelino Borges wrote: Hi. What is the best way of representing the distance between two objects? Let us suppose two objects o1 and o1. I would like to represent that the distance between these two objects is X. What is the best way of doing this? Best regards. ```_______________________________________________ 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
Open this post in threaded view
|

## Re: Representing distances between objects

 This should do the trick. Oddly, Units Ontology is missing length units bigger than a meter. I'm using the SIO labels subset to make it easier to read here, but they all map onto numeric identifiers for those who prefer that version.@prefix sio: .@prefix dbpedia: .:length-o1-o2 a sio:Length; sio:hasValue ?X; sio:hasUnit dbpedia:Kilometer; # or whatever else from units ontology. sio:inRelationTo :o2, :o1. On Mon, Aug 7, 2017 at 8:57 AM Brenton Ross <[hidden email]> wrote: I think 0 (zero) would be the appropriate answer for the distance between o1 and o1  ;) However, if you meant o1 and o2 then it depends on the problem domain. For everyday objects the standard unit of measurement is the metre, but if the objects are well dispersed Km may be more appropriate. For things like the cities of the world, then distances along the great circles in Km would be appropriate. For astronomy light years or parsecs. For quantum mechanics nano-metres would be appropriate - but then the whole concept of distance becomes a bit fuzzy. Brenton On Mon, 2017-08-07 at 09:16 -0300, Marcelino Borges wrote: Hi. What is the best way of representing the distance between two objects? Let us suppose two objects o1 and o1. I would like to represent that the distance between these two objects is X. What is the best way of doing this? Best regards. ```_______________________________________________ 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 -- James P. McCusker III, Ph.D.http://tw.rpi.edu/web/person/JamesMcCusker _______________________________________________ protege-user mailing list [hidden email] https://mailman.stanford.edu/mailman/listinfo/protege-user
Open this post in threaded view
|

## Re: Representing distances between objects

 In reply to this post by Marcelino Borges I interpreted Marcelino's question as being about how to represent it in OWL not whether to represent it in kilometers or miles. Marcelino, if that's what you meant then I don't think there is just one answer to your question. As with most "what is the best way to model X" questions the answer depends a lot on the applications, the domain, etc. But one common way to do it is to think of it as a 3 way relationship.  Since OWL only directly supports 2 way relations the most common way to represent it would be to create a new class to represent the relation. You could have a class called Distance with properties locationOne and locationTwo and a data property called hasLength for the actual length of the distance between each object.  For simplicity I'm just forgetting about the specific metric and assuming it's just an xsd:decimal. Also, assuming each object has an x and a y coordinate data property: xCoord, yCoord that are also just xsd:decimal, the extension for meters or whatever should be obvious. Then you could calculate hasDistance with the following SWRL rule:Distance(?d) ^ locationOne(?d, ?l1) ^ locationTwo(?d, ?l2) ^ xCoord(?l1, ?x1)  ^ yCoord(?l1, ?y1) ^ ... do the same for locationTwo... ^ ... do math to calculate distance between x-y coords of the two locations and put it in a parameter called ?dis -> hasDistance(?d, ?dis)MichaelOn Mon, Aug 7, 2017 at 5:16 AM, Marcelino Borges wrote:Hi.What is the best way of representing the distance between two objects?Let us suppose two objects o1 and o1. I would like to represent that the distance between these two objects is X. What is the best way of doing this?Best regards. _______________________________________________ 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