[Developers] [Fwd: mediated properties]

Alec Flett alecf at metaweb.com
Thu Jun 28 18:48:31 UTC 2007


You need to look at the master and reverse properties of the link

This query might help, try this in the query editor:
{
  "query":{
    "expected_type":{
      "id":null,
      "properties":[{
        "id":null,
        "master_property":null,
        "reverse_property":null
      }]
    },
    "id":"/film/film/starring",
    "type":"/type/property"
  }
}

Here's the result:
{
  "code":"/api/status/ok",
  "result":{
    "expected_type":{
      "id":"/film/performance",
      "properties":[{
        "id":"/film/performance/actor",
        "master_property":null,
        "reverse_property":"/film/actor/film"
      },{
        "id":"/film/performance/film",
        "master_property":null,
        "reverse_property":"/film/film/starring"
      },{
        "id":"/film/performance/part",
        "master_property":null,
        "reverse_property":null
      },{
        "id":"/film/performance/note",
        "master_property":null,
        "reverse_property":null
      }]
    },
    "id":"/film/film/starring",
    "type":"/type/property"
  }
}

Notice that /film/film/starring is the reverse of /film/performance/film 
-  You do have to check both master AND reverse - this example you only 
have to check reverse, but if the direction of the link was the other 
way around, it would show up in master_property, not reverse_property.

Alec

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?
>
> -------- Original Message --------
> Subject: 	mediated properties
> Date: 	Wed, 27 Jun 2007 20:22:30 -0400
> From: 	Steve Sak <ssak at appliedminds.com>
> Organization: 	Applied Minds, Inc.
> To: 	developers at freebase.com
>
>
>
> How do you get the the expected value for a types' mediated properties? 
> For instance, the sibling_s or spouse_s properties of  /people/person:  
> "*":null gives back an array of nulls where each "null" represents some
> underlying value.  "*":{} will show id, type, and name where the id
> refers to the mediator object (e.g. /person/marriage) but then how does
> one determine within that object which is the master property (e.g., the
> reference to the /people/person object representing the sibling or spouse?
>
>
>   



More information about the Developers mailing list