[Developers] index of null, default ordering?

Christopher Dummy christopher.dummy at gmail.com
Thu Feb 28 16:54:40 UTC 2008


If I ask for the set of properties on an item. What is the default
ordering of those items? I would have thought it would be by the
"index". It isn't, and I can't seem to figure out what the ordering
is. Does the UI when it queries all the properties add  "sort":"index"
for each of the properties? How does it do the sorting and ordering?
Also, how does a property get the index of null? It seems like the
items would get an index according to them being added. If someone
adds a new one, it would get the last index.

This is the item I'm looking at (specifically the Genres)

http://www.freebase.com/view/guid/9202a8c04000641f8000000006aa0acb

You can see the ordering I'm talking about by the query:

{  "query" : [ {
      "/user/cotton/default_domain/broadcast/genre" : [   {
          "guid" : null,
          "index" : null,
          "name" : null  } ],
      "id" : "/guid/9202a8c04000641f8000000006aa0acb",
      "name" : null,
      "type" : "/user/cotton/default_domain/internet_station"
    }  ]  }

Gives the results:

"result": [
      {
        "type": "/user/cotton/default_domain/internet_station",
        "id": "/guid/9202a8c04000641f8000000006aa0acb",
        "/user/cotton/default_domain/broadcast/genre": [
          {
            "index": 1,
            "guid": "#9202a8c04000641f8000000000032ba7",
            "name": "Rock music"
          },
          {
            "index": 0,
            "guid": "#9202a8c04000641f8000000000031329",
            "name": "Pop music"
          },
          {
            "index": null,
            "guid": "#9202a8c04000641f8000000006ac8bf9",
            "name": "Eclectic"
          }
        ],
        "name": "Radio Paradise"
      }
    ]

-- 
Christopher Cotton
Zing/Dell Engineer
http://zing.net/


More information about the Developers mailing list