Changeset 711

27/03/06 17:25:14 (13 years ago)

Moving towards NumSim V007

2 edited


  • TI01-discovery/trunk/schema/numsim/NumSim.xsd

    r695 r711  
    11<?xml version="1.0" encoding="UTF-8"?> 
    2 <xs:schema xmlns:xs=""> 
     2<xs:schema xmlns:xs="" xmlns:xlink="" 
     3    xmlns:gco="" xmlns:gmd="" 
     4    version="0071"> 
     5    <xs:annotation> 
     6        <xs:documentation> Author: Bryan Lawrence Version date: March 27th, 2006 </xs:documentation> 
     7    </xs:annotation> 
     8    <xs:annotation> 
     9        <xs:documentation>The expectation is that this schema will be used initially by import into 
     10            DIF discovery records and eventually into ISO19115 based discovery records. While such 
     11            discovery records already include adequate possibilities to include free text 
     12            information and/or URI references which would allow such discrimination for a human 
     13            reader, they do not allow the construction of sensible automatic discriminants, which 
     14            would allow a software agent to identify, for example, all simulation datasets based on 
     15            the IPCC SRESA1 forcing specification by the HADCM3 model. Such a software agent is 
     16            necessary to provide meaningful discovery services on an archive holding multiple 
     17            simulation datasets, and thus, there is a requirement to build information structures to 
     18            support such software agents. The NumSim schema provides a minimum set of such metadata 
     19            structures aimed at supporting the widest possible set of simulation codes. It is 
     20            expected that more detailed discipline specific metadata schema will exist, such as the 
     21            Numerical Model Metadata Suite (hereafter the NMM). Where such schema and instances 
     22            exist, it is desirable that the NumSim instances are automatically generated from the 
     23            more detailed metadata. </xs:documentation> 
     24        <xs:documentation>The NumSim schema exists in a context where NumSim compliant xml metadata 
     25            is to included in a document conforming to an (extensible) parent schema. That parent 
     26            schema is assumed to have adequate tags to fully describe the data produced by the 
     27            simulation, the point of the NumSim metadata is to discriminate between such datasets, 
     28            as a consequence all dataset description is offloaded to the parent schema, but there 
     29            are some tags which might appear in both the parent and the NumSim schema. In such a 
     30            case, the scope of the tag in the NumSim schema is simply the scope of the parent 
     31            element, while the scope of the tag in the parent document should be assumed to be 
     32            either that of the parent element, or in regard to the data, not the simulation. (For 
     33            example, reference lists may appear in multiple places in a discovery document, but 
     34            their scope and applicability is related to where they appear. By doing this it is 
     35            possible to search for datasets created by simulations with a particular model component 
     36            which was described in a particular </xs:documentation> 
     37        <xs:documentation>The simulated element is intended to appear as part of a dataset 
     38            description, and is used to discriminate between differing simulations of the same 
     39            phenomena. There are essentially three different cases where it is expected be used, and 
     40            for which it has been designed: (1) Where the dataset consists of one realization of the 
     41            simulated phenomena (a single integration of a numerical code). (2) Where the dataset 
     42            consists of multiple realizations of the phenomena (an ensemble), and (3) Where the 
     43            dataset consists of a single realization of the simulated phenomena, but where that 
     44            realization has been generated from an ensemble average (an ensemble “climatology”). </xs:documentation> 
     45        <xs:documentation>There are a number of schema which are imported here, copies of which are 
     46            loaded into a directory of schema. These include xlinks.xsd and a number of draft 
     47            ISO19139 schema components. </xs:documentation> 
     48    </xs:annotation> 
     49    <xs:import namespace="" 
     50        schemaLocation="../"/> 
     51    <xs:import namespace="" 
     52        schemaLocation="../iso19139/gml3.1.1version/gco/gco.xsd"/> 
     53    <xs:import namespace="" 
     54        schemaLocation="../iso19139/gml3.1.1version/gmd/citation.xsd"/> 
     55    <xs:attributeGroup name="NS_link"> 
     56        <xs:annotation> 
     57            <xs:documentation> The attributes are those of a hyperlink, with the addition of a role 
     58                which we might later want to control in a vocabulary</xs:documentation> 
     59        </xs:annotation> 
     60        <xs:attribute ref="xlink:href" use="required"/> 
     61        <xs:attribute ref="xlink:title" use="required"/> 
     62        <xs:attribute ref="xlink:role" use="optional"/> 
     63        <xs:attribute name="dateOfCitation" type="gco:Date_Type" use="optional"/> 
     64    </xs:attributeGroup> 
    365    <xs:complexType name="NS_RelatedTo"> 
    4         <xs:sequence> 
    5             <xs:element name="NS_URI" type="xs:anyURI"/> 
     66        <xs:annotation> 
     67            <xs:documentation> Used for any relationships.</xs:documentation> 
     68        </xs:annotation> 
     69        <xs:sequence> 
    670            <xs:element name="NS_Relationship" type="xs:string"/> 
    771        </xs:sequence> 
     72        <xs:attributeGroup ref="NS_link"/> 
    873    </xs:complexType> 
    974    <xs:complexType name="NS_Description" mixed="true"> 
    1479    </xs:complexType> 
    1580    <xs:complexType name="NS_ReferenceList"> 
    16         <xs:sequence> 
     81        <xs:choice> 
    1782            <xs:element name="NS_Reference" type="xs:string" minOccurs="1" maxOccurs="unbounded"/> 
    18         </xs:sequence> 
     83            <xs:element name="NS_Citation" type="gmd:CI_Citation_Type" minOccurs="1" 
     84                maxOccurs="unbounded"/> 
     85        </xs:choice> 
    1986    </xs:complexType> 
    2087    <xs:complexType name="NS_ControlledParameters"> 
    132199    <xs:complexType name="NS_EnsembleDetails"> 
    133200        <xs:annotation> 
    134             <xs:documentation>Should only appear if the simulated data is from an ensemble of 
    135                 simulations. Statistics should be set true if the original individual simulations 
    136                 are not available. </xs:documentation> 
    137         </xs:annotation> 
    138         <xs:sequence> 
    139             <xs:element name="NS_EnsembleDescription" type="NS_Description" minOccurs="0" maxOccurs="1"/> 
     201            <xs:documentation>If not present, the default assumption should be that the simulation 
     202                is a single realization. If present, the attribute can identify that the data 
     203                represents an ensemble climatology by setting the Boolean EnsembleStatistics to 
     204                True, otherwise the default is that the data are multiple realizations. This element 
     205                may include multiple EnsembleType elements, which are drawn from the EnsembleTypes 
     206                controlled vocabulary: o Initial Condition o Perturbed Physics o Arbitrary 
     207                Collection o Single Mode o Multiple Model o Multiple Forcing o GrandEnsemble (any 
     208                combination of the others, in which case the exact combination should be recorded in 
     209                the EnsembleDescription element - itself including both a textural component and an 
     210                optional related URI for more information). If only one integration is included, 
     211                just one model element should be used. Whether an ensemble or a single integration 
     212                is described by this element, multiple boundary and initial conditions elements are 
     213                allowed (in the case of single integrations to support multiple components of the 
     214                model having different initial and/or boundary conditions, and for ensembles to 
     215                potentially include multiple boundary conditions associated with multiple forcings). 
     216                (Note that more complex ensemble statistics, such as, for example probability 
     217                distribution functions, are likely to be more fully described by the data 
     218                attributes, this attribute is simply used to aid users in finding ensemble averages 
     219                and avoid them being mistaken for instances and used inappropriately). 
     220            </xs:documentation> 
     221        </xs:annotation> 
     222        <xs:sequence> 
     223            <xs:element name="NS_EnsembleDescription" type="NS_Description" minOccurs="0" 
     224                maxOccurs="1"/> 
    140225            <xs:element name="NS_EnsembleType" type="NS_EnsembleTypes" minOccurs="1" 
    141226                maxOccurs="unbounded"/> 
    144229    </xs:complexType> 
    145230    <xs:complexType name="NS_Model"> 
     231        <xs:annotation> 
     232            <xs:documentation> The NS_Model complex type is used to both as the type of the overall 
     233                model description (forming a compulsory element within the NumSIm element itself), 
     234                and as the type of any sub component of that model. </xs:documentation> 
     235        </xs:annotation> 
    146236        <xs:sequence> 
    147237            <xs:element name="NS_Name" type="xs:string" minOccurs="1" maxOccurs="1"/> 
    151241                maxOccurs="unbounded"/> 
    152242            <xs:element name="NS_Description" type="NS_Description" minOccurs="0" maxOccurs="1"/> 
    153             <xs:element name="NS_RelatedModel" type="NS_RelatedTo" minOccurs="0" maxOccurs="1"/> 
     243            <xs:element name="NS_Resolution" type="NS_Description" minOccurs="0" maxOccurs="1"/> 
     244            <xs:element name="NS_RelatedModel" type="NS_RelatedTo" minOccurs="0" 
     245                maxOccurs="unbounded"/> 
    154246            <xs:element name="NS_References" type="NS_ReferenceList" minOccurs="0" maxOccurs="1"/> 
    155247            <xs:element name="NS_Component" type="NS_Model" minOccurs="0" maxOccurs="unbounded"/> 
    159251        <xs:sequence> 
    160252            <xs:element name="NS_Description" type="NS_Description"/> 
    161             <xs:element name="NS_Model" type="NS_Model" minOccurs="0" maxOccurs="unbounded"/> 
     253            <xs:element name="NS_Model" type="NS_Model" minOccurs="1" maxOccurs="unbounded"/> 
    162254            <xs:element name="NS_BoundaryCondition" type="NS_BoundaryCondition" minOccurs="0" 
    163255                maxOccurs="unbounded"/> 
  • TI01-discovery/trunk/schema/numsim/

    r704 r711  
    33# Start with methods for handling the various types we've defined and what they should look like 
     5#  See useful ideas at 
     7class ElementWrapper: 
     8        '''Return the character text tab from any subelement (returns None for 
     9        missing attributes/subelements unless they begin with __).''' 
     10        #From 
     11        def __init__(self, element): 
     12            self._element = element 
     13        def __getattr__(self, tag): 
     14            if tag.startswith("__"): raise AttributeError(tag) 
     15            return self._element.findtext(tag) 
    517def hyperlink(target,name): 
    618        return '<a href="%s">%s</a>'%(target,name) 
     20unmarshallers = { 
     21        # simple HTML 
     22        "anyURI": lambda x: hyperlink(x) 
    827def RelatedTo(element,linkName='hyperlink',title=False): 
Note: See TracChangeset for help on using the changeset viewer.