<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=UTF-8" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
<br>
I want to add that checking by is only valid if you know you're coming
in and out on the same property (as is the case with marriage) - if the
properties are different, you need to look at master/reverse properties
because you can imagine a director who also produced a movie - if you
were just going by ids, looking at the relationship of<br>
<br>
"Who is the <i>director</i> of this movie <i>produced by</i> Martin
Scorsese?" - you might get Martin Scorsese back, but that doesn't mean
that "director" is the reverse of "produced by".<br>
<br>
Alec<br>
<br>
Christopher R. Maden wrote:
<blockquote cite="mid:4684033B.9020409@metaweb.com" type="cite">
  <pre wrap="">Steve Sak wrote:
  </pre>
  <blockquote type="cite">
    <pre wrap="">To restate the question: given a mediator object how do I determine
which property is the one it's mediating?  For example, type A has a
mediator M that has a bunch of properties mediates between A and another
object.  How do I determine which property of M is the one that points
to the other object being mediated?
    </pre>
  </blockquote>
  <pre wrap=""><!---->
Mediators, or compound value types, are not especially different from 
any other type; the UI treats them a little differently, but that’s it.

But I think you are asking about instances rather than types, correct? 
In other words, Arnold Schwarzenegger connects to a marriage, and that 
marriage connects to two people, both Arnold Schwarzenegger and Maria 
Shriver.  How can you tell which of the spouses is the one you started from?

The only way to do that, really, is by looking at the IDs.

{
   "query": {
     "id": null,
     "name": "Arnold Schwarzenegger",
     "spouse_s": [
       {
         "spouse": [
           {
             "id":null,
             "name":null
           }
         ],
         "type":"/people/marriage"
       }
     ],
     "type":"/people/person"
   }
}

{
   "result": {
     "spouse_s": [
       {
         "spouse": [
           {
             "id": "#9202a8c04000641f80000000001da07e",
             "name": "Maria Shriver"
           },
           {
             "id": "#9202a8c04000641f8000000000006567",
             "name": "Arnold Schwarzenegger"
           }
         ],
         "type": "/people/marriage"
       }
     ],
     "type": "/people/person",
     "id": "#9202a8c04000641f8000000000006567",
     "name": "Arnold Schwarzenegger"
   }
}

You can see that one of the spouses in the marriage has the same ID as 
the person with whom you started, and that the other is different.

Unfortunately, there’s not really an automatic way to say “get all of 
the values of these properties except the ones that point back to the 
parent within the scope of this query.”

HTH,
Chris
  </pre>
</blockquote>
<br>
</body>
</html>