Some Application Profile Design Patterns
These design patterns are based on the Dublin Core Description Set Profile (DSP). The DSP structure is a single description set that contains one or more descriptions, each of which contains one or more metadata statements. Both the description and the metadata statements can define constraints on usage.
Statement: A Simple String
The simplest metadata statement describes a property that takes a simple string value ("literal"), with no constraints.
<?xml version="1.0" encoding="UTF-8"?>
<DescriptionSetTemplate xmlns="http://dublincore.org/xml/dc-dsp/2008/01/14" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://dublincore.org/xml/dc-dsp/2008/01/14
C:\dcmi\dcmi-dsp.xsd">
<DescriptionTemplate ID="resource" >
<StatementTemplate ID="title" type="literal">
<Property>http://RDVocab.info/Elements/title</Property>
</StatementTemplate>
</DescriptionTemplate>
</DescriptionSetTemplate>Mandatory and Repeatable
Both description templates and statement templates can be coded as mandatory/optional and repeatable/not repeatable. This is done using the values "minimum" and "maximum". The most commonly used values are:
-
"minimum = 0" means that the element is optional (the element is not required) [DEFAULT]
-
"minimum = 1" means that the element must appear at least once. (the element is required)
-
"maximum = 1" means that the element is can only appear once (the element is not repeatable)
-
"maximum = infinite" or "maximum = [any non-negative number here]" means that the element can appear more than once, up to the maximum number (the element is repeatable) [DEFAULT]
The following code defines a property ("title") that is required and not repeatable:
<?xml version="1.0" encoding="UTF-8"?>
<DescriptionSetTemplate xmlns="http://dublincore.org/xml/dc-dsp/2008/01/14" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://dublincore.org/xml/dc-dsp/2008/01/14
C:\dcmi\dcmi-dsp.xsd">
<DescriptionTemplate ID="resource" >
<StatementTemplate ID="title" type="literal" minoccurs="1" maxoccurs="1">
<Property>http://RDVocab.info/Elements/title</Property>
</StatementTemplate>
</DescriptionTemplate>
</DescriptionSetTemplate>Using Controlled Lists
One way to assure consistency of metadata use is to require that values be taken from a controlled list. Controlled lists can be short ("yes" "no" "maybe") or they can be long (such as the Library of Congress Subject Headings, which number about 250,000).
To define a property as taking a member of a controlled list as its value using the terms of the DC Application Profile, the controlled list is called a "Vocabulary Encoding Scheme" and the list itself is represented with its identifier, a URI. Use of a list can be mandatory or optional.
This code illustrates a "subject" property that optionally can use terms from the LC Subject Heading list.
<?xml version="1.0" encoding="UTF-8"?>
<DescriptionSetTemplate xmlns="http://dublincore.org/xml/dc-dsp/2008/01/14" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://dublincore.org/xml/dc-dsp/2008/01/14">
<DescriptionTemplate>
<StatementTemplate type="nonliteral">
<Property>http://purl.org/dc/terms/subject/</Property>
<NonLiteralConstraint>
<VocabularyEncodingSchemeOccurrence>optional
</VocabularyEncodingSchemeOccurrence>
<VocabularyEncodingSchemeURI>http://purl.org/dc/terms/LCSH
</VocabularyEncodingSchemeURI>
</NonLiteralConstraint>
</StatementTemplate>
</DescriptionTemplate>
</DescriptionSetTemplate>
This code shows a subject property that requires the use of a term from the LCSH list:
<?xml version="1.0" encoding="UTF-8"?>
<DescriptionSetTemplate xmlns="http://dublincore.org/xml/dc-dsp/2008/01/14" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://dublincore.org/xml/dc-dsp/2008/01/14
C:\daisy\Business\dcmi\dcmi-dsp2.xsd">
<DescriptionTemplate>
<StatementTemplate type="nonliteral">
<Property>http://purl.org/dc/terms/subject/</Property>
<NonLiteralConstraint>
<VocabularyEncodingSchemeOccurrence>
mandatory
</VocabularyEncodingSchemeOccurrence>
<VocabularyEncodingSchemeURI>http://purl.org/dc/terms/LCSH
</VocabularyEncodingSchemeURI>
</NonLiteralConstraint>
</StatementTemplate>
</DescriptionTemplate>
</DescriptionSetTemplate>
If you have a short list that you wish to embed in the DSP you can do that using the "LiteralOption". Each term is listed, and values must be taken from the list:
<?xml version="1.0" encoding="UTF-8"?>
<DescriptionSetTemplate xmlns="http://dublincore.org/xml/dc-dsp/2008/01/14" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://dublincore.org/xml/dc-dsp/2008/01/14
C:\daisy\Business\dcmi\dcmi-dsp2.xsd">
<DescriptionTemplate>
<StatementTemplate type="nonliteral">
<Property>http://purl.org/dc/terms/subject/</Property>
<NonLiteralConstraint>
<ValueStringConstraint minOccurs="1" maxOccurs="1">
<LiteralOption>red</LiteralOption>
<LiteralOption>white</LiteralOption>
<LiteralOption>blue</LiteralOption>
</ValueStringConstraint>
</NonLiteralConstraint>
</StatementTemplate>
</DescriptionTemplate>
</DescriptionSetTemplate>
You can support multiple languages with the LiteralOption by including the XML "lang" attribute:
<?xml version="1.0" encoding="UTF-8"?>
<DescriptionSetTemplate xmlns="http://dublincore.org/xml/dc-dsp/2008/01/14" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://dublincore.org/xml/dc-dsp/2008/01/14
C:\daisy\Business\dcmi\dcmi-dsp2.xsd">
<DescriptionTemplate>
<StatementTemplate type="nonliteral">
<Property>http://purl.org/dc/terms/subject/</Property>
<NonLiteralConstraint>
<ValueStringConstraint minOccurs="1" maxOccurs="1">
<LiteralOption lang="en">red</LiteralOption>
<LiteralOption lang="en">white</LiteralOption>
<LiteralOption lang="en">blue</LiteralOption>
<LiteralOption lang="it">rosso</LiteralOption>
<LiteralOption lang="it">azzurro</LiteralOption>
<LiteralOption lang="it">bianco
<LiteralOption>
</ValueStringConstraint>
</NonLiteralConstraint>
</StatementTemplate>
</DescriptionTemplate>
</DescriptionSetTemplate>