DS-COMPOSITE datastreamContent Models may contain this reserved datastream. It lists the datastreams that must exist in subscribing data objects, and the few requirements on them. DSCompositeSchemaThe old schema for the datastream can be seen below. <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: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> The content of a DS-COMPOSITE datastream could look like this <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> Allowing extensions in DS-COMPOSITESince Fedora already use DS-COMPOSITE to declare the existence of datastreams, it is the natural location to specify restrictions on the contents of datastreams. Unfortunately, the schema for the DS-COMPOSITE datastream does not allow for any extra content, To that effect, we have made a small change to the schema. <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"/> </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="datastream"/> </xsd:complexType> </xsd:element> </xsd:schema> With this changed schema, the contents could look like this: <dsCompositeModel xmlns="info:fedora/fedora-system:def/dsCompositeModel#"> <dsTypeModel ID="DC"> <form MIME="text/xml"/> <extension name="SCHEMA"> </extensions> </dsTypeModel> <dsTypeModel ID="ORIGIN"> <form MIME="text/xml"/> <extension name="SCHEMA"> </extensions> </dsTypeModel> </dsCompositeModel> What is noteworthy here is that the <dsTypeModel> and the <form> elements are left unchanged. The Fedora code, working with DS-COMPOSITE only looks for these tags, so the new schema will not cause conflicts, and the extensions will be quietly ignored. This is exactly as we want, this change should not make our objects incompatible with an older Fedora. Reserved extensions in DS-COMPOSITEWe have reserved two extention names.
That leaves the question on where to place the content (schema/ontology). Embedding it directly in DS-COMPOSITE makes for a very unreadable datastream. Alternatively, you could just specify an URL to the schema, but this approach have problems too. Having the Content Model depend on schemas defined elsewhere, perhaps on remote servers, mean that the content models could break by actions totally unrelated to the repository. The best way, we have found, is to embed the schema in a datastream in the content model. To do this, we make use of the <reference> element, which we added the the schema above. <dsCompositeModel xmlns="info:fedora/fedora-system:def/dsCompositeModel#" xmlns:schema="http://ecm.sourceforge.net/types/dscompositeschema/0/1/#"> <!-- The DC datastream is declared. It's mime type must be text/xml. It must adhere to the xml schema residing in the DC_SCHEMA datastream in this content model. --> <dsTypeModel ID="DC"> <form MIME="text/xml"/> <extension name="SCHEMA"> <reference type="xsd" datastream="DC_SCHEMA"/> </extensions> </dsTypeModel> <!-- The ORIGIN datastream is declared. It's mime type must be text/xml. It must adhere to the xml schema residing in the ORIGIN_SCHEMA datastream in this content model--> <dsTypeModel ID="ORIGIN"> <form MIME="text/xml"/> <extension name="SCHEMA"> <reference type="xsd" datastream="ORIGIN_SCHEMA"/> </extensions> </dsTypeModel> </dsCompositeModel> Schema ExtensionThere are three kinds of datastreams in a Fedora object: 1. xml embedded in the object (inline content) The schema extension will only concern itself with the first option, namely the xml embedded in the datastream. For XML, there already exist a commonly accepted system for specifying the content, i.e. XML Schema. |