Welcome to the Metadata Editor Page

Creating your own schema files

The Reggie Metadata Editor uses a schema file to read in the details of all the elements in a set, together with their characteristics and descriptions. To create metadata based on a different element set or different language, one has simply to create a new schema file.

A new feature of Reggie is to allow users to enter the URL for their own schema. The following is a guide to setting up a schema for Reggie to use.

 

Step 1 - Download an existing schema

A schema may use several files, but the main file is the "schema.txt" file. The quickest way to create a new schema is to modify an existing one. Any one of the existing schema.txt files is sufficient, although you may wish to choose one which is most similar to your planned new schema.

The Dublin Core metadata element set is used a basis for several other sets, including AGLS and EdNA. Click on the link to download the full schema file, or click here to download a stripped down version of the file. Other schema.txt files are available from the Reggie Metadata.Net home page.

Reggie requires the schema file to be called "schema.txt". The names of the remaining files used by Reggie may vary, as they will be named in the schema.txt file. This file will need to be placed in its own directory on a web server, along with any accompanying files that are used.

 

Step 2 - Name and describe the schema

Open the file with your favourite text editor. You will notice that the top section has several lines which start with a double dash, like this: -- Dublin Core Schema -- --

The dashes signify comment lines. You can enter the full name of your schema here, along with appropriate comments about the schema.

The first line of data in the file is used to name the schema for Reggie's internal use. It should contain alphanumeric characters and no spaces. The first use of the keyword "attribute" in the file signifies that this is the name of the schema. An example is given below:

DublinCore attribute
      description url 'dublincore.html'
      prefix 'DC'
      label 'Dublin Core'
      icon <DublinCore.gif>
      syntax container
            attributes set
                  Title, Creator, Subject, Description, Publisher,
                  Contributor, Date, Type, Format, Source,
                  Identifier, Language, Relation, Coverage, Rights

 

Step 3 - Schema description field

It is useful to provide some help information or a description of your schema for Reggie to show to the user. The description field will accept either the URL for a HTML file or ordinary text. If you wish to use a HTML file, the keyword "url" should be added before the name of the file, as shown above. If the full URL name is given, this field will accept a URL from anywhere on the Internet. If only the name of the file is given, Reggie will assume that this file is in the same location as the schema.txt file.

If ordinary text is used, the word "url" should be removed. The text should be entered between two apostraphe (') characters and must not contain any apostraphes. This rule also applies to text-based descriptions for the elements of the schema.

 

Step 4 - Prefix, label and icon for the schema

The prefix for the schema is the abreviated name which will identify elements as part of your schema. For example, Dublin Core uses "DC" as the prefix to all of its elements. The "Title" element from Dublin Core is therefore referred to as "DC.Title". The schema prefix is used as the default for all of the elements listed. So if no prefix is provided for a particular element, it will receive this prefix.

The label field refers to the full name of the element set. This is the name which will appear at the top of the Reggie window, eg. 'Dublin Core'.

The icon field contains the URL of a graphic which represents the element set. The preferred size is 60x60 pixels and Reggie will scale the graphic to this size if it is a different size. If the graphic is to be stored in the same directory as the schema.txt file, then only the name of the file is needed, eg. <DublinCore.gif>. Otherwise, the full URL is needed, eg. <http://metadata.net/dstc/DC-10-EN/DublinCore.gif>

 

Step 5 - List all of the elements

A single word name needs to be allocated to each element. You may simply concatenate the full name of the element if you wish, eg. "SubjectAndKeywords". List the elements in the manner shown in the example above.

 

Step 6 - Design each element

There are a number of fields that can be used to describe each element. The "attribute", "description", "label" and "syntax" fields are compulsory. The "prefix", "schemed", "typed", "optional", "repeatable" and "schemes" fields are optional. The following is a set of example element descriptions which demonstrate the use of all of these fields:

Originator attribute
	description 'This element identifies the resource originator.'
	label 'Originator'
	schemeless typeless
	mandatory single valued
	syntax string

Date attribute
	description 'The date associated with the resource.'
        prefix 'DC'
	label 'Date'
	syntax string
          schemes
            'ISO8601' scheme,
            'MyDate' scheme,
            'Created' type,
            'Issued' type,
            'Available' type
          defaults
            (scheme 'MyDate' type 'Created' language 'English') 'Today',
            (type 'Available') 'Tomorrow',
            'Yesterday'

The compulsory fields serve the same purpose for each element as they do for an element set. The "syntax" field should be set to string as other syntaxes are not supported yet. The "attribute" field is the name used (instead of the full name - "label") when creating the metadata output. The text in the "description" field will appear in the help box below the full name of the element. Like the schema description, this field will accept the URL for a HTML file if the keyword, "url", is added (See Step 3).

The optional fields do not need to be entered because they have default values. If the "prefix" field is used, it replaces the default prefix for this element set with another prefix. This will signify that the element belongs to a pre-existing set, such as Dublin Core (DC).

The "schemed" and typed" fields should be entered on the same line. The default value is "schemed typed", which means that this element is allowed to have both schemes and types. The words "schemeless" and "typeless" signify that the Schemes and Types lists respectively are disabled for this element. These fields must both be entered if one is entered, eg."schemeless typed".

The "optional" and "repeatable" fields should also be entered on the same line. The default value is "optional repeatable", which means that this element is optional in metadata and that it is allowed to have more than one value. The word "mandatory" indicates that a value must be entered in this element for the metadata to be valid. The words "single valued" indicate that only one value is allowed for this element. These fields must both be entered if one is entered, eg."mandatory repeatable".

The "fixed list" keywords indicate that the list of default values given is the only set of values which may entered for this element. No free text entry is allowed. If "fixed list" is not specified, the element will allow the entry of either a value from the default list or some free text.

The "schemes" keyword indicates that a list of schemes and subelements (to appear in their respective lists in Reggie) is given. They should be entered in the format shown. The name of a scheme should be followed by the word "scheme" and the name of a subelement / type should be followed by the word "type". The absence of a comma after the keyword indicates the end of the list.

The "defaults" keyword indicates that a list of default values will be provided for this element. Each default value can optionally have a scheme, subelement / type and language specified in brackets. All, some or none of these modifiers may be specified. When a default value is selected, these modifiers will also be selected by default. The list of defaults should be entered in the format shown above.

 

Step 7 - Put the schema on the Web

You will need to create a new directory on your web server and add the schema.txt file, the graphic file and any HTML files needed by your schema. If you are using pre-existing files from other directories or servers, these do not have to be added to your directory providing that the full URL was given in the schema.txt file.

 

Step 8 - Test it and use it!

Assuming that there are no errors in your schema.txt file, you should now be able to run Reggie with your schema!

If you receive the error message, "The schema is not available!" or your schema does not load, you should open the Java Console. If a parsing error has occurred, the details of this error will be displayed in the Java Console. The most common errors are the use of an apostraphe (') in a description or missing a comma (,) where it is needed. The parsing error messages include the line and column number of the errors so that they can be found easily.

 


DSTC