On Wed, Oct 19, 2005 at 12:35:04PM -0500, Pat Eyler wrote:

Opening up an old thread ...

> The Church has a lot of genealogical data that we want to make available 
> in ways that will be useful to church members and the wider world.  Our 
> biggest goal is always to help bring saving ordinances to the many, many 
> who have died without them.  To that end, there have been (and will be) 
> significant investments in Family History related IT.  There's a lot more 
> that can be done though, and we don't have the ideas, the people, or the 
> time to do it all.  We're looking to partner with others to fill those 
> gaps.  In some cases, we want to contribute to existing Free Software[3], 
> in other cases we want to enable people to write Free Software to fill the 
> niches (either by providing data, or APIs). In still others, we would love 
> to work with the community to enhance tools we're already building (or 
> thinking of building).  What do we want?  We want to work with the 
> community to provide the tools that will enable more (unique) ordinance 
> work to be done, releasing spirits from their prison.
> 
> Which brings us to data and APIs.  There's a *lot* of stuff sitting in the
> vault.  My understanding is that we want to get it all out there for the
> public to use[4].  How we get it out there is more nebulous.   Right now,
> there's a big opportunity to influence that set of decisions.  I think 
> 'the powers that be' would be very open to hearing requests for specific 
> kinds of data (and APIs to interact with it), especially when those 
> requests are:
>   a) well thought out
>   b) have some community support behind them
>   c) have a solid backing reason.
> 
> Does all of this still seem a bit nebulous?  I'm afraid that it probably 
> does but bear in mind that this is a long road, one which we've not gone 
> very far down.  This is a great time to get involved.  Again:
>  Think about what you'd like to see.
>  Think about how you'd make use of it.
>  Talk about it, here or on other mailing lists.
> 
> Your involvement will help shape the future.

As I thought about this, I realised that I had already devised an API
for accessing genealogical data, and that is the API which is
implemented in Gedcom.pm.  I happen to think that this is a rather good
interface.  It is based heavily on the GEDCOM format itself, which is
still the standard genealogical data interface format.

Since code speaks louder than words, I have coded up a web services
interface based on Gedcom.pm and it is currently sitting behind a
mod_perl enabled apache server.

I thought it was about time I threw it out to get some comments on its
usability or otherwise.  There was something of a debate over whether
the API should be RESTful, or whether it should be SOAP or XMLRPC based.
I have decided to go RESTful, in three delicious flavours: plain, XML
and JSON, but there is no reason other interfaces should not be added
using the same (or a very similar) API.

Enough chit chat - here is the module documentation.  The examples in
the EXMAPLES section should work, providing my server is up and running.
Try them out and let me know what you think.  If you don't have wget,
you could run them in a browser, but the output may be a little mangled
(hello IE!).

I'll try to make the formal release sometime between now and early new
year, depending on my network connectivity over that time, but if you
want to create some wonderful ajaxy app over Christmas and need the
source code so you don't have to worry about cross site scripting
problems and such, or because you want to make the code better, let me
know and I'll make snapshots available.  (At some point I'll provide
access to my SVK repository.)

Enjoy,


NAME
    Gedcom::WebServices - Basic web service routines for Gedcom.pm

    Version 1.1502 - 20th December 2005

SYNOPSIS
     wget -qO - http://www.example.com/ws/plain/my_family/i9/name

DESCRIPTION
    This module provides web service access to a GEDCOM file in conjunction
    with mod_perl.  Using it, A request for information can be made in the
    form of a URL specifying the GEDCOM file to be used, which information
    is required and the format in which the information is to be delivered. 
    This information is then returned in the specified format.

    There are currently three supported formats:

    *   plain - no markup

    *   XML

    *   JSON

  URLs
    The format of the URLs used to access the web services are:

     $BASEURL/$FORMAT/$GEDCOM/$XREF/requested/information
     $BASEURL/$FORMAT/$GEDCOM?search=search_criteria

    BASEURL
        The base URL to access the web services.

    FORMAT
        The format in which to return the results.

    GEDCOM
        The name of the GEDCOM file to use (the extension .ged is assumed).

    XREF
        The xref of the record about which information is required.  XREFs
        can be obtained initially from a search, and subsequently from
        certain queries.

    requested/information
        The information requested.  This is in the same format as that taken
        by the get_value method.

    search_criteria
        An individual to search for.  This is in the same format as that
        taken by the get_individual method.

EXAMPLES
     $ wget -qO - 
'http://pjcj.sytes.net:8585/ws/plain/royal92?search=elizabeth_ii'
     /ws/plain/royal92/I52

     $ wget -qO - http://pjcj.sytes.net:8585/ws/plain/royal92/I52
     0 @I52@ INDI
     1   NAME Elizabeth_II Alexandra Mary/Windsor/
     1   TITL Queen of England
     1   SEX F
     1   BIRT
     2     DATE 21 APR 1926
     2     PLAC 17 Bruton St.,London,W1,England
     1   FAMS @F14@
     1   FAMC @F12@

     $ wget -qO - http://pjcj.sytes.net:8585/ws/plain/royal92/I52/name
     Elizabeth_II Alexandra Mary /Windsor/

     $ wget -qO - http://pjcj.sytes.net:8585/ws/plain/royal92/I52/birth/date
     21 APR 1926

     $ wget -qO - http://pjcj.sytes.net:8585/ws/plain/royal92/I52/children
     /ws/plain/royal92/I58
     /ws/plain/royal92/I59
     /ws/plain/royal92/I60
     /ws/plain/royal92/I61

     $ wget -qO - http://pjcj.sytes.net:8585/ws/json/royal92/I52/name
     {"name":"Elizabeth_II Alexandra Mary /Windsor/"}

     $ wget -qO - http://pjcj.sytes.net:8585/ws/xml/royal92/I52/name
     <NAME>Elizabeth_II Alexandra Mary /Windsor/</NAME>

     $ wget -qO - http://pjcj.sytes.net:8585/ws/xml/royal92/I52
     <INDI ID="I52">
       <NAME>Elizabeth_II Alexandra Mary/Windsor/</NAME>
       <TITL>Queen of England</TITL>
       <SEX>F</SEX>
       <BIRT>
         <DATE>21 APR 1926</DATE>
         <PLAC>17 Bruton St.,London,W1,England</PLAC>
       </BIRT>
       <FAMS REF="F14"/>
       <FAMC REF="F12"/>
     </INDI>

CONFIGURATION
    Add a section similar to the following to your mod_perl config:

     PerlWarn On
     PerlTaintCheck On

     PerlPassEnv GEDCOM_TEST

     <IfDefine GEDCOM_TEST>
         <Perl>
             $Gedcom::TEST = 1;
         </Perl>
     </IfDefine>

     <Perl>
         use Apache::Status;

         $ENV{PATH} = "/bin:/usr/bin";
         delete @ENV{"IFS", "CDPATH", "ENV", "BASH_ENV"};

         $Gedcom::DATA = $Gedcom::ROOT;  # location of data stored on server

         use lib "$Gedcom::ROOT/blib/lib";
         use Gedcom::WebServices;

         my $handlers =
         [ qw
           (
               plain
               xml
               json
           )
         ];

         eval Gedcom::WebServices::_set_handlers($handlers);
         # use Apache::PerlSections; print STDERR Apache::PerlSections->dump;
     </Perl>

     PerlTransHandler Gedcom::WebServices::_parse_uri

BUGS
    Very probably.

    See the BUGS file.  And the TODO file.

VERSION
    Version 1.1502 - 20th December 2005

LICENCE
    Copyright 2005, Paul Johnson ([EMAIL PROTECTED])

    This software is free.  It is licensed under the same terms as Perl
    itself.

    The latest version of this software should be available from my
    homepage: http://www.pjcj.net


-- 
Paul Johnson - [EMAIL PROTECTED]
http://www.pjcj.net
_______________________________________________
Ldsoss mailing list
[email protected]
http://lists.ldsoss.org/mailman/listinfo/ldsoss

Reply via email to