Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
<dsCompositeModel
        xmlns="info:fedora/fedora-system:def/dsCompositeModel#">
    <dsTypeModel ID="DC">
        <form MIME="text/xml"/>
    </dsTypeModel>
    <dsTypeModel ID="ORIGIN">
        <form MIME="text/xml"/>
    </dsTypeModel>
</dsCompositeModel>

Optional datastreams

First, we will ammend the schema to support the property "optional" to datastream declarations. The JIRA issue for this is http://fedora-commons.org/jira/browse/FCREPO-531Image Added

The semantic meaning of optional is:
1. The datastream can exist in the substribing objects but does not have to
2. If the datastream exist, it must adhere to the specification in the content model

This will allow you to express optional datastreams like this

Code Block

<dsCompositeModel
        xmlns="info:fedora/fedora-system:def/dsCompositeModel#">
    <dsTypeModel ID="DC">
        <form MIME="text/xml"/>
    </dsTypeModel>
    <dsTypeModel ID="ORIGIN" optional="true">
        <form MIME="text/xml"/>
    </dsTypeModel>
</dsCompositeModel>

To allow this, the schema is now

Code Block

<xsd:schema
        targetNamespace="info:fedora/fedora-system:def/dsCompositeModel#"
        xmlns="info:fedora/fedora-system:def/dsCompositeModel#"
        xmlns:xsd="http://www.w3.org/2001/XMLSchema"
        elementFormDefault="qualified"
        attributeFormDefault="unqualified">
    <xsd:element name="dsCompositeModel">
        <xsd:complexType>
            <xsd:sequence>
                <xsd:element minOccurs="0" maxOccurs="unbounded" ref="dsTypeModel"/>
            </xsd:sequence>
        </xsd:complexType>
    </xsd:element>
    <xsd:element name="dsTypeModel">
        <xsd:complexType>
            <xsd:sequence>
                <xsd:element minOccurs="0" maxOccurs="unbounded" ref="form"/>
            </xsd:sequence>
            <xsd:attribute name="ID" use="required" type="xsd:NCName"/>
            <xsd:attribute name="optional" use="optional" type="xsd:boolean" default="false"/>
        </xsd:complexType>
    </xsd:element>
    <xsd:element name="form">
        <xsd:complexType>
            <xsd:attribute name="FORMAT_URI" use="optional" type="xsd:anyURI"/>
            <xsd:attribute name="MIME" use="optional"/>
        </xsd:complexType>
    </xsd:element>
</xsd:schema>

Allowing extensions in DS-COMPOSITE

...

Code Block
<xsd:schema
        targetNamespace="info:fedora/fedora-system:def/dsCompositeModel#"
        xmlns="info:fedora/fedora-system:def/dsCompositeModel#"
        xmlns:xsd="http://www.w3.org/2001/XMLSchema"
        elementFormDefault="qualified"
        attributeFormDefault="unqualified">
    <xsd:element name="dsCompositeModel">
        <xsd:complexType>
            <xsd:sequence>
                <xsd:element minOccurs="0" maxOccurs="unbounded" ref="dsTypeModel"/>
            </xsd:sequence>
        </xsd:complexType>
    </xsd:element>
    <xsd:element name="dsTypeModel">
        <xsd:complexType>
            <xsd:sequence>
                <xsd:element minOccurs="0" maxOccurs="unbounded" ref="form"/>
                <xsd:element minOccurs="0" maxOccurs="unbounded" ref="extension"/>
            </xsd:sequence>
            <xsd:attribute name="ID" use="required"/>
            <xsd:attribute name="optional" use="optional" type="xsd:boolean" default="false"/>
        </xsd:complexType>
    </xsd:element>
    <xsd:element name="extension">
        <xsd:complexType>
            <xsd:sequence>
                <xsd:any namespace="##any" processContents="skip" minOccurs="0" maxOccurs="unbounded"/>
            </xsd:sequence>
            <xsd:attribute name="name" use="required"/>
        </xsd:complexType>
    </xsd:element>
    <xsd:element name="form">
        <xsd:complexType>
            <xsd:attribute name="FORMAT_URI" use="optional" type="xsd:anyURI"/>
            <xsd:attribute name="MIME" use="optional"/>
        </xsd:complexType>
    </xsd:element>
    <xsd:element name="reference">
        <xsd:complexType>
            <xsd:attribute name="type"/>
            <xsd:attribute name="value"/>
        </xsd:complexType>
    </xsd:element>
</xsd:schema>

...