next up previous contents
Next: Example 2 Up: Schema and type based Previous: Schema and type based   Contents

Example 1

Let's say I would like to define the necessary schemas, import and define metadata for my emails9. In a normal file system the file system provides some basics metadata about my files, for instance when the file was created, who created it, name of the file and a lot more. I would line those kind of data for every file in my metadata file system. The easiest way to implement this is to define a schema containing those tags, let's name the schema File, every other schema can now inherit the File-schema and thus have the basic tags. The schema definition for File and Email could look like this:


schema File
  String  (mandatory) filename
  String  (optional)  description
  String  (mandatory) Created_by
  String  (mandatory) Last_edited_by
  Data    (mandatory) Created
  Date    (mandatory) Last_changed
  Integer (mandatory) size
  Integer (mandatory) inode
  Item    (mandatory) dat
end


schema Email inherit File
  String (mandatory) sender_email
  String (mandatory) receiver_email
  Relationship Contacts (optional)  receiver_contact
  Date   (mandatory) Arival
  Item   (mandatory) dat
end

In the email definitions is one of the tags Relationship Contacts receiver_contact this is a link to a object stored in the metadata file system of the type Contacts. So suppose I would like to import all my emails into the metadata file system, then for each email all of the mandatory tags would have to be filed in, but because the system already knows the value for every metadata tag, it can be done automatic.


next up previous contents
Next: Example 2 Up: Schema and type based Previous: Schema and type based   Contents
2007-11-09