[Developers] type checking?

Arthur van Hoff AVH at zing.net
Sun Dec 2 02:03:28 UTC 2007


Hi,

 

When adding a genre to an podcast I accidentally picked National Public
Radio from the popup list. The expected type for the was
/user/cotton/default_domain/broadcast_genre, and NPR was not of that
type. Why does the site allow me to pick a topics that is not of the
correct type? Can't it restrict the list to just the valid type for that
property?

 

Now the NPR topic suddenly had an additional and wrong type. Why can any
object be so easily be coerced into an incompatible type? That seems
wrong/dangerous to me.

 

I then proceeded to remove the bad type from NPR. That worked. However,
my podcast still has a genre called NPR, and it is of the wrong type! 

 

Does freebase not force objects to be of the correct type? How can a
podcast have a genre that is not of the correct type? It would seem to
me that freebase should enforce type correctness. 

 

I was using the sandbox query:

{

  "query" : [

    {

      "/user/cotton/default_domain/broadcaster/broadcast_genres" : [

        {

          "name" : null,

          "type" : []

        }

      ],

      "id" : null,

      "name" : "Good Morning America"

    }

  ]

}

 

The result:

 

{
  "q1": {
    "code": "/api/status/ok", 
    "result": [
      {
        "/user/cotton/default_domain/broadcaster/broadcast_genres": [
          {
            "type": [
              "/common/topic", 
              "/business/employer", 
              "/business/company", 
              "/guid/9202a8c04000641f8000000004f29379", 
              "/user/dchwalisz/default_domain/public_radio_network", 
              "/music/genre"
            ], 
            "name": "National Public Radio"   
          }, 
          {
            "type": [
              "/common/topic", 
              "/broadcast/radio_format", 
              "/user/cotton/default_domain/broadcast_genre"
            ], 
            "name": "Talk radio"
          }
        ], 
        "id": "/guid/9202a8c04000641f800000000620b242", 
        "name": "Good Morning America"
      }
    ]
  }, 
  "status": "200 OK", 
  "code": "/api/status/ok"

}

 

Note that NPR is listed as a value for
"/user/cotton/default_domain/broadcaster/broadcast_genres", but that
field is supposed to be of type
"/user/cotton/default_domain/broadcast_genre", and it is not!

 

Have fun,

 

    Arthur

 

___________________________________________

Arthur van Hoff, CTO Software and Services, Dell-ZING

W: 650-267-2413, F: 650-267-2498, M: 650-283-0842

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freebase.com/pipermail/developers/attachments/20071201/d04b5835/attachment.htm 


More information about the Developers mailing list