# +===========================================================================+ # | | # | NATIONAL GEOSPATIAL DIGITAL ARCHIVE | # | University of California at Santa Barbara | # | | # +===========================================================================+ # $Header: /export/home/gjanee/ngda/data-model/RCS/template.rnc,v 1.2 2006/02/15 18:08:40 gjanee Exp $ # DESCRIPTION # # RELAX NG schema for archival object templates. # # A template defines the common structure of a class of objects. # It is essentially identical to a manifest, except that # quantities that are specific to individual objects (object # identifiers, file sizes, etc.) are not present, and in a # template components may be marked as optional. # # A template is purely an ingest aid. An archival object may, at # any time, deviate from the structure specified by an associated # template. # # Storage note: the storage of templates has been left # deliberately ambiguous in this specification. Templates may be # stored as archival objects in the archive, or, they may be # stored by the archive server by any other means. The only # requirement either way is that they be referencable by URI. # # If a template is stored as an archival object, the recommended # representation is to store it as a file named "template.xml" in # the archival object's root directory. In other words, templates # adhere to the following meta-template: # # # # AUTHOR # # Greg Janee # gjanee@alexandria.ucsb.edu # # HISTORY # # $Log: template.rnc,v $ # Revision 1.2 2006/02/15 18:08:40 gjanee # Parallel changes to match those made to manifest.rnc. Also, # added an "optional" attribute to components. This schema is # fully backward-compatible with the previous version except for # the version change in the XML namespace. (There is a new # restriction on object identifiers that is not # backward-compatible in theory, but in practice the change should # have no implications.) # # Revision 1.1 2005/11/14 00:38:13 gjanee # Initial revision # default namespace = "tag:ngda.org,2005:schemas/1.1/template" namespace a = "http://relaxng.org/ns/compatibility/annotations/1.0" grammar { # Note that the identifier here identifies the template. start = element template { element templateIdentifier { xsd:anyURI }, Relationship*, Definition*, Lineage?, Component* } Relationship = element relationship { attribute type { text }, attribute targetObjectRef { xsd:anyURI } } Component = Directory | File CommonComponentElements = [a:defaultValue="false"] attribute optional { xsd:boolean }?, element name { xsd:NCName }, Definition*, Lineage? Directory = element directory { attribute type { "subcomponents" | "alternatives" }, CommonComponentElements, Component* } File = element file { CommonComponentElements } Definition = element definitionRef { xsd:anyURI } Lineage = element lineage { element sourceComponentRef { xsd:anyURI }*, element notes { text }? } # The extra-schema validity checks listed in manifest.rnc apply to # templates as well. }