Added missing XSD datatype library declaration to full RELAX NG collection object schema ( the schema that is sans namespaces).
Minor correction on intro comments in rng-to-xsd script.
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+
+<!--
+
+ collectionObject-full-ns.rng
+
+ A schema defining the structure of an CollectionObject entity.
+
+ This schema includes all of its components, rather than referring
+ to them via 'externalRef' references. As such, it can be used as the
+ basis for generating a W3C XML Schema (XSD) schema, via
+ James Clark's Trang utility (http://http://www.thaiopensource.com/relaxng/trang.html).
+ (Trang version 20081028 can't resolve such references.)
+
+ As a convenience, a 'rng-to-xsd.sh' script file, which trivially wraps Trang
+ to generate XSD from a RELAX NG schema, is provided elsewhere in this distribution.
+
+ This schema also includes one rudimentary root namespace, scoped for the Release 0.1
+ "Hello World" demo. We'll need to determine whether, and if so how, we can
+ accommodate multiple namespaces to compose entity objects from various schemas,
+ such as service metadata, and declarations for the default entity, a domain- or community-
+ provided entity, and site- or instance-specific version of an entity.
+
+ This schema was created for the CollectionSpace system,
+ http://www.collectionspace.org/
+
+ It is written in the XML syntax of the RELAX NG schema language,
+ http://relaxng.org/
+
+ $Author: aron $
+ $Revision: 57 $
+ $Date: 2009-03-05 16:06:06 -0800 (Thu, 05 Mar 2009) $
+
+-->
+
+<element
+ name="collectionObject"
+ ns="http://collectionspace.org/hello"
+ xmlns="http://relaxng.org/ns/structure/1.0"
+ datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
+
+
+ <!-- ######################################################################## -->
+ <!-- Service Metadata -->
+ <!-- ######################################################################## -->
+
+ <!--
+ Data elements common to every entity object in the CollectionSpace system.
+
+ This is an quickly conceived-of list for the Release 0.1 "Hello World" demo,
+ and is not intended to be definitive going forward; further definition
+ will be required.
+ -->
+
+ <element
+ name="serviceMetadata">
+
+ <!--
+ A unique CollectionSpace system identifier (ID) for this
+ entity record. This is distinguished from any museum-created
+ or other identifiers that might also be associated with it.
+
+ Note: We may wish to think further about what this element name should be.
+ -->
+ <element name="collectionSpaceId">
+ <!--
+ Note: We may potentially wish to specify a regex-type pattern
+ here for further validating these IDs.
+ -->
+ <data type="string" />
+ </element>
+
+ <!--
+ All of the data elements after this point are fully optional.
+
+ It's possible we may never want or need to pass these in
+ routine message payloads, and if so, this merely constitutes
+ notes/documentation on a few representative types of data that
+ we might additionally store as system metadata, beyond an identifier.
+
+ It's also possible that we might offer a service to provide this
+ system metadata for any object, so that, for instance, a client
+ might be able to retrieve the full modification history for an object.
+ This *may* even already be envisioned for an already defined or
+ candidate service ...
+ -->
+
+ <!-- ######################### -->
+ <!-- Creation -->
+ <!-- ######################### -->
+
+ <!--
+ A timestamp for the creation of this entity record, as specified in
+ http://www.w3.org/TR/xmlschema-2/#dateTime
+ -->
+ <optional>
+ <element name="created">
+ <choice>
+ <data type="dateTime" />
+ <empty />
+ </choice>
+ </element>
+ </optional>
+
+ <!-- The system Principal that created this entity record -->
+ <optional>
+ <element name="createdBy">
+ <choice>
+ <data type="string" />
+ <empty />
+ </choice>
+ </element>
+ </optional>
+
+ <!--
+ Note: Do we also need 'acting as designate for' information here,
+ for cases where one system Principal created this entity while
+ acting as a designate for another Principal?
+ -->
+
+ <!-- ######################### -->
+ <!-- Last modification -->
+ <!-- ######################### -->
+
+ <!--
+ A timestamp for the last modification of this entity record, as specified in
+ http://www.w3.org/TR/xmlschema-2/#dateTime
+ -->
+ <optional>
+ <element name="lastModified">
+ <choice>
+ <data type="dateTime" />
+ <empty />
+ </choice>
+ </element>
+ </optional>
+
+ <!-- The system Principal that created this entity record -->
+ <optional>
+ <element name="lastModifiedBy">
+ <choice>
+ <data type="string" />
+ <empty />
+ </choice>
+ </element>
+ </optional>
+
+ <!--
+ Note: Do we also need 'acting as designate for' information here,
+ for cases where one system Principal modified this entity while
+ acting as a designate for another Principal?
+ -->
+
+ <!-- ######################### -->
+ <!-- Valid from/to -->
+ <!-- ######################### -->
+
+ <!--
+ Patrick mentioned the concept of 'valid to/from' timestamps.
+ If this applied to entity objects, not to schema, we might
+ explore that further as another possible type of system metadata.
+ -->
+
+ </element>
+
+
+ <!-- ######################################################################## -->
+ <!-- Default CollectionObject -->
+ <!-- ######################################################################## -->
+
+ <!-- The default CollectionSpace schema for an entity object (extremely simplified). -->
+
+ <element
+ name="defaultCollectionObject">
+
+ <!--
+ The following data elements are taken from the Basic section,
+ Object ID Information sub-section, of the Object Data Entry wireframe
+
+ See:
+
+ http://wiki.collectionspace.org/display/collectionspace/Wireframes+-+Object+Data+Entry
+ and
+ http://wiki.collectionspace.org/display/collectionspace/Hello+World+(Release+0.1)+Functionality+Requirements
+
+ -->
+
+ <!-- Allows child elements to appear in any order -->
+ <interleave>
+
+ <element name="objectNumber">
+ <!--
+ This declaration specifies that the value of this element must never be empty (blank).
+ If that's not accurate, it should be redefined, perhaps to match other elements below.
+
+ Note: In a site- or instance-specific declaration - not in the default
+ definition here - we might wish to specify a regex-type pattern here for
+ further constraining valid object numbers.
+ -->
+ <data type="normalizedString">
+ <param name="minLength">1</param>
+ </data>
+ </element>
+
+ <optional>
+ <element name="otherNumber">
+ <choice>
+ <data type="string" />
+ <empty />
+ </choice>
+ </element>
+ </optional>
+
+ <optional>
+ <element name="briefDescription">
+ <choice>
+ <data type="string" />
+ <empty />
+ </choice>
+ </element>
+ </optional>
+
+ <optional>
+ <element name="comments">
+ <choice>
+ <data type="string" />
+ <empty />
+ </choice>
+ </element>
+ </optional>
+
+ <optional>
+ <element name="distinguishingFeatures">
+ <choice>
+ <data type="string" />
+ <empty />
+ </choice>
+ </element>
+ </optional>
+
+ <optional>
+ <element name="objectName">
+ <choice>
+ <data type="string" />
+ <empty />
+ </choice>
+ </element>
+ </optional>
+
+ <optional>
+ <element name="responsibleDepartment">
+ <choice>
+ <data type="string" />
+ <empty />
+ </choice>
+ </element>
+ </optional>
+
+ <optional>
+ <element name="title">
+ <choice>
+ <data type="string" />
+ <empty />
+ </choice>
+ </element>
+ </optional>
+
+ </interleave>
+
+ </element>
+
+ <!-- A domain- or community-provided schema, if available, would go here -->
+
+ <!-- An site- or instance-provided schema, if available, would go here. -->
+
+
+</element>
-->
<element
- name="collectionObject"
- xmlns="http://relaxng.org/ns/structure/1.0">
+ name="collectionObject"
+ xmlns="http://relaxng.org/ns/structure/1.0"
+ datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
<!-- ######################################################################## -->
<!-- The default CollectionSpace schema for an entity object (extremely simplified). -->
<element
- name="defaultCollectionObject"
- xmlns="http://relaxng.org/ns/structure/1.0"
- datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
+ name="defaultCollectionObject">
<!--
The following data elements are taken from the Basic section,
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+
+<!--
+
+ collectionObject-ns.xml
+
+ A hypothetical, skeletal instance of an CollectionObject payload,
+ represented as an XML document, in a rudimentary root namespace,
+ scoped for the Release 0.1 "Hello World" demo.
+
+ This is created for the CollectionSpace system, http://www.collectionspace.org/
+
+ $Author: aron $
+ $Revision: 509 $
+ $Date: 2008-10-27 13:55:56 -0700 (Mon, 27 Oct 2008) $
+
+-->
+
+<collectionObject
+ xmlns="http://collectionspace.org/hello">
+
+ <serviceMetadata>
+
+ <!-- An entirely arbitrary examle -->
+ <collectionSpaceId>org.collectionspace-eR5zB8tX2aE3wN6zG1</collectionSpaceId>
+
+ </serviceMetadata>
+
+
+ <!--
+ Data below was taken from the following item in the online catalog
+ of the Museum of the Moving Image in Astoria, NY:
+
+ http://collection.movingimage.us/index.php?g=detail&object_id=64117
+
+ The choice of this item was in turn inspired by William Gibson's short story,
+ The Gernsback Continuum:
+
+ http://www.americanheritage.com/articles/magazine/it/1988/1/1988_1_34.shtml
+ -->
+
+
+ <defaultCollectionObject>
+
+ <objectNumber>1984.021.0049</objectNumber>
+
+ <objectName> Radio News, vol. 10, no. 2, August 1928</objectName>
+
+ <!-- Linebreaks were added to the following description for readability -->
+ <briefDescription>Radio News, August 1928. The cover of this issue features an
+illustration of a man and woman watching an early "radio movie." Text on
+the cover reads, "Radio's Greatest Magazine / Radio News / August 25
+Cents / Over 200 illustrations / Edited by Hugo Gernsback / Radio Movies
+and Television for the Home / Experimenter Publishing Company, 230 Fifth
+Avenue, New York."
+
+In addition to articles about radios and radio technology, the magazine
+also contains several articles about developments in the field of
+television. The issue begins with an editorial about the future of
+television by the magazine's editor, Hugo Gernsback, which is followed
+by an article about the radio movie receiver system invented by C.
+Francis Jenkins. The article includes drawings illustrating the layout
+of the sytem.</briefDescription>
+
+ </defaultCollectionObject>
+
+
+<!--
+ <sampleMmiCollectionObject>
+
+ <artifactClass>Books, literature, and periodicals</artifactClass>
+
+ <format>Magazine</format>
+
+ <material>Paper</material>
+
+ <overallDimensions>
+ <height>11.75</height>
+ <width>8.75</width>
+ <measurementUnit>in</measurementUnit>
+ </overallDimensions>
+
+ </sampleMmiCollectionObject>
+-->
+
+</collectionObject>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" targetNamespace="http://collectionspace.org/hello" xmlns:hello="http://collectionspace.org/hello">
+ <xs:element name="collectionObject">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element ref="hello:serviceMetadata"/>
+ <xs:element ref="hello:defaultCollectionObject"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="serviceMetadata">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element ref="hello:collectionSpaceId"/>
+ <xs:element minOccurs="0" ref="hello:created"/>
+ <xs:element minOccurs="0" ref="hello:createdBy"/>
+ <xs:element minOccurs="0" ref="hello:lastModified"/>
+ <xs:element minOccurs="0" ref="hello:lastModifiedBy"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="collectionSpaceId" type="xs:string"/>
+ <xs:element name="created">
+ <xs:simpleType>
+ <xs:union memberTypes="xs:dateTime">
+ <xs:simpleType>
+ <xs:restriction base="xs:token">
+ <xs:length value="0"/>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:union>
+ </xs:simpleType>
+ </xs:element>
+ <xs:element name="createdBy">
+ <xs:simpleType>
+ <xs:union memberTypes="xs:string">
+ <xs:simpleType>
+ <xs:restriction base="xs:token">
+ <xs:length value="0"/>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:union>
+ </xs:simpleType>
+ </xs:element>
+ <xs:element name="lastModified">
+ <xs:simpleType>
+ <xs:union memberTypes="xs:dateTime">
+ <xs:simpleType>
+ <xs:restriction base="xs:token">
+ <xs:length value="0"/>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:union>
+ </xs:simpleType>
+ </xs:element>
+ <xs:element name="lastModifiedBy">
+ <xs:simpleType>
+ <xs:union memberTypes="xs:string">
+ <xs:simpleType>
+ <xs:restriction base="xs:token">
+ <xs:length value="0"/>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:union>
+ </xs:simpleType>
+ </xs:element>
+ <xs:element name="defaultCollectionObject">
+ <xs:complexType>
+ <xs:all>
+ <xs:element ref="hello:objectNumber"/>
+ <xs:element minOccurs="0" ref="hello:otherNumber"/>
+ <xs:element minOccurs="0" ref="hello:briefDescription"/>
+ <xs:element minOccurs="0" ref="hello:comments"/>
+ <xs:element minOccurs="0" ref="hello:distinguishingFeatures"/>
+ <xs:element minOccurs="0" ref="hello:objectName"/>
+ <xs:element minOccurs="0" ref="hello:responsibleDepartment"/>
+ <xs:element minOccurs="0" ref="hello:title"/>
+ </xs:all>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="objectNumber">
+ <xs:simpleType>
+ <xs:restriction base="xs:normalizedString">
+ <xs:minLength value="1"/>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:element>
+ <xs:element name="otherNumber">
+ <xs:simpleType>
+ <xs:union memberTypes="xs:string">
+ <xs:simpleType>
+ <xs:restriction base="xs:token">
+ <xs:length value="0"/>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:union>
+ </xs:simpleType>
+ </xs:element>
+ <xs:element name="briefDescription">
+ <xs:simpleType>
+ <xs:union memberTypes="xs:string">
+ <xs:simpleType>
+ <xs:restriction base="xs:token">
+ <xs:length value="0"/>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:union>
+ </xs:simpleType>
+ </xs:element>
+ <xs:element name="comments">
+ <xs:simpleType>
+ <xs:union memberTypes="xs:string">
+ <xs:simpleType>
+ <xs:restriction base="xs:token">
+ <xs:length value="0"/>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:union>
+ </xs:simpleType>
+ </xs:element>
+ <xs:element name="distinguishingFeatures">
+ <xs:simpleType>
+ <xs:union memberTypes="xs:string">
+ <xs:simpleType>
+ <xs:restriction base="xs:token">
+ <xs:length value="0"/>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:union>
+ </xs:simpleType>
+ </xs:element>
+ <xs:element name="objectName">
+ <xs:simpleType>
+ <xs:union memberTypes="xs:string">
+ <xs:simpleType>
+ <xs:restriction base="xs:token">
+ <xs:length value="0"/>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:union>
+ </xs:simpleType>
+ </xs:element>
+ <xs:element name="responsibleDepartment">
+ <xs:simpleType>
+ <xs:union memberTypes="xs:string">
+ <xs:simpleType>
+ <xs:restriction base="xs:token">
+ <xs:length value="0"/>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:union>
+ </xs:simpleType>
+ </xs:element>
+ <xs:element name="title">
+ <xs:simpleType>
+ <xs:union memberTypes="xs:string">
+ <xs:simpleType>
+ <xs:restriction base="xs:token">
+ <xs:length value="0"/>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:union>
+ </xs:simpleType>
+ </xs:element>
+</xs:schema>
# Requires two arguments:
# - Filename of the RELAX NG schema document.
# (or the full path to this document, if it is not in the current directory)
-# - Filename of the new XML instance document to be created.
+# - Filename of the new W3C XML Schema document to be created.
# (or the full path to this document, if it is not in the current directory)
#
# $Author: aron $