[Developers] State Quarters example and "need a unique result to attach here"

Christopher R. Maden crism at metaweb.com
Fri Apr 4 20:58:56 UTC 2008


David Flanagan wrote:
> When I first wrote the US State Quarters example 
> (http://freebase.com/view/guid/9202a8c04000641f800000000544e10c#id2609142)
> I specified that the type of the us_state_quarter/state property was 
> /type/text
> 
> The example has been modified since I wrote it. It now expects the state 
> property to be /location/us_state, which is good.  In order to make this 
>   change work, however, the query in the python code had to change, and 
> I don't understand why. Since I don't get it, I'm obviously not 
> explaining something right about the MQL write grammar.

Names of things are not generally a good idea for connecting properties, 
as they are rarely unique (and will become less so as Freebase expands), 
and MQL shies away from being (or attempting to be) a DWIM system.

I would probably approach this specific problem in two passes: one to 
get the IDs of the states of the given name, and the second creating the 
quarters with

"state" : { "id" : state_id }

Among US states, names are very likely to be unique, but as an example, 
that is not a good general assumption.

~Chris
-- 
Christopher R. Maden
Data Architect
Metaweb Technologies, Inc.
<URL: http://www.metaweb.com/ >


More information about the Developers mailing list