<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Hayden,<br>
<br>
I'm not sure if procedural languages really pose that much of a
problem. The Freebase data is object-oriented so it would be hard to <i>not</i>
to interact with it in an object-oriented way. Most popular languages
like Ruby, Perl, Python, Lisp, JavaScript and C contain the proper
semantic for dealing with Objects even if they are not strictly
object-oriented languages.<br>
<br>
I agree that the ability to send multiple queries is very important and
I currently support them in my API by passing and array of Query
objects to the ReadService.read() method. Each Query object can be
named, modified and re-sent as many times as necessary.<br>
<br>
Vishal's comment about allowing parameterizable queries is very true. I
had overlooked that feature in my own design but I'm thinking of adding
it now (I'm benefiting from this discussion already =). I think that
the common trend in SQL is to represent query parameters with a ?
symbol and then get and set their values using an integer index. So,
the first ? might be $1, and the second ? would be $2 etc.<br>
<br>
Handling authentication cleanly could be a tricky feature for API
developers. Part of the reason why I have broken my design down into a
ReadService and a WriteService is to allow people to make read queries
without having to authenticate. At some point I will probably add a
TransService to round out the feature set. I would suspect that once
the Metaweb software becomes available there will be some databases
that will allow anonymous authentication a la Wikipedia so thats
definitely something to keep in mind.<br>
<br>
I like the idea of a /modules/framework type on Freebase. Something
similar to what the Metaweb guys have done with
/freebase/metaweb_application.<br>
<br>
Shawn Simister<br>
<br>
Hayden Stainsby wrote:
<blockquote
 cite="mid:F3625A29-1259-4CF6-9D8D-CBC27A3019DF@caffeineconcepts.com"
 type="cite">Firstly Perl module stuff (skip if you're not interested
in Perl):
  <br>
I'm hoping to release my Perl module to CPAN at some point this week,
however at this point it's likely to be just Metaweb, not Net::Metaweb,
as the guys on the modules mailing list pointed out that Net::* isn't
the right place for it and I can't find another namespace that matches
what it does. Sorry to Kirsten and anyone else who has started using it
- any existing code will have to change to reflect the new namespace,
I'll update everyone when it's ready.
  <br>
  <br>
Next general Metaweb module stuff:
  <br>
  <br>
I agree it would be worthwhile agreeing to some sort of standard set of
functionality that would work across languages. The difficulty of
course is in creating a set of guidelines that make sense for both
procedural and object orientated languages.
  <br>
  <br>
I started off looking at a concept similar to Shawn's, but found that
it meant giving up MQL's ability to send multiple queries in one
envelope. So I'm working on a structure for sending a query that is a
little more complex (one method call or so), but I think that even a
programmer fairly new to Perl should be able to get it up and running
fairly quickly.
  <br>
  <br>
In brief Perl-ish syntax:
  <br>
  <br>
$handle = Metaweb-&gt;new( server / login details here );
  <br>
$handle-&gt;add_read_query( query here );
  <br>
$handle-&gt;send_read_envelope;
  <br>
  <br>
You then access your queries by name. The important point being that
you can send multiple named queries (or a single query using the
default name if you don't specify a name) using the same calls.
  <br>
  <br>
You then also need a separate method/function to access the trans
service to fetch pictures and body text. But that's pretty straight
forward, all you need to use there is the translation type and the guid
of the object you're fetching.
  <br>
  <br>
The last thing that I think is worth mentioning is that we need to
incorporate the fact that read queries will be able to be performed
without authentication (as far as I can tell) once Freebase reaches
beta, and I suppose it's possible that some other Metaweb instance may
come along that doesn't require any authentication at all.
  <br>
  <br>
I've suggested creating a type for Metaweb libraries / modules /
frameworks under the Types -&gt; Freebase section along with a
suggested setup in my own namespace, if anyone has any suggestions
please let me know.
  <br>
  <br>
As far as my module goes I'm planning on adding an further abstraction
(possibly even as a separate module) that allows developers to work
without using MQL, but view Metaweb as a pure tree-like structure - in
a way it will be programatically like the Cinespin application featured
in the developers section.
  <br>
  <br>
Sorry for my long winded post - I hope it didn't send too many people
to sleep.
  <br>
  <br>
--
  <br>
Hayden
  <br>
  <br>
#!/usr/bin/perl
  <br>
chop($_=&lt;&gt;);@s=split/ /;foreach$m(@s){if($m=='*'){$z=pop@t;$x=
  <br>
pop@t;$a=eval"$x$m$z";push@t,$a;}else{push@t,$m;}}print"$a\n";
  <br>
# <a class="moz-txt-link-freetext" href="http://occasionallyhuman.net/">http://occasionallyhuman.net/</a>
  <br>
#9202a8c04000641f80000000054c75be
  <br>
</blockquote>
<br>
</body>
</html>