= Datastream typechecking for the Content Model Architecture = Traditionally in Fedora, all data objects was just data objects, there were no types of objects. This changed with the introduction of the Content Model Architecture. == DS-COMPOSITE datastream == Content Models may contain this reserved datastream. It lists the datastreams that must exist in subscribing data objects. Other than declaring the existence of the datastreams, little else can be specified. The MIME type and the format uri are the only specification that can be used by default. <> The schema for the datastream can be seen below. {{{ }}} The content of a DS-COMPOSITE datastream could look like this {{{
}}} == Allowing extensions in DS-COMPOSITE == Since 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. {{{ }}} With this changed schema, the contents could look like this: {{{ }}} What is noteworthy here is that the and the 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 unmodified Fedora. == Schema extensions in DS-COMPOSITE == Now that there is a system in place for extensions to DS-COMPOSITE, looking at extensions become worthwhile. It can be said that there are three kinds of datastreams in a Fedora object: 1. xml embedded in the object 1. bytes embedded in the object 1. external file referenced by URL. 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. But where to place the schema, then? 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, either in the content model itself, or in another object. To that purpose we have defined the following extension schema {{{ }}} Using that extension, the DS-COMPOSITE datastream could look like this {{{ }}}