On Fri, Nov 18, 2005 at 10:10:51AM +0000, Dave Cross wrote:

> One of the interesting things I found out at last night's Web Frameworks 
> Night[1] in London was that Catalyst[2] has a driver which allows you to 
> use a Gedcom file as a model[3].
> 
> Haven't tried it yet, but it looks very interesting.

In a similar vein, I thought that Gedcom.pm seemed to be somewhat lacking in
buzzword compliance, so I decided it was about time we graduated to Web 2.0.
Woohoo!

I've done a little work recently on a web services module for Gedcom.  I think
the Gedcom.pm API is fairly good already, so building on that has been
reasonably straightforward.  At the moment there is a plain text interface as
well as XML and JSON.  I'm not sure whether I'll bother with SOAP.  It's all
very RESTful.  See how buzzword compliant we are becoming already?

So at the moment you do things like:

    $ wget -qO - 'http://wesley:8529/ws/plain/royal?search=elizabeth_ii'
    /ws/plain/royal/I9

    $ wget -qO - http://wesley:8529/ws/plain/royal/i9/name
    Elizabeth_II Alexandra Mary /Windsor/

    $ wget -qO - http://wesley:8529/ws/plain/royal/i9/birth/date
    Wednesday, 21st April 1926

    $ wget -qO - http://wesley:8529/ws/plain/royal/i9/children
    /ws/plain/royal/I11
    /ws/plain/royal/I15
    /ws/plain/royal/I19
    /ws/plain/royal/I23

    $ wget -qO - http://wesley:8529/ws/plain/royal/i9
    0 @I9@ INDI
    1   NAME Elizabeth_II Alexandra Mary/Windsor/
    1   TITL Queen of England
    1   SEX F
    1   BIRT
    2     DATE Wednesday, 21st April 1926
    2     PLAC 17 Bruton St.,London,W1,England
    1   FAMS @F6@
    1   FAMC @F4@
    1   RIN 10

    $ wget -qO - http://wesley:8529/ws/xml/royal/i9
    <INDI ID="I9">
      <NAME>Elizabeth_II Alexandra Mary/Windsor/</NAME>
      <TITL>Queen of England</TITL>
      <SEX>F</SEX>
      <BIRT>
        <DATE>Wednesday, 21st April 1926</DATE>
        <PLAC>17 Bruton St.,London,W1,England</PLAC>
      </BIRT>
      <FAMS REF="F6"/>
      <FAMC REF="F4"/>
      <RIN>10</RIN>
    </INDI>

    $ wget -qO - http://wesley:8529/ws/json/royal/i9
    
{"rec":{"xref":"I9","level":0,"tag":"INDI","items":[{"level":1,"pointer":"","value":"Elizabeth_II
 Alexandra 
Mary/Windsor/","tag":"NAME","items":[]},{"level":1,"pointer":"","value":"Queen 
of 
England","tag":"TITL","items":[]},{"level":1,"pointer":"","value":"F","tag":"SEX","items":[]},{"level":1,"tag":"BIRT","items":[{"level":2,"pointer":"","value":"Wednesday,
 21st April 1926","tag":"DATE","items":[]},{"level":2,"pointer":"","value":"17 
Bruton 
St.,London,W1,England","tag":"PLAC","items":[]}]},{"level":1,"pointer":1,"value":"F6","tag":"FAMS","items":[]},{"level":1,"pointer":1,"value":"F4","tag":"FAMC","items":[]},{"level":1,"pointer":"","value":10,"tag":"RIN","items":[]}]}}

The interface is basically the same as that of Gedcom.pm, so any data retrieval
method you could use in the module should be available in the web service.

At the moment it only supports GET, though I see no reason not to support POST
and/or PUSH, and DELETE, with appropriate safeguards.  It's also not quite
finished, but it is slowly moving forward.  I really need to make my svk
repository publicly available.

The next step, of course, would be to make some super duper AJAX app.  I'll
probably do a noddy one so we can tick another buzzword off the list.

I'll put something up so people can play with it and get some code out of the
door as soon as I can.  I'm hoping that having written this I will now do that
sooner rather than later.  Any comments about the interface and the direction
in which it should go would be most welcome.

-- 
Paul Johnson - [EMAIL PROTECTED]
http://www.pjcj.net

Reply via email to