What's new? | Help | Directory | Sign in
Google
jangle
Just another generic library environment
  
  
  
  
    
Search
for
Updated Dec 12, 2007 by townxelliot
BorrowerSchemaDiscussion  
Discussion about the right kind of database schema for a Jangle actor

A Jangle actor records details of any person that Jangle needs to know about. Mostly, this will be borrowers/patrons.

Schema version 1

The first pass at this should be as simple as possible, making no reference to libraries, institutions, addresses etc.. This boils down to:

Note that this also includes some of the properties you might put in vCard, such as email addresses and telephone numbers. (Note that these should perhaps be normalised into a separate contact_methods table, which could enable setting a preferred contact method - but let's ignore that for now.)

Whether an actor should also have attributes relating to library-specific data, I'm not sure.

I think we could have a separate table to deal with identity_types:

And then associations between an actor and a type of identity (identities):

This follows the line of some of Ross' ideas about the flexibility to add new attributes, but restricts this to the one part of the domain we know will vary (i.e. the types of authentication systems people are likely to use).

Issues with handling identities like this:

We might need to be able to associate an organisation with a range of identity_types at a later date, but for now we'll keep it simple.

As for addresses, we could try to follow vCard for now. For the addresses I'm thinking about, we could use the v:Address class specified in the RDF model for vCards, e.g.

And then have a table connecting the two, actors_addresses:

(Another comment: this kind of sprawling unstructured data would be an ideal application of Talis' Platform for RDF... For now, we'll put it into the strait-jacket of an RDBMS.)

Older thoughts

As a first pass, let's go with three tables:

actors:

actor_attributes

actor_addresses

Ok, now let me explain the rationale here. It's difficult to tell exactly the fields that may be associated with a borrower in a given system. Some may use barcodes, or usernames, or social security numbers or all three (although you should start seeing fewer and fewer ssns for ID). Same goes for names (one string? First, last, middle? Latin American style with first last name/second last name?). To add to this, different systems may have different policies for this sort of data: the Voyager ILS, for instance, allows for more than one barcode to be associated with a patron.

What would then happen is the institution would very simply map their local attributes to a 'standard' Jangle borrower (however they see fit -- id == barcode | username) with the option to return a response that includes whatever fields they want.

I am open to other ideas regarding this (or gaping holes in my logic).

I also thought we may want another field in the 'actors' table pointing back to attribute that defines the canonical that an institution would use to identify a user (or just include that field in actors, which is probably even smarter).

Borrower schemas from other ILSs

TalisSOA

'Borrowers' have the following attributes:

'contacts' is one or more sets of contact details for a borrower, including the dates for when those details apply. This might include a borrower's old addresses as well as their current one.

Voyager

'Patrons' have the following attributes:

Koha

From http://www.kohadocs.org/usersguide/apas02.html

borrowernumber int(11) MUL NULL
cardnumber varchar(16) PRI
surname text
firstname text
title text YES NULL
othernames text YES NULL
initials text
streetaddress text
suburb text YES NULL
city text
phone text
emailaddress text YES NULL
faxnumber text YES NULL
textmessaging text YES NULL
altstreetaddress text YES NULL
altsuburb text YES NULL
altcity text YES NULL
altphone text YES NULL
dateofbirth date YES NULL
branchcode varchar(4)
categorycode char(2) YES NULL
dateenrolled date YES NULL
gonenoaddress tinyint(1) YES NULL
lost tinyint(1) YES NULL
debarred tinyint(1) YES NULL
studentnumber text YES NULL
school text YES NULL
contactname text YES NULL
borrowernotes text YES NULL
guarantor int(11) YES NULL
area char(2) YES NULL
ethnicity varchar(50) YES NULL
ethnotes varchar(255) YES NULL
sex char(1) YES NULL
expiry date YES NULL
altnotes varchar(255) YES NULL
altrelationship varchar(100) YES NULL
streetcity text YES NULL
phoneday varchar(50) YES NULL
preferredcont char(1) YES NULL
physstreet varchar(100) YES NULL
password varchar(30) YES NULL
flags int(11) YES NULL
userid varchar(30) YES NULL
homezipcode varchar(25) YES NULL
zipcode varchar(25) YES NULL
sort1 varchar(80) YES NULL
sort2 varchar(80) YES NULL

Evergreen

id serial PRIMARY KEY
card integer UNIQUE
profile integer NOT NULL
usrname text UNIQUE NOT NULL
email text -
passwd text NOT NULL
standing integer NOT NULL DEFAULT 1
ident_type integer NOT NULL
ident_value text -
ident_type2 integer -
ident_value2 text -
net_access_level integer NOT NULL DEFAULT 1
photo_url text -
prefix text -
first_given_name text NOT NULL
second_given_name text -
family_name text NOT NULL
suffix text -
day_phone text -
evening_phone text -
other_phone text -
mailing_address integer -
billing_address integer -
home_ou integer NOT NULL
dob timestamp with time zone -
active boolean NOT NULL DEFAULT true
master_account boolean NOT NULL DEFAULT false
super_user boolean NOT NULL DEFAULT false
barred boolean NOT NULL DEFAULT false
deleted boolean NOT NULL DEFAULT false
usrgroup serial NOT NULL
claims_returned_count integer NOT NULL
credit_forward_balance numeric(6,2) NOT NULL DEFAULT 0.00
last_xact_id text NOT NULL DEFAULT 'none'::text
alert_message text -
create_date timestamp with time zone NOT NULL DEFAULT now()
expire_date timestamp with time zone NOT NULL DEFAULT (now() + '3 years'::interval)

Note this includes ILS-specific data (card, barred), system data (deleted, super_user), and address data.


Sign in to add a comment