[Developers] Results in [ ]

Arthur van Hoff AVH at zing.net
Fri Feb 1 09:29:17 UTC 2008


Thanks Christopher. I'm curious why the default is set to "id" for media types. The name (i.e. the mime type) would have been a very reasonable choice in this case. 

> -----Original Message-----
> From: developers-bounces at freebase.com [mailto:developers-
> bounces at freebase.com] On Behalf Of Christopher R. Maden
> Sent: Friday, February 01, 2008 1:09 AM
> To: For discussions about MQL,Freebase API and apps built on Freebase
> Subject: Re: [Developers] Results in [ ]
> 
> Arthur van Hoff <AVH at zing.net> wrote:
> > This may be a dumb question. Check out this query:
> >
> > For feed_media_format it returns an array of ids, but for the genre
> > property it returns an array of names (which is what I excepted in
> both
> > cases). Why the difference?
> 
> Not a dumb question, but a subtlety of MQL.
> 
> When asked to display a simple string form of a property value, MQL
> has some rules that it follows.
> 
> If the property has a simple value, like a text or integer value, it
> displays the value.
> 
> Then, for most link properties, it shows the display name of the
> linked object.  (This is why some CVT property values just show up as
> “null”; those CVTs don’t have display names.)
> 
> But for some types of linked objects, MQL will use a different
> property, rather than the name, to show a value.  Take a look at
> <URL: http://www.freebase.com/view/type/media_type?admin=1 >, the
> type expected by the feed_media_format property.  The default
> property is set to “id” — in other words, for any media type value,
> the ID of the target node will be given, rather than the English
> display name.
> 
> Generally, if one wants reliably an ID of a target or a name of a
> target, the query should be explicit about that:
> 
> "property":[{"id":null}]
> 
> or
> 
> "property":[{"name":null}]
> 
> Those will always do what is expected, regardless of any changes to
> the type definition.
> 
> ~Chris
> --
> Christopher R. Maden
> Data Architect
> Metaweb Technologies, Inc.
> <URL: http://www.metaweb.com/ >
> _______________________________________________
> Developers mailing list
> Developers at freebase.com
> http://lists.freebase.com/mailman/listinfo/developers


More information about the Developers mailing list