<?xml version="1.0" encoding="UTF-8"?>
<!--
    
    HyperRecordML Markup Language for Museum Collections
    
    Copyright (C) 2004-2008 Klaus E. Werner
    
    This file is part of HRecordML.
    
    HRecordML is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.
    
    HRecordML is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.
    
    You should have received a copy of the GNU General Public License
    along with HRecordML.  If not, see <http://www.gnu.org/licenses/>.
    
    Contact the author at kewerner@icrim.net
    
-->
<grammar datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes"
    ns="http://hyperrecord.net/hrecord/"
    xmlns:xlink="http://www.w3.org/1999/xlink"
    xmlns:class="http://collectio.org/classifications/"
    xmlns="http://relaxng.org/ns/structure/1.0">
    <documentation xmlns="http://relaxng.org/ns/compatibility/annotations/1.0"
        >HyperRecordML: An XML RelaxNG Schema for museum documentation provided
        by HyperRecord.Net. Copyright Klaus E. Werner</documentation>
    <include href="hrecord.rng">
        <define name="administrator">
            <element name="administrator">
                <choice>
                    <value type="token">Musei Capitolini</value>
                    <value type="token">Antiquarium Comunale</value>
                </choice>
            </element>
        </define>
        <define name="owner">
            <element name="owner">
                <choice>
                    <value type="token">Comune di Roma</value>
                </choice>
            </element>
        </define>
        <define name="inventary">
            <oneOrMore>
                <element name="inventary">
                    <element name="name">
                        <choice>
                            <value type="token">Ingresso Antiquarium
                                Comunale</value>
                            <value type="token">Inventario Antiquarium</value>
                            <value type="token">Inventario Colonne</value>
                            <value type="token">Inventario Epigrafi</value>
                            <value type="token">Inventario Sculture</value>
                            <value type="token">Inventario Albani</value>
                            <value type="token">Inventario Boccapaduli</value>
                            <value type="token">Inventario Campana</value>
                            <value type="token">Inventario Castellani</value>
                            <value type="token">Inventario Della Valle</value>
                            <value type="token">Inventario Farnese</value>
                            <value type="token">Inventario Mattei</value>
                            <value type="token">Inventario Mobili</value>
                            <value type="token">Inventario Ottoboni</value>
                            <value type="token">Inventario Protomoteca</value>
                            <value type="token">Inventario Stanzani</value>
                            <value type="token">Inventario Museo Artistico
                                Industriale</value>
                            <value type="token">Inventario Medagliere
                                Nuovo</value>
                            <value type="token">Inventario Medagliere
                                Vecchio</value>
                            <value type="token">Registro Ingresso</value>
                            <value type="token">Registro Oggetti
                                Ritrovati</value>
                            <value type="token">[non identificato]</value>
                        </choice>
                    </element>
                    <oneOrMore>
                        <element name="number">
                            <data type="token"></data>
                        </element>
                    </oneOrMore>
                    <optional>
                        <element name="notes">
                            <text></text>
                        </element>
                    </optional>
                </element>
            </oneOrMore>
        </define>
        <define name="href">
            <attribute name="xlink:href">
                <choice>
                    <ref name="bhertz-id"></ref>
                    <ref name="mcap-id"></ref>
                </choice>
            </attribute>
        </define>
        <!-- warschau! the following id is under the xlink namespace instead of the usual xml namespace -->
        <define name="id">
            <attribute name="xlink:href">
                <documentation
                    xmlns="http://relaxng.org/ns/compatibility/annotations/1.0">
                    binding the record to a unique id</documentation>
                <ref name="mcap-id"></ref>
            </attribute>
        </define>
        <define name="locationContent">
            <oneOrMore>
                <element name="frame">
                    <documentation
                        xmlns="http://relaxng.org/ns/compatibility/annotations/1.0"
                        >the "[time-]frame" element</documentation>
                    <ref name="datetime"></ref>
                    <choice>
                        <!--    <ref name="cadastre"/> -->
                        <ref name="excavation"></ref>
                        <ref name="locationclass"></ref>
                        <!--     <ref name="georeference"/>  -->
                    </choice>
                    <ref name="notes"></ref>
                </element>
            </oneOrMore>
        </define>
        <define name="techdata">
            <element name="techdata">
                <ref name="notes"></ref>
                <oneOrMore>
                    <ref name="aspect"></ref>
                </oneOrMore>
                <zeroOrMore>
                    <ref name="materialclass"></ref>
                </zeroOrMore>
                <zeroOrMore>
                    <ref name="techniqueclass"></ref>
                </zeroOrMore>
            </element>
        </define>
        <define name="iconography">
            <element name="iconography">
                <ref name="objectclass"></ref>
                <!-- we just take out iconclass -->
                <oneOrMore>
                    <ref name="denomination"></ref>
                </oneOrMore>
            </element>
        </define>
        <define name="creationContent">
            <oneOrMore>
                <element name="frame">
                    <documentation
                        xmlns="http://relaxng.org/ns/compatibility/annotations/1.0"
                        >the "[time-]frame" element</documentation>
                    <ref name="datetime"></ref>
                    <zeroOrMore>
                        <ref name="authorclass"></ref>
                    </zeroOrMore>
                    <optional>
                        <ref name="locationclass"></ref>
                    </optional>
                    <ref name="notes"></ref>
                </element>
            </oneOrMore>
        </define>
        <define name="exhibitionContent">
            <oneOrMore>
                <element name="frame">
                    <documentation
                        xmlns="http://relaxng.org/ns/compatibility/annotations/1.0"
                        >the "[time-]frame" element</documentation>
                    <ref name="datetime"></ref>
                    <ref name="locationclass-worldcapitals"></ref>
                    <ref name="exhibitionclass-world"></ref>
                    <ref name="notes"></ref>
                </element>
            </oneOrMore>
        </define>
        <define name="techniqueclass">
            <choice>
                <ref name="techniqueclass-numismatic"></ref>
            </choice>
        </define>
        <define name="materialclass">
            <choice>
                <ref name="materialclass-stone"></ref>
                <ref name="materialclass-earthen"></ref>
                <ref name="materialclass-artificial"></ref>
                <ref name="materialclass-metal"></ref>
                <ref name="materialclass-numismatic"></ref>
            </choice>
        </define>
        <define name="authorclass">
            <choice>
                <ref name="authorclass-names"></ref>
                <ref name="authorclass-emperors.roman"></ref>
                <ref name="authorclass-dynasties.islamic"></ref>
            </choice>
        </define>
        <define name="locationclass">
            <choice>
                <ref name="locationclass-germany"></ref>
                <ref name="locationclass-italy"></ref>
                <ref name="locationclass-rome.museums"></ref>
                <oneOrMore>
                    <ref name="locationclass-collections"></ref></oneOrMore>
                <ref name="locationclass-empire.roman"></ref>
                <ref name="locationclass-mints.roman"></ref>
                <ref name="locationclass-mints.islamic"></ref>
            </choice>
        </define>
        <define name="objectclass">
            <oneOrMore>
                <choice>
                    <ref name="objectclass-container"></ref>
                    <ref name="objectclass-instrument"></ref>
                    <ref name="objectclass-sculpture"></ref>
                    <ref name="objectclass-architecture"></ref>
                    <ref name="objectclass-painting"></ref>
                    <ref name="objectclass-inscription"></ref>
                    <ref name="objectclass-furniture"></ref>
                    <ref name="objectclass-ambient"></ref>
                    <ref name="objectclass-mosaic"></ref>
                    <ref name="objectclass-numismatic.roman"></ref>
                    <ref name="objectclass-numismatic.islamic"></ref>
                </choice>
            </oneOrMore>
        </define>
        <!--    <define name="iconclass">
            <zeroOrMore>
            <choice>
            <ref name="iconclass-personsmythological"/>
            <ref name="iconclass-personshistorical"/>
            </choice>
            </zeroOrMore>
            </define>
        -->
    </include>
    <include href="class/0001.ic.personsmythological.rng"></include>
    <include href="class/0001.ic.personshistorical.rng"></include>
    <include href="class/0001.ac.names.rng"></include>
    <include href="class/0001.ac.emperors.roman.rng"></include>
    <include href="class/0001.at.dynasties.islamic.rng"></include>
    <include href="class/0001.lc.germany.rng"></include>
    <include href="class/0001.lc.italy.rng"></include>
    <include href="class/0001.lc.collections.rng"></include>
    <include href="class/0001.lc.rome.museums.rng"></include>
    <include href="class/0001.lc.empire.roman.rng"></include>
    <include href="class/0001.lc.mints.roman.rng"></include>
    <include href="class/0001.lc.mints.islamic.rng"></include>
    <include href="class/0001.lc.world.capitals.rng"></include>
    <include href="class/0001.oc.container.rng"></include>
    <include href="class/0001.oc.instrument.rng"></include>
    <include href="class/0001.oc.sculpture.rng"></include>
    <include href="class/0001.oc.inscription.rng"></include>
    <include href="class/0001.oc.furniture.rng"></include>
    <include href="class/0001.oc.ambient.rng"></include>
    <include href="class/0001.oc.mosaic.rng"></include>
    <include href="class/0001.oc.architecture.rng"></include>
    <include href="class/0001.oc.painting.rng"></include>
    <include href="class/0001.oc.numismatic.roman.rng"></include>
    <include href="class/0001.oc.numismatic.islamic.rng"></include>
    <include href="class/0001.mc.stone.rng"></include>
    <include href="class/0001.mc.earthen.rng"></include>
    <include href="class/0001.mc.artificial.rng"></include>
    <include href="class/0001.mc.metal.rng"></include>
    <include href="class/0001.mc.numismatic.rng"></include>
    <include href="class/0001.tc.numismatic.rng"></include>
    <include href="class/0001.xc.world.rng"></include>
</grammar>

