[Developers] any_reverse?
Darin Wilson
darin at metaweb.com
Wed Dec 5 20:24:12 UTC 2007
/type/reflect/any_master asks for outgoing properties of the topic,
so the query you have below is asking for the "/user/cotton/
default_domain/broadcaster/broadcasts" property that's hanging off
"ABC News". Since "ABC News" is a broadcast and not a broadcaster,
this doesn't work.
I think what you're looking for is:
{
"query" : [
{
"/type/reflect/any_master" : [
{
"link" : {
"master_property" : "/user/cotton/default_domain/
broadcast/broadcaster"
},
"name" : null,
"optional" : true
}
],
"name" : "ABC News",
"type" : "/user/cotton/default_domain/podcast"
}
]
}
which is equivalent to:
{
"query" : [
{
"name" : "ABC News",
"type" : "/user/cotton/default_domain/podcast",
"/user/cotton/default_domain/broadcast/broadcaster" : {
"name" : null,
"optional" : true
}
}
]
}
Darin
On Dec 5, 2007, at 11:27 AM, Arthur van Hoff wrote:
> I'm still not having any luck with this. Do you mean this?
>
> "query": [{
> "name": "ABC News",
> "id": null,
> "type": "/user/cotton/default_domain/podcast",
> "/type/reflect/any_master": [{
> "optional":true,
> "name": null,
> "link": {
> "master_property":
> "/user/cotton/default_domain/broadcaster/broadcasts"
> }
> }]
> }]
>
> This also does not return the expected link...
>
> -----Original Message-----
> From: developers-bounces at freebase.com
> [mailto:developers-bounces at freebase.com] On Behalf Of John Giannandrea
> Sent: Wednesday, December 05, 2007 10:12 AM
> To: For discussions about MQL,Freebase API and apps built on Freebase
> Subject: Re: [Developers] any_reverse?
>
>
> Arthur,
> the master property in this case is broadcasts, so you want "/type/
> reflect/any_master" not "any_reverse"
>
> which one is master depends on how the schema was built. this schema
> viewer displays a little [m] for the master side.
> http://mjtemplate.org/examples/schemas/type.html?id=/user/cotton/
> default
> _domain/broadcaster
>
> -jg
>
>
> On Dec 5, 2007, at 9:55 AM, Arthur van Hoff wrote:
>
>> I am trying to write a query to find the broadcaster for a podcast
>> without inverting the query. I am guess that I can use
>> "any_reverse", but the query below is not working for me and I can't
>> find a good explanation of how it is supposed to work. Any
>> suggestions on what I might be doing wrong?
>>
>> "query": [{
>> "name": "ABC News",
>> "type": "/user/cotton/default_domain/podcast",
>> "/type/reflect/any_reverse": [{
>> "optional":true,
>> "name": null,
>> "link": {
>> "master_property": "/user/cotton/default_domain/
>> broadcaster/broadcasts"
>> }
>> }]
>> }]
>>
>> PS: I know there is a back pointer "/user/cotton/default_domain/
>> broadcast/broadcaster" which makes this easy, but I am trying to
>> understand how to do it the hard way.
>> ___________________________________________
>> Arthur van Hoff, CTO Software and Services, Dell-ZING
>> W: 650-267-2413, F: 650-267-2498, M: 650-283-0842
>>
>> _______________________________________________
>> Developers mailing list
>> Developers at freebase.com
>> http://lists.freebase.com/mailman/listinfo/developers
>
> _______________________________________________
> Developers mailing list
> Developers at freebase.com
> http://lists.freebase.com/mailman/listinfo/developers
> _______________________________________________
> Developers mailing list
> Developers at freebase.com
> http://lists.freebase.com/mailman/listinfo/developers
More information about the Developers
mailing list