[Developers] Freebase newbie: simple question

Vishal Talwar rawlatv at gmail.com
Thu Feb 26 02:20:51 UTC 2009


I'd also like to put in a good word for the excellent MQL documentation
regarding pattern matching and the entire family of operators you can use in
addition to * at
http://mql.freebaseapps.com/<http://mql.freebaseapps.com/ch03.html#textconstraints>
ch03.html#textconstraints<http://mql.freebaseapps.com/ch03.html#textconstraints>.

Vishal

On Wed, Feb 25, 2009 at 5:26 PM, Pito Salas <rps at salas.com> wrote:

> Hi Shawn
>
> Do you know the httparty gem. It makes it really easy to do what we need
> here.
>
> So... What if I wanted any US states that have the letters "mass" in
> their name? Is there magic syntax for thatz?
>
> Thanks again!
>
> Pito
>
> > require 'net/http'
> >
> > query_string =
> >
> '{"query":{"country":{"id":"/en/united_states"},"iso_3166_2_code":null,"name":"Massachusetts","type":"/location/administrative_division"}}'
> > query_uri = URI.parse('
> http://www.freebase.com/api/service/mqlread?query=' +
> > URI.escape(query_string))
> > result = Net::HTTP.get(query_uri)
> >
> > Then it's just a matter of parsing the JSON, getting the value of
> > iso_3166_2_code and removing the "US-" from the beginning.
> >
> > Shawn
> >
> >
> > _______________________________________________
> > Developers mailing list
> > Developers at freebase.com
> > http://lists.freebase.com/mailman/listinfo/developers
> >
> >
> _______________________________________________
> Developers mailing list
> Developers at freebase.com
> http://lists.freebase.com/mailman/listinfo/developers
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freebase.com/pipermail/developers/attachments/20090225/a89b8d7f/attachment.htm 


More information about the Developers mailing list