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 |
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 |
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: <http://semanticscience.org/resource/>. @prefix dbpedia: <http://dbpedia.org/resource/>. :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:
-- James P. McCusker III, Ph.D. _______________________________________________ protege-user mailing list [hidden email] https://mailman.stanford.edu/mailman/listinfo/protege-user |
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) Michael On Mon, Aug 7, 2017 at 5:16 AM, Marcelino Borges <[hidden email]> wrote:
_______________________________________________ protege-user mailing list [hidden email] https://mailman.stanford.edu/mailman/listinfo/protege-user |
Sorry guys. I meant the distance between two different objects o1 and o2. And my question was related to what Michael said. The distance between two objects can be viewed as a function that maps two object to a real number. This function can be viewed as a ternary relation, which related the two objects and the natural number that represents the distance between them, My problem is how to represent this ternary relation in OWL, since OWL can only represent binary relations. One of my ideas about this problem is similar to the solution provided by Michael, involving the reification of the notion of Distance. That is, my model would have: -A class "PhysicalObject" -A class "Distance" -An object property "hasReferenceObject", whose domain is "Distance" and whose range is "PhysicalObject" -A data property "hasLenght", whose domain is "Distance" and whose range is Double. With this model, for representing the fact that the distance between two objects "o1" and "o2" is 200, it is necessary to create an instance of Distance "d_o1_o2" and the assertion of the following relations: -"d_o1_o2" "hasReferenceObject" "o1" -"d_o1_o2" "hasReferenceObject" "o2" -"d_o1_o2" "hasLenght" 200 This seems to be aligned to the suggestion provided by Michael. But this seems to cause the inclusion of 4 assertions for representing the distance between each pair of objects. This causes a proliferation of assertions. There is a more parsimonious way of doing this? Best regards. 2017-08-07 10:57 GMT-03:00 Michael DeBellis <[hidden email]>:
_______________________________________________ protege-user mailing list [hidden email] https://mailman.stanford.edu/mailman/listinfo/protege-user |
What was suggested, and the similar approach you apply (both known as reification) are the minimal and the most straightforward approaches. However, you can automate insertion of the required assertions with programming, for example, Java with OWL API, or scripting, for example, in Ontology Preprocessing Language (OPPL2).
Cheers, Igor Sent: Monday, August 07, 2017 at 3:19 PM
From: "Marcelino Borges" <[hidden email]> To: "User support for WebProtege and Protege Desktop" <[hidden email]> Subject: Re: [protege-user] Representing distances between objects Sorry guys.
I meant the distance between two different objects o1 and o2.
And my question was related to what Michael said.
The distance between two objects can be viewed as a function that maps two object to a real number. This function can be viewed as a ternary relation, which related the two objects and the natural number that represents the distance between them, My problem is how to represent this ternary relation in OWL, since OWL can only represent binary relations.
One of my ideas about this problem is similar to the solution provided by Michael, involving the reification of the notion of Distance. That is, my model would have:
-A class "PhysicalObject"
-A class "Distance"
-An object property "hasReferenceObject", whose domain is "Distance" and whose range is "PhysicalObject"
-A data property "hasLenght", whose domain is "Distance" and whose range is Double.
With this model, for representing the fact that the distance between two objects "o1" and "o2" is 200, it is necessary to create an instance of Distance "d_o1_o2" and the assertion of the following relations:
-"d_o1_o2" "hasReferenceObject" "o1"
-"d_o1_o2" "hasReferenceObject" "o2"
-"d_o1_o2" "hasLenght" 200
This seems to be aligned to the suggestion provided by Michael.
But this seems to cause the inclusion of 4 assertions for representing the distance between each pair of objects. This causes a proliferation of assertions. There is a more parsimonious way of doing this?
Best regards.
2017-08-07 10:57 GMT-03:00 Michael DeBellis <[hidden email]>:
_______________________________________________ protege-user mailing list [hidden email] https://mailman.stanford.edu/mailman/listinfo/protege-user |
Free forum by Nabble | Edit this page |