<?xml version="1.0" encoding="UTF-8"?>
<essay xml:lang="en" version="5.0" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:dcterms="http://purl.org/dc/terms/" xmlns:gal="http://norman.walsh.name/rdf/gallery#" xmlns:foaf="http://xmlns.com/foaf/0.1/">
<info>
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
<title>XML+XQuery+Google Voice+Python=WIN!</title><biblioid class="uri">http://norman.walsh.name/2009/09/01/gvcall</biblioid>
<volumenum>12</volumenum>
<issuenum>27</issuenum>
<pubdate>2009-09-01T09:45:54-04:00</pubdate>
<author>
      <personname>
<firstname>Norman</firstname>
	<surname>Walsh</surname>
</personname>
    </author>
<copyright>
      <year>2009</year>
      <holder>Norman Walsh</holder>
    </copyright>
<abstract>
<para>It's finally possible to put all the pieces together.</para>
</abstract>
<dc:subject rdf:resource="http://norman.walsh.name/knows/taxonomy#GoogleVoice"/>
<dc:subject rdf:resource="http://norman.walsh.name/knows/taxonomy#MarkLogic"/>
<dc:subject rdf:resource="http://norman.walsh.name/knows/taxonomy#RDF"/>
</info>

<para xml:id="p1">I've been storing my
<wikipedia page="Personal_information_manager">PIM</wikipedia>
data (contacts, appointments, etc.)
in XML <link xlink:href="/2005/12/16/pimExample">for ages</link>
(and I do mean <emphasis xlink:href="http://nwalsh.com/docs/presentations/extreme2002/">ages</emphasis>!). Since my
<wikipedia page="Palm_(PDA)">Palm</wikipedia> days, I've been translating
whatever native format my PIM supports into XML. Where necessary (i.e. everywhere),
I've used an RDF/N3-like annotation mechanism to support additional metadata.
</para>

<para xml:id="p2">For example, the “notes” field for the XProc telcon looks like this:</para>

<programlisting>rdf:
p:class telcon
p:access public
p:phone #w3c-zakim
p:code 97762#</programlisting>

<para xml:id="p3">That gets parsed into the obvious XML by the conversion process:</para>

<programlisting>&lt;p:class&gt;telcon&lt;/p:class&gt;
&lt;p:access&gt;public&lt;/p:access&gt;
&lt;p:phone&gt;#w3c-zakim&lt;/p:phone&gt;
&lt;p:code&gt;97762#&lt;/p:code&gt;</programlisting>

<para xml:id="p4">(The phone number “<literal>#w3c-zakim</literal>” means that there's
an entry in my address book with the ID “<literal>w3c-zakim</literal>”.
Why do none of the PIM applications understand that appointments and contacts
are related!?)</para>

<para xml:id="p5">I've been doing this for years
<emphasis>because it's The Right Thing™</emphasis>, even though I've
only been able to wring small (er, tiny, perhaps miniscule) amounts of
practical value from it.</para>

<para xml:id="p6">But no more!</para>

<para xml:id="p7">The XML data is stored in my own
<link xlink:href="http://www.marklogic.com/product/marklogic-server.html">MarkLogic
Server</link> instance (moving from a collection of
<wikipedia>Perl</wikipedia> hacks to the server
was one of my first personal projects after I joined
<link xlink:href="http://www.marklogic.com">Mark Logic</link>). I now have
a <link xlink:href="http://www.google.com/googlevoice/about.html">Google
Voice</link> number. And <personname>
      <firstname>Scott</firstname>
<surname>Hillman</surname>
    </personname>’s
<link xlink:href="http://everydayscripting.blogspot.com/2009/08/python-google-voice-mass-sms-and-mass.html">Python scripts</link>
finally let me connect all the dots<footnote>
      <para xml:id="p8">Well,
technically, reconnect, but for all it's coolness, I never got much
use out of <link xlink:href="/2003/11/05/tel">the DTMF auto dialer</link>.
</para>
    </footnote>!</para>

<para xml:id="p9">A little
<wikipedia page="Python_(programming_language)">Python</wikipedia>
hacking, a quick <wikipedia>XQuery</wikipedia> module,
and I can make calls from a shell window.</para>

<screen>$ call xproc
W3C XProc WG
+1-617-761-6200 97762#

Dialing +1-617-761-6200...</screen>

<para xml:id="p10">The call query searches both the appointments on today's
calendar and the address book. That means “<command>call seth</command>” works equally
well, and calls my boss. For contacts with more than one phone number,
I can add “<literal>-<replaceable>phone</replaceable></literal>” on
the end: “<command>call ndw@nwalsh.com -home</command>”
would call me at home, should I ever
want to do that.
</para>

<para xml:id="p11">It's a tiny little thing, but it feels <emphasis>great</emphasis>.</para>

<para xml:id="p12">I'm easily amused, I know.</para>

<para xml:id="p13">Hmm. I should add an option to send SMS messages, too…</para>

</essay>

