[Developers] what is wrong with this write?

Arthur van Hoff AVH at zing.net
Fri Jul 4 15:51:10 UTC 2008


Hi Edward,

When you create a new /location/mailing_address using
create:unless_exists, Freebase first tries to find an existing mailing
addresses that could match. The only unambiguous property that you
provide is the state_privence_region:/en/quebec. As it turns out there
are multiple mailing addresses that match that, and therefore the write
fails.

Since the mailing address is a CVT object, you can usually use
create:unconditional instead. This way a new address is created each
time and it won't be shared with other headquarters. This has the
(somewhat dubious) advantage that you can modify the mailing address
without affecting others since it is (supposedly) not shared.
Unfortunately, nothing stops you from sharing a CVT object anyway.

Hope that helps.

Have fun,

    Arthur
	
> -----Original Message-----
> From: developers-bounces at freebase.com [mailto:developers-
> bounces at freebase.com] On Behalf Of Edward Kawas
> Sent: Friday, July 04, 2008 5:23 PM
> To: developers at freebase.com
> Subject: [Developers] what is wrong with this write?
> 
> Hi,
> 
> I am confused and probably missing something fundamental, but what is
> wrong
> with this write statement(and how can I fix it)?
> 
> [
>   {
>     "headquarters" : [
>       {
>         "citytown" : [
>           {
>             "create" : "unless_exists",
>             "id" : null,
>             "name" : "FooTownCanada2",
> 
>           }
>         ],
>         "create" : "unless_exists",
>         "postal_code" : [
>           {
>             "create" : "unless_exists",
>             "name" : "v4r 5t8",
>           }
>         ],
>         "state_province_region" : [
>           {
>             "country" : [
>               {
>                 "id" : "/en/canada"
>               }
>             ],
>             "id" : "/en/quebec"
>           }
>         ],
>         "street_address" : [
>           {
>             "connect" : "insert",
>             "lang" : "/lang/en",
>             "value" : "12345 Fort McMurray Drive"
>           }
>         ],
>         "type" : "/location/mailing_address"
>       }
>     ],
>     "id" : "/en/amgen",
>     "type" : "/business/company"
>   }
> ]
> 
> Basically, I want to insert a new Headquarters for a company, any
> company
> ... thanks.
> 
> Eddie
> 
> _______________________________________________
> Developers mailing list
> Developers at freebase.com
> http://lists.freebase.com/mailman/listinfo/developers


More information about the Developers mailing list