Data Templates & Data Schemas
In the Collection Manager, data templates and data schemas are used to give structure to records in a collection.
Data templates are like patterns that can be used over and over again for one or more collections. A data schema is unique to a collection and is based on an a data template.
Every time you build a collection in LUNA you must choose a template to base your data schema on. The template you choose as your data schema can't be changed once you've saved it. And while you can always go back and edit both a data template and a data schema, any edits made to the data schema will not be saved to the data template and vice versa.
On this page:
Create a New Template
Under the Templates tab, click "New Template" (look for the blue button on the left). You'll be asked to give the template a name and description. This is helpful information if you're sharing the Collection Manager with others in your organization and think they could benefit from identifying and then using your template.
By default the first field in the new template will be Filename, which is recommended (see Tip below).
Each field can have its own properties, see below for a description of field properties.
As you build your template:
- Click on "New Field Group" or "New Field" to add these to your template
- Delete a field or field group by clicking on the delete icon
- To reorganize the fields use the up and down arrows to move them
Tip: As you add fields to a Field Group, be sure you've selected that Field Group first, otherwise the field will be created outside that Field Group.
Best Practice: A best practice for collection building is to always include "Filename" as one of your data fields. LUNA will then be able to easily link your records with corresponding media items by using this filename. By default every template will include a field for "Filename". You can easily delete this field if you want, or choose to not have it display in the LUNA Viewer. However, the LUNA Uploader will always look for the "Filename" to link the images and records by. If you change this just be sure you pay attention to the settings in the Uploader and indicate how records and media items should be linked.
Copy a Template: Alternatively, you could also copy an existing template, make the necessary changes and save it. This way the edits you made will be represented in a new template and available for use with future collections.
Choosing a Template for a Collection's Data Schema
Under the Collections tab click "New Collection" (look for the blue button on the left). At a minimum you must give the new collection a Name and you must select a Template from the menu next to the section that says Base data schema on. Then, click Save (you can go back any time to add or edit the Collection Properties).
Once you have selected a Template for your new collection it will become your data schema. This will allow you to make changes to the data schema without affecting the actual template.
Edit a Data Schema
To edit your data schema click on View/Edit schema to the right of Data Schema. When you're done editing, be sure to click "Back to Collection Properties".
The template that you based your data schema on will remain the same (under the Templates tab) and still be available to edit and use for other collections.
Fields, Field Groups and Authorities
Data templates and data schemas give structure to records in a collection based on a set of fields that represent your data.
Fields
Create fields for a single piece of data or for multiple pieces of data by checking "Multivalue" in the field properties.
To add a new field click New Field
To edit an existing field, click on the field name to expose the field properties on the right. Make sure to click Save when done.
Field Groups
Field groups are just that- groups of fields, a nice way to organize common content. For example, you could have a field group called "Creator" and in this group would be fields related to "Creator", such as "Creator Date", "Creator Nationality", etc. In the LUNA Viewer the fields will always display grouped as a set.
To create a new Field Group click New Field Group
To add fields to a field group, click on the field group and then click New Field.
When editing a Template you can go back anytime and change a Field Group to an Authority or do the reverse. However, when editing a Data Schema, field groups are permanent and can't be changed.
Repeating Fields
In the Record Editor, there are two ways to create repeating fields.
For a single field with repeating values, check "Multivalue" located in the field properties.
For multiple fields that repeat as a group, create a field group first and then add the fields to that group. In the example below you see a field group with the fields Title, Title Type and View repeated twice. Visit Record Editor help section for additional information on repeating fields.
In Library:
In Viewer:
Authorities
Authorities are a helpful way of providing data catalogers with a list of controlled vocabularies. This helps ensure data consistency across a collection. With the right permissions you can create new authorities, and upload a .csv list of authorities. Catalogers would then easily pick from the list of available data. Authorities are managed in the Library, and permission for managing authorities granted in the Administrator.
To create an Authority:
- Create and name a field group.
- Check the "Authority Field Group" box. All the fields in that field group will then be associated with that authority.
In the example below the "Location" field group is an Authority so the fields "City", "State of Provence", "Country" and "Country code" can all be populated with values from that specific "Location" authority.
When editing a Template you can go back anytime and change an Authority to a Field Group or do the reverse. However, when editing a Data Schema, Authorities are permanent and can't be changed.
Field Properties
When creating a data template it's important to think about what properties you will assign each field:
- Display Name: give the field a name. This will display in both the LUNA Viewer and in the LUNA Library.
- Field Type:
- Text
- Number (Number must be a whole number with no formatting)
- Date (see Dates in LUNA)
- Text Box Type:
- single is just a single box
- expanding will allow you to enlarge the box to make room for lots of data
- autocomplete will complete the word based on the first few letters you type (autocomplete is based on the existing data in a collection)
- autocomplete + value list to open a list of values to select from based on existing data in collection or expose a list of values based on the letter(s) you type.
- Multivalued: allow for repeating values in a field
- Length of field: set a maximum and or minimum number of characters
- For display in LUNA Viewer: allow the data in the field to display in the LUNA Viewer, mostly this would be in the Detail View but could be in the thumbnail label, or media summary as well.
- Searchable in LUNA Viewer: allow the data in the field to be searchable in the LUNA Viewer.
- Sortable in LUNA Viewer: allow the data in the field to be sortable in the LUNA Viewer.
- MARC data field mapping (for use only when using MARC as source data).
As always, be sure to click "Save" when done.
Mapping MARC Data Fields
If your source data are MARC records you can easily import them into LUNA. But first you need to map your MARC data fields to the LUNA data fields in your data schema. Once your MARC data is mapped you can then upload the MARC records via the Uploader.
For each LUNA field you want to map to the MARC field simply enter the MARC code into the corresponding LUNA field properties. In the example below we mapped the MARC creator data field to the Creator field in our LUNA schema:
If you're not familiar with MARC records you might want to contact us for help. Please also read additional details on using MARC as source data in LUNA.
Understanding the deletion and renaming of fields in a Schema
When you delete a field, it does not delete the underlying data (xml documents) in the LUNA Library repository. If you recreate the field with the exact same name, the data will come back. A deleted field's data will remain until the record is changed and saved.
When you create a field in LUNA, a field has two properties, the "field name" and the "display name". When you first create the field both of these are the same except the field name has underscores for spaces and is all lowercase. You can see these if you export as an XML document in the LUNA Library.
If you edit the schema, the field name always remains the same and only the display name changes. So if I start with a field called "Artist Rights" the display name is stored as "Artist Rights" and the field name is "artist_rights". If I change the field name to just "Rights" the field name remains "artist_rights"