Saturday, November 19, 2005

Google Base simple tricks

I was playing with Gbase, just browsing for content and I noticed that when you search for content that already has a lot of entries you can restrict the outcome of the search very much like you do in a structured database. For example when you look for jobs you notice that in top you have "Refine your search" and you can click for example "job type" and if you select for example "permanent" you get something like all jobs where job type is permanent. It is all above in the URL so it is very simple to mess around until you can guess what most of those things are doing up there.

From this:
http://base.google.com/base/search?q=jobs&a_r=1&nd=0&scoring=r&us=0&a_n194=job+type&a_y194=1&a_s194=0&a_o194=0&a_v194=permanent&a_v194=

You really just need:
http://base.google.com/base/search?a_n194=job+type&a_y194=1&a_o194=0&a_v194=permanent
to get the same effect. Basically this gets all entries with "job type" equal "permanent". The 194 is not even important as long as the number is equal in all of the variables.
So this also gives the same:
http://base.google.com/base/search?a_n1=job+type&a_y1=1&a_o1=0&a_v1=permanent
a_n[identifier]=NAME
a_v[identifier]=VALUE
a_y[identifier]= ? (I think it is a boolean of some sort)
a_o[identifier]= how to evaluate the value 0=equal 1=less than 2=greater than

You can add construction like this to get an AND construction but so far I did not find an equivalent to an OR construction. This is almost good enough to work with.

So all protein sequences from S.cerevisiae would be:
http://base.google.com/base/search?a_n1=sequence+type&a_y1=1&a_o1=0&a_v1=protein&a_n2=species&a_y2=1&a_o2=0&a_v2=s.cerevisiae