Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: added table of contents

Table of Contents

This page documents the new choice management and authority control of Item ("DC") metadata values features in DSpace 1.6. These are actually two separate features: the choice management mechanism is completely independent of authority control and can be configured and deployed independently of it.

...

The basic implementation only adds two columns to the MetadataValue table:

Oracle:

Code Block

ALTER TABLE MetadataValue
   ADD ( authority VARCHAR(100),
         confidence INTEGER DEFAULT -1);

Postgres:

Code Block

ALTER TABLE MetadataValue
   ADD COLUMN authority VARCHAR(100),
   ADD COLUMN confidence INTEGER DEFAULT -1;

...

To search on this index, you would submit an OpenSearch query such as this to retrieve Items with an author whose authority key matches no2004117088:

Code Block

http://dspace.myuni.edu/open-search/?query=author_authority:no2004117088

...

How do you get the authority key value on which to search? If it comes from an external source (e.g. the Library of Congress Naming Authority), and you happen to know the details of how it is derived, you can derive it directly from the source. Otherwise, you can use the Browse UI on an authority-controlled browse index to display a list of authority keys in the first-order browse list. Each value is a link whose URL is of the form:

Code Block

http://dspace.myuni.edu/browse?type=*BROWSE_INDEX_NAME*&authority=*AUTHORITY_KEY*

e.g.

Code Block

http://dspace.myuni.edu/browse?type=author&authority=no2004117088

...

First, configure all your ChoiceAuthority plugins in the usual PluginManager style. The example plugins provided in the DSpace code are configured here:

Code Block

plugin.named.org.dspace.content.authority.ChoiceAuthority = \
  org.dspace.content.authority.SampleAuthority = Sample, \
  org.dspace.content.authority.LCNameAuthority = LCNameAuthority, \
  org.dspace.content.authority.SHERPARoMEOPublisher = SRPublisher, \
  org.dspace.content.authority.SHERPARoMEOJournalTitle = SRJournalTitle

...

The default configuration also includes a special self-named plugin that picks up all the value-pairs elements defined in your input-forms.xml configuration and makes them available as choice authorities (especially suitable for the select presentation style(smile)

Code Block

plugin.selfnamed.org.dspace.content.authority.ChoiceAuthority = \
  org.dspace.content.authority.DCInputAuthority

...

First, any authority-controlled field must also be configured with a source of choices. This is also defines a simple choice field:

Code Block

choices.plugin._schema.element.qualifier_ = _plugin-name_

e.g.

Code Block

choices.plugin.dc.relation.journal = SRJournalTitle

...

This determines the UI presentation of the choice (mainly in the interactive submission UI).

Code Block

choices.presentation._schema.element.qualifier_ = select | suggest | lookup

e.g.

Code Block

choices.presentation.dc.relation.journal = suggest

...

Finally, the choices for a metadata field may be specified as open (i.e. values not included in the choices are allowed) or closed (restricted to the set of values offered. The default is open. This means that when a proposed value is not already in the choices, it is added as an allowable choice.

Code Block

choices.closed._schema.element.qualifier_ = true | false

e.g.

Code Block

choices.closed.dc.relation.journal = false

...

To declare a field as authority-controlled, just add a property like this, in addition to its Choices plugin declaration:

Code Block

authority.controlled._schema.element.qualifier_ = true

e.g.

Code Block

authority.controlled.dc.relation.journal = true

...

To further constrain an authority-controlled field so that it must have an authority key whenever setting a metadata value, add the property:

Code Block

authority.required._schema.element.qualifier_ = true

...

  • accepted
  • uncertain
  • ambiguous
  • notfound
  • failed
  • rejected
  • novalue
  • unset

For example:

Code Block

authority.minconfidence.dc.contributor.author = accepted

...

. The built-in default is ACCEPTED, but if you find this is too high, you may prefer AMBIGUOUS to give automatically-derived authority keys the benefit of the doubt, e.g.

Code Block

authority.minconfidence = ambiguous

Example of some field configurations

Code Block

# Simple configuration of authory-controlled author, authority not required
 choices.plugin.dc.contributor.author = LCNameAuthority
 choices.presentation.dc.contributor.author = lookup
 authority.controlled.dc.contributor.author = true
 #
 # As an example, get journal title for dc.title.alternative
 choices.plugin.dc.title.alternative = SRJournalTitle
 choices.presentation.dc.title.alternative = suggest
 #
 # This employs a select to restrict choices for dc.type field on EditItemMetadata page:
 choices.plugin.dc.type = common_types
 choices.closed.dc.type = true
 choices.presentation.dc.type = select

...

You can control the images shown for various authority confidence levels with style tags such as img.ds-authority-confidence.cf-NAME, where NAME is the symbolic name of the confidence level, such as accepted (see above for the list). For example, this displays a thumbs-up icon to mark a human-approved level of confidence in the authority value:

Code Block

img.ds-authority-confidence.cf-accepted
  \{ background: transparent url(../images/confidence/6-thumb2.gif); \}

...

You can turn on the display of authority-value fields, ideally just for debugging since it clutters the display. Adjust the value of the display style to inline to see authority value fields on Submission UI forms. (Note that the Edit Item Metadata page already displays authority values.)

Code Block

input.ds-authority-value \{ display: none; \}

...

The prototype CSS also includes some styles for the Scriptaculous JavaScript autocomplete feature as well. These lines should be copied (and customize as necessary) into your theme's CSS:

Code Block

div.autocomplete
 div.autocomplete ul
 div.autocomplete ul li.selected
 div.autocomplete ul li
 div.autocomplete ul li span.value

...

For customization, examine the contents of these pages in the webapp:

Code Block

/tools/lookup.jsp
 /tools/edit-item-form.jsp
 /submit/edit-metadata.jsp

...

The collection is supplied as a database ID in order to save the overhead and database access which would be required to create a DSpaceObject instance – on the assumption that it is not always going to be used, and in fact probably pretty rarely, and that the speed of a choice request is very important in the interactive context, the expense of querying the collection is deferred so it is only incurred by those implementations which really need it.

Code Block

public Choices getMatches(String text, int collection, int start, int limit, String locale);

...

Note that getBestMatch() is given a collection argument, just like the collection context given to getMatches() – see above for details.

Code Block

public Choices getBestMatch(String text, int collection, String locale);

...

Get the canonical, human-readable label (i.e. short descriptive text) corresponding to the authority key of a value. This is only called for fields defined as authority-controlled; a choice plugin that is never used for authority-controlled fields does not need to implement this.

Code Block

public String getLabel(String key, String locale);

...

Add methods that take authority-key and confidence arguments:

Code Block

public void addMetadata(String schema, String element, String qualifier, String lang, String value, String authority, int confidence)
 public void addMetadata(String schema, String element, String qualifier, String lang, String[) values, String authorities(), int confidences(])

...

Changes to DCValue

Add fields:

Code Block

public String authority;
 public int confidence;

Changes to MetaDataValue

Code Block

public String getAuthority()
 public void setAuthority(String value)
 public int getConfidence()
 public void setConfidence(int value)

...

The DIM Field element gains two new attributes to represent the authority and confidence (when available) of DC metadata values, e.g.

Code Block

<dim:field schema="dc" element="contributor" qualifier="author" *authority="n79-21164" confidence="6"*>
 Mark Twain
 </dim:field>

...