What's new? | Help | Directory | Sign in
Google
                
Search
for
Updated Mar 18, 2008 by rossfsinger
Labels: atompub, strawman, api, actor
AtomPubActorResource  
Actor API

Actor/Patron/Borrower

I prefer the term 'Actor' in this context. Since Jangle isn't intended to exclusively front ILS-style systems, the term 'Patron' (or 'Borrower') seems incorrect. Not only does it imply a specific interaction/role, it also semantically assumes it is a singular person.

Service Document

GET /koha/services/actor/

<?xml version="1.0" encoding='utf-8'?>
<service xmlns="http://www.w3.org/2007/app"
         xmlns:atom="http://www.w3.org/2005/Atom">
  <workspace>
    <atom:title>Koha ILS - Actor</atom:title>
    <collection
        href="http://example.org/koha/actor" >
      <atom:title>Actor</atom:title>
      <accept>text/x-vcard</accept>
    </collection>
    <collection
        href="http://example.org/koha/actor/{actor}/authenticate" >
      <atom:title>Actor/Authenticate</atom:title>
    </collection>
    <collection
        href="http://example.org/koha/actor/{actor}/items" >
      <atom:title>Actor/Items</atom:title>
      <categories fixed="yes"
        scheme="http://jangle.org/terms/">
        <atom:category term="recall" />
        <atom:category term="hold" />
        <atom:category term="checked-out" />
        <atom:category term="bookmark" />
      </categories>      
    </collection>
    <collection
        href="http://example.org/koha/actor/{actor}/status" >
      <atom:title>Actor/Status</atom:title>
    </collection>
  </workspace>
</service>

In my mind, these service documents should be semantically quite rigidly defined (and I'm not saying my example is necessarily the best implementation of that). So, here, there would be a convention that the top level workspace would be redefined in the resource level workspace (with some sort of delimiter, here I've used \s-\s). The collections themselves would also be explicitly defined in the spec as to what is legal. The "/" delimiter is less than optimal since it's (unnecessarily) harder to regex.

Collections

GET /koha/actor/

  <feed xmlns="http://www.w3.org/2005/Atom"
    xmlns:vCard = "http://www.w3.org/2001/vcard-rdf/3.0#">
    <link rel="first"
          href="http://example.org/koha/actor" />
    <link rel="next"
          href="http://example.org/koha/actor?token={resumptionToken}" />
    <id>http://example.org/koha/actor</id>
    <title>Koha ILS - Actor</title>
    <updated>2008-03-18T11:54:00Z</updated>
    <entry>
      <id>http://example.org/koha/actor/1</id>
      <title>Joseph Blow</title>
      <updated>2001-01-01T00:00:01Z</updated>
      <vCard:FN>Joseph Blow</vCard:FN>
      <vCard:N>
        <vCard:Family>Blow</vCard:Family>
        <vCard:Given>Joseph</vCard:Given>
      </vCard:N>
      <vCard:EMAIL vCard:TYPE="http://www.w3.org/2001/vcard-rdf/3.0#internet">
        jblow@example.org</vCard:EMAIL>
      <vCard:UID vCard:TYPE="http://jangle.org/terms/#barcode">
        0000000001
      </vCard:UID>
      <vCard:UID vCard:TYPE="http://jangle.org/terms/#username">
        jblow
      </vCard:UID>
    </entry>
    <entry>
      <id>http://example.org/koha/actor/2</id>
      <title>Quincy Magoo</title>
      <updated>2001-01-02T00:00:01Z</updated>
      <vCard:FN>Quincy Magoo</vCard:FN>
      <vCard:N>
        <vCard:Family>Magoo</vCard:Family>
        <vCard:Given>Quincy</vCard:Given>
      </vCard:N>
      <vCard:EMAIL vCard:TYPE="http://www.w3.org/2001/vcard-rdf/3.0#internet">
        qmagoo@example.org</vCard:EMAIL>
      <vCard:UID vCard:TYPE="http://jangle.org/terms/#barcode">
        0000000002
      </vCard:UID>
      <vCard:UID vCard:TYPE="http://jangle.org/terms/#username">
        qmagoo
      </vCard:UID>
    </entry>
    ...
  </feed>

GET /koha/actor/2

  <feed xmlns="http://www.w3.org/2005/Atom"
    xmlns:vCard = "http://www.w3.org/2001/vcard-rdf/3.0#">
    <link rel="related" 
      href="http://example.org/koha/actor/2/items" />
    <link rel="related" 
      href="http://example.org/koha/actor/2/status" />
    <id>http://example.org/koha/actor/2</id>
    <title>Koha ILS - Actor/2</title>
    <updated>2008-03-18T11:54:00Z</updated>
    <entry>
      <id>http://example.org/koha/actor/2</id>
      <title>Quincy Magoo</title>
      <updated>2001-01-02T00:00:01Z</updated>
      <vCard:FN>Quincy Magoo</vCard:FN>
      <vCard:N>
        <vCard:Family>Magoo</vCard:Family>
        <vCard:Given>Quincy</vCard:Given>
      </vCard:N>
      <vCard:EMAIL vCard:TYPE="http://www.w3.org/2001/vcard-rdf/3.0#internet">
        qmagoo@example.org</vCard:EMAIL>
      <vCard:UID vCard:TYPE="http://jangle.org/terms/#barcode">
        0000000002
      </vCard:UID>
      <vCard:UID vCard:TYPE="http://jangle.org/terms/#username">
        qmagoo
      </vCard:UID>
    </entry>
  </feed>

GET /koha/actor/2/items

  <feed xmlns="http://www.w3.org/2005/Atom">
    <link rel="related" 
      href="http://example.org/koha/actor/2" />
    <id>http://example.org/koha/actor/2/items</id>
    <title>Koha ILS - Actor/2/Items</title>
    <updated>2008-03-18T11:54:00Z</updated>
    <entry>
      <id>http://example.org/koha/item/123456</id>
      <title>Disney's Mr. Magoo: A Novelization</title>
      <author><name>Nancy E. Krulik</name></author>
      <category term="checked-out" scheme="http://jangle.org/terms" />
      <updated>2008-03-11T16:23:00Z</updated>
    </entry>
    <entry>
      <id>http://example.org/koha/resource/0098765</id>
      <title>Mr. Magoo Is My Role Model</title>
      <author><name>Roy M Mendelsohn</name></author>
      <category term="bookmark" scheme="http://jangle.org/terms" />
      <updated>2007-11-15T09:41:13Z</updated>
    </entry>
  </feed>

GET /koha/actor/2/status

  <feed xmlns="http://www.w3.org/2005/Atom">
    <link rel="related" 
      href="http://example.org/koha/actor/2" />
    <id>http://example.org/koha/actor/2/status</id>
    <title>Koha ILS - Actor/2/Status</title>
    <updated>2008-03-16T00:00:00Z</updated>
    <entry>
      <id>http://example.org/koha/actor/2</id>
      <title>suspended</title>
      <content>Borrowing privileges suspended until fines paid</content>
      <updated>2008-03-16T00:00:00Z</updated>
    </entry>
  </feed>

Comment by rossfsinger, Mar 18, 2008

There needs to be some semblance of calendar included here, especially for "items" (due dates, recall/hold availability, etc.)

Fines also need to be represented in some capacity.


Sign in to add a comment