[Developers] mediated properties
Christopher R. Maden
crism at metaweb.com
Thu Jun 28 18:51:39 UTC 2007
Steve Sak wrote:
> 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?
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
--
Christopher R. Maden
Data Architect
Metaweb Technologies, Inc.
<URL: http://www.metaweb.com/ >
More information about the Developers
mailing list