[Developers] Stupid perl question

Paul Tomblin ptomblin at xcski.com
Wed Sep 12 21:54:41 UTC 2007


Quoting Christopher R. Maden (crism at metaweb.com):
> Paul Tomblin wrote:
> >I'm trying to adapt the code in 4.1.1. in the "Developing Metaweb-Enabled
> >Web Applications"[1], but I can't figure out how to specify multiple
> >returns?  My query currently looks like:
> >
> >my $query = {
> >  type => "/user/ptomblin/default_domain/waypoint",
> >  name => undef,
> >  aviationid => undef,
> >  id => undef,
> >  state_province => undef,
> >  waypoint_type => undef,
> >  "/location/location/geolocation" => {
> >    latitude => undef,
> >    longitude => undef
> >  }
> >};
> 

I forgot to mention that is wrapped in:
my $envelope = { # This is the outer envelope object
  waypointQuery => {
    query =>  $query  # The "query" property of inner envelope holds query
  } # End of inner envelope
}; # End of outer envelope


> I’m not sure what API you’re using to send the query, but can you try:

http://www.freebase.com/api/service/mqlread?queries=

> my @querylist = ( $query );
> 
> and then pass @querylist instead?

No, that doesn't do anything.  Oh, but changing the "query =>" line to 
    query => [ $query ]
works.  Funny, I thought I'd tried that already.  Thanks for the hint.

-- 
Paul Tomblin <ptomblin at xcski.com> http://blog.xcski.com/
        "Legacy (adj): an uncomplimentary computer-industry epithet that
         means 'it works'."  -- Anthony de Boer


More information about the Developers mailing list