[Developers] invert and sort by mediated property values

John Giannandrea jg at metaweb.com
Sat May 30 05:07:20 UTC 2009


Jack Alves wrote:
> Here's what I want to do in plain language: find all connections to  
> Nicole Kidman that are in the popstra domain and sort the whole list  
> by a relevance integer value common to all connections. Return the  
> name of the connection, and info about the mediator topics including  
> name, id, image, and common relevance values.

Assuming all your popstra mediators are connected one way, something  
like this might be a good place to start...

[{
   "type": "/type/link",
   "source": {
     "id": "/en/nicole_kidman"
   },
   "target": {
     "/base/popstra/sww_base/interest": null,
     "/type/reflect/any_master": [{
       "type": "/common/topic",
       "name": null,
       "id":   null
     }]
   },
   "master_property": {
     "name": null,
     "schema": {
       "limit":  0,
       "domain": "/base/popstra"
     }
   },
   "sort": "target./base/popstra/sww_base/interest"
}]

Remember also that to get images, the id of the topic is sufficient,  
you can just link to a URL like:

http://api.freebase.com/api/trans/image_thumb/en/nicole_kidman

-jg



More information about the Developers mailing list