contents   previous   next

2.9  Introducing Records and Classes (and Folders)

A catalog stores information in a number of records, each of which has a name and a single class , which is the type of the record. The distinction between a Record and its Class is an important one to grasp to make best use of Catalyzer. An example of a class would be "Image" which has fields "filename", "height", "width" and "comment". An example record of class "Image" would be a particular instance - e.g. having filename "image1.jpg", height "1200", width "1600", and comment "picture of a tree".

Catalyzer lets you create your own classes to store your information, so if you wanted to store details of several Protocols, you could create a new class for "Protocol" with fields "name", "date", "researcher", "link to document", "description". You could then create several records of class Protocol, with the fields filled out for the specific protocols you wanted to record. The quick start example gives a step by step guide to using Catalyzer to create a number of different classes, and making records containing the actual information.

The importers for particular data file formats create their own classes for you automatically with fields appropriate to that format; for example, the TIFF image importer creates a class with the fields particular to TIFF images. The section on cataloging files has more details.

Examples of records and classes

Example definition of class "Protocol". This defines five fields:

Protocol: 
   name    
   date  
   reseacher
   link to document
   description
              
Two example records of class "Protocol". These fill out the fields of the class with data on specific protocols:
protocol1:               
   name             protocol 1
   date             1/1/2001
   researcher       Sue
   link to document c:\docs\prot1.doc
   description      mix A with B and cook at temperature 95C

protocol2:
   name             protocol 2
   date             09/08/2004
   researcher       Bob
   link to document c:\docs\prot2.doc
   description      shake very hard at 27C

How Catalyzer Classes relate to tables in spreadsheets

Most people are already familiar with the underlying concepts of "records" or "classes" even if the terms are new. For example, suppose you have a table in a spreadsheet like:

   number   strain  date    result   quality  comment
   1        a100    jan     121      good     ok
   2        s101    feb     121      bad      hmmn
              
The class definition here would be the first line - the column headers (name, strain, date, result, quality, comment). In Catalyzer you would create this as a class, and give the class a name (such as "Experiment Result"). Each row of the spreadsheet would become a new record; the first record having the values (number:1, strain:a100, date:jan, result:121, quality:good, comment:ok). See the section on Catalyzer and Spreadsheets for details on copying and pasting spreadsheet data into Catalyzer.

Another example of class and records - Samples

Example class definition for a database of samples:

Sample:
   id
   name
   quantity
   freezer location
Example records of class Sample:
sample1:
   id                1001
   name              sample1
   quantity          100g
   freezer location  G

sample7:
   id                2007
   name              sample7
   quantity          10kg
   freezer location  H7

Defining the Sample class using Catalyzer. A number of fields have been added (id, freezer location, etc). In addition, the 'room name' field has been changed to have the field type 'radio buttons', with three preset values.


Editing the values of a Sample record. Most fields allow text entry, but the 'room name' field lets you enter data but clicking on a button.


Folders

You can arrange records in a catalog in a hierarchy of folders, just as you can arrange files in subdirectories on disk. Each folder can contain a list of records of different types or "classes". When you first open a catalog, it has a single root folder (initially called "untitled"). You can add subfolders to this (right-click on the folder (ctrl-click on Mac), select Add Using Class : Folder). You can also add any other type of record e.g. using Add Using Class : Protocol.

So you can organise your catalogs as you like. For example you might set up a folder hierarchy like:

  mycatalog/
    pictures/
      jan/
      feb/
    graphs/
      excel/
    analyses/
    samples/
    publications/
      nature/
      science/    
and put records wherever you like in the hierarchy.

Although the "Folder" class is built in when you start up Catalyzer, it is just a regular class with a single field "Contents" which can contain a list of records. So you can add sublists to your own classes, and then add subrecords to them.

Field types

You can assign a field type to a field - so you can specify that certain fields should only contain a date, a number, or should be chosen from a menu. For menu fields, you can edit the different menu options as you go. The 'room name' field in the Sample class above had a type set to be 'Radio Buttons' to make it quicker to enter data.

You can edit the classes to reflect the type of data that you want to store in your catalog. You can add fields for different purposes, for example menus, radio buttons, check boxes or links to websites and data files.


If you apply a change to a class in a catalog, then that change automatically applies to all records using that class. For example, if you add a "notes" field to an "Image" class, then all your Image records will have a slot for you to add notes.


Technical note: If you are familiar with relational databases (like Access, Filemaker, Oracle), then a class corresponds roughly to a table definition, but the data model of Catalyzer is more flexible than relational databases, as you can add different classes of record anywhere in the folder hierarchy. It is possible to import the contents and structure of a relational database into Catalyzer using the Database importer.

Once you have defined a new class, you can start to add Records of that class to particular folders in the catalog.

Creating Records

A record is a set of values entered in the fields of a class; it is an actual instance of its class. You put a value in for each field. For example, in a field called `Name', you enter the name of a person, in a field called "notes" you might enter some longer text. The class defines the structure of a record. Each record has a single associated class which defines which fields must be filled in. A class may have many different records which use it.

Records live in the hierarchical tree structure of the catalog - so you can have records with lists of subrecords, just as you can have nested folders in the file system. You can create a hierarchy of records by adding Folders and sub folders. You can then add records to any folder.

Catalyzer makes it easy to switch between data entry mode (adding and editing records) and class editing mode (adding fields to classes and making new classes). (see the Creating Catalogs section for which buttons to press; the switch is available from the main menu View : Catalog to enter data, and View : Class to edit class structure.) This means that it is not essential to get the design of the class perfect first time - you can start off thinking, for example, that to describe an Experiment you only need to record the date, the sample and some notes. As you add more Experiment records, you realise it would also be useful to record the temperature and results - so you can switch into class editing mode and add these extra fields to record temperature and results.


One application of Catalyzer is to combine data from multiple sources - in one catalog you can have many different spreadsheet tables, the contents of a Samples database, links to data files and documents, with associated custom annotation.