<?xml version="1.0" encoding="UTF-8"?>
<!-- edited with XMLSPY v2004 rel. 4 U (http://www.xmlspy.com) by Jerome LAURET (Brookhaven National Laboratories) -->
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
        <xsd:element name="AbstractRequest">
                <xsd:annotation>
                        <xsd:documentation>A group of requests and a description of how the requests are organized into
a logical sequence of events (AND, OR, XOR, etc ... relationship) as well
as datasets which may be used by requests</xsd:documentation>
                </xsd:annotation>
                <xsd:complexType>
                        <xsd:choice maxOccurs="unbounded">
                                <xsd:element ref="Request"/>
                                <xsd:element ref="Task"/>
                                <xsd:element ref="Application"/>
                                <xsd:element ref="Dataset" minOccurs="0"/>
                                <xsd:element ref="ResourceSpecifications" minOccurs="0"/>
                                <xsd:element name="WorkFlow">
                                        <xsd:annotation>
                                                <xsd:documentation>MergeRequests { id=[xs:ID] }
                RequestID { idref=[xs:IDref] }
                ....
ChooseBetweenRequests { id=[xs:ID] }
                RequestID { idref=[xs:IDref] }
        SetupRequestDependancy { id=[xs:ID] }
                RequestToBeDoneFirstID { idref=[xs:IDref] }
                RequestWaitingForInputID { idref=[xs:IDref] }
</xsd:documentation>
                                        </xsd:annotation>
                                </xsd:element>
                        </xsd:choice>
                </xsd:complexType>
        </xsd:element>
        <xsd:element name="Request">
                <xsd:annotation>
                        <xsd:documentation>For easier handling of initialization, end-task garbagge collection and task
wrap up, we may want to define initialization/finalization special requests.
Those could be defined once, and re-used for every job generated by a
single request.
Also, there may be a need to do a unique request (taks) for all jobs (not
for each jobs).</xsd:documentation>
                </xsd:annotation>
                <xsd:complexType>
                        <xsd:sequence>
                                <xsd:element name="RequestName" minOccurs="0"/>
                                <xsd:element name="RequestDescription" minOccurs="0"/>
                                <xsd:element name="OutputHandling" minOccurs="0">
                                        <xsd:annotation>
                                                <xsd:documentation>This element may be removed later (only a placeholder for later considertaion).
Ideally, outputs are themselves datasets and currentely, input/output are
non-symetrical.</xsd:documentation>
                                        </xsd:annotation>
                                        <xsd:complexType>
                                                <xsd:choice maxOccurs="unbounded">
                                                        <xsd:element name="Copy">
                                                                <xsd:complexType>
                                                                        <xsd:sequence>
                                                                                <xsd:element name="Source"/>
                                                                                <xsd:element name="Destination"/>
                                                                        </xsd:sequence>
                                                                </xsd:complexType>
                                                        </xsd:element>
                                                        <xsd:element name="Register"/>
                                                </xsd:choice>
                                        </xsd:complexType>
                                </xsd:element>
                        </xsd:sequence>
                        <xsd:attribute name="ID" type="xsd:ID"/>
                        <xsd:attribute name="taskRef" type="xsd:IDREF" use="required"/>
                        <xsd:attribute name="appRef" type="xsd:IDREF" use="required"/>
                        <xsd:attribute name="datasetRef" type="xsd:IDREF" use="optional"/>
                        <xsd:attribute name="resourceRef" type="xsd:IDREF" use="optional"/>
                </xsd:complexType>
        </xsd:element>
        <!-- Basic application: it defines a name and a version. -->
        <xsd:element name="Application" type="applicationType">
                <xsd:annotation>
                        <xsd:documentation>Example: A XXTask will depend (or reference) a XXX aplication. Purpose
is to allow versionning. </xsd:documentation>
                </xsd:annotation>
        </xsd:element>
        <xsd:complexType name="applicationType">
                <xsd:attribute name="ID" type="xsd:ID" use="required"/>
                <xsd:attribute name="type" type="xsd:string" use="optional"/>
                <xsd:attribute name="name" type="xsd:string" use="required"/>
                <xsd:attribute name="ver" type="xsd:string" use="optional"/>
        </xsd:complexType>
        <!-- Basic Task.
TODO: is still unclear if the type should be there and how should be used -->
        <xsd:element name="Task" type="taskType">
                <xsd:annotation>
                        <xsd:documentation>In the newly proposed U-JDL, application and task are merged.</xsd:documentation>
                </xsd:annotation>
        </xsd:element>
        <xsd:complexType name="taskType">
                <xsd:attribute name="ID" type="xsd:ID" use="required"/>
                <xsd:attribute name="type" type="xsd:string" use="optional"/>
        </xsd:complexType>
        <!-- Implementation example 1: Script Task  -->
        <xsd:complexType name="scriptTaskType">
                <xsd:complexContent>
                        <xsd:extension base="taskType">
                                <xsd:sequence>
                                        <xsd:element name="Script">
                                                <xsd:complexType>
                                                        <xsd:simpleContent>
                                                                <xsd:extension base="xsd:string"/>
                                                        </xsd:simpleContent>
                                                </xsd:complexType>
                                        </xsd:element>
                                        <xsd:element name="Arguments" type="xsd:string" minOccurs="0" maxOccurs="unbounded"/>
                                        <xsd:element name="STDIN" type="fileType" minOccurs="0"/>
                                        <xsd:element name="STDOUT" type="fileType" minOccurs="0"/>
                                        <xsd:element name="STDERR" type="fileType" minOccurs="0"/>
                                </xsd:sequence>
                        </xsd:extension>
                </xsd:complexContent>
        </xsd:complexType>
        <xsd:element name="ScriptTask" type="scriptTaskType" substitutionGroup="Task"/>
        <!-- Implementation example 2: Java task. Java requires preparation -->
        <xsd:complexType name="javaTaskType">
                <xsd:complexContent>
                        <xsd:extension base="taskType"/>
                </xsd:complexContent>
        </xsd:complexType>
        <xsd:element name="JavaTask" substitutionGroup="Task">
                <xsd:complexType>
                        <xsd:complexContent>
                                <xsd:extension base="javaTaskType">
                                        <xsd:sequence>
                                                <xsd:element name="MainClass" type="xsd:anyURI"/>
                                                <xsd:element name="Arguments"/>
                                                <xsd:element name="ClassPath" minOccurs="0">
                                                        <xsd:annotation>
                                                                <xsd:documentation>This is not done yet ... We will probably take this from Ant.</xsd:documentation>
                                                        </xsd:annotation>
                                                        <xsd:complexType/>
                                                </xsd:element>
                                        </xsd:sequence>
                                </xsd:extension>
                        </xsd:complexContent>
                </xsd:complexType>
        </xsd:element>
        <!-- Basic dataset.
TODO: is still unclear if the type should be there and how should be used -->
        <xsd:element name="Dataset">
                <xsd:annotation>
                        <xsd:documentation>Below, some ideas from DIAL

Dataset{        identity=[xs:ID],
                mutability=[locked,appending],
                location=[virtual,logical,physical,staged,mixed],
                composite=[xs:boolean] }
Contentlist
                ContentKey { type=[xs:string]
</xsd:documentation>
                </xsd:annotation>
                <xsd:complexType>
                        <xsd:complexContent>
                                <xsd:extension base="datasetType"/>
                        </xsd:complexContent>
                </xsd:complexType>
        </xsd:element>
        <xsd:complexType name="datasetType">
                <xsd:attribute name="ID" type="xsd:ID" use="required"/>
                <xsd:attribute name="type" type="xsd:string" use="optional"/>
        </xsd:complexType>
        <!-- Basic extra.
TODO: a better name would be required for this -->
        <xsd:element name="ResourceSpecifications">
                <xsd:complexType>
                        <xsd:complexContent>
                                <xsd:extension base="resspecType">
                                        <xsd:attribute name="ID" type="xsd:ID" use="required"/>
                                </xsd:extension>
                        </xsd:complexContent>
                </xsd:complexType>
        </xsd:element>
        <xsd:complexType name="resspecType">
                <xsd:annotation>
                        <xsd:documentation>Resource Specification type</xsd:documentation>
                </xsd:annotation>
                <xsd:sequence>
                        <xsd:element name="MemoryPerProcess" type="ResourceType" minOccurs="0">
                                <xsd:annotation>
                                        <xsd:documentation>Total Memory (Virtual + RAM). Distinction is not relevant to users ??</xsd:documentation>
                                </xsd:annotation>
                        </xsd:element>
                        <xsd:element ref="InputResource" minOccurs="0"/>
                        <xsd:element ref="OutputResource" minOccurs="0"/>
                        <xsd:element name="Time"/>
                        <xsd:any namespace="##any" minOccurs="0" maxOccurs="unbounded">
                                <xsd:annotation>
                                        <xsd:documentation>The number of resource requirements may change in future.</xsd:documentation>
                                </xsd:annotation>
                        </xsd:any>
                </xsd:sequence>
        </xsd:complexType>
        <xsd:complexType name="fileType">
                <xsd:simpleContent>
                        <xsd:extension base="xsd:string">
                                <xsd:attribute name="fileName" type="xsd:anyURI" use="required"/>
                        </xsd:extension>
                </xsd:simpleContent>
        </xsd:complexType>
        <!-- File List type. This type can be used for both datasets that consists of a list of files,
but also in those task that need to specify a list of files.-->
        <xsd:complexType name="filelistType">
                <xsd:sequence>
                        <xsd:element name="file" type="xsd:anyURI" maxOccurs="unbounded"/>
                </xsd:sequence>
        </xsd:complexType>
        <!-- Physical file dataset. This dataset consists of a pure list of physical files. -->
        <xsd:element name="physicalDataset" type="physicalDatasetType" substitutionGroup="Dataset"/>
        <xsd:complexType name="physicalDatasetType">
                <xsd:complexContent>
                        <xsd:extension base="datasetType">
                                <xsd:sequence>
                                        <xsd:element name="datafiles" type="filelistType"/>
                                </xsd:sequence>
                        </xsd:extension>
                </xsd:complexContent>
        </xsd:complexType>
        <!-- Logical file dataset. This dataset consists of a list of logical files and a catalog
identifier that will be used to resolve the names. -->
        <xsd:element name="logicalDataset" type="logicalDatasetType" substitutionGroup="Dataset"/>
        <xsd:complexType name="logicalDatasetType">
                <xsd:complexContent>
                        <xsd:extension base="datasetType">
                                <xsd:sequence>
                                        <xsd:element name="catalog" type="xsd:string"/>
                                        <xsd:element name="datafiles" type="filelistType"/>
                                </xsd:sequence>
                        </xsd:extension>
                </xsd:complexContent>
        </xsd:complexType>
        <xsd:complexType name="ArchitectureType">
                <xsd:sequence>
                        <xsd:any namespace="##any" minOccurs="0" maxOccurs="unbounded"/>
                </xsd:sequence>
                <xsd:attribute name="PlatformType" type="xsd:string"/>
                <xsd:attribute name="SMPSize" type="xsd:int"/>
                <xsd:anyAttribute namespace="##any"/>
        </xsd:complexType>
        <xsd:complexType name="ProcessorType">
                <xsd:sequence>
                        <xsd:any namespace="##any" minOccurs="0" maxOccurs="unbounded"/>
                </xsd:sequence>
                <xsd:attribute name="Vendor" type="xsd:string"/>
                <xsd:attribute name="Model" type="xsd:string"/>
                <xsd:attribute name="Version" type="xsd:string"/>
                <xsd:attribute name="ClockSpeed" type="xsd:int"/>
                <xsd:attribute name="InstructionSet" type="xsd:string"/>
                <xsd:attribute name="OtherProcessorDescription" type="xsd:string"/>
                <xsd:attribute name="CacheL1" type="xsd:int">
                        <xsd:annotation>
                                <xsd:documentation>in kb</xsd:documentation>
                        </xsd:annotation>
                </xsd:attribute>
                <xsd:attribute name="CacheL1I" type="xsd:int">
                        <xsd:annotation>
                                <xsd:documentation>in kb</xsd:documentation>
                        </xsd:annotation>
                </xsd:attribute>
                <xsd:attribute name="CacheL1D" type="xsd:int">
                        <xsd:annotation>
                                <xsd:documentation>in kb</xsd:documentation>
                        </xsd:annotation>
                </xsd:attribute>
                <xsd:attribute name="CacheL2" type="xsd:int">
                        <xsd:annotation>
                                <xsd:documentation>in kb</xsd:documentation>
                        </xsd:annotation>
                </xsd:attribute>
                <xsd:anyAttribute namespace="##any"/>
        </xsd:complexType>
        <xsd:complexType name="OperatingSystemType">
                <xsd:sequence>
                        <xsd:any namespace="##any" minOccurs="0" maxOccurs="unbounded"/>
                </xsd:sequence>
                <xsd:attribute name="Name" type="xsd:string"/>
                <xsd:attribute name="Release" type="xsd:string"/>
                <xsd:attribute name="Version" type="xsd:string"/>
                <xsd:anyAttribute namespace="##any"/>
        </xsd:complexType>
        <xsd:complexType name="ResourceType">
                <xsd:sequence>
                        <xsd:choice>
                                <xsd:sequence>
                                        <xsd:element name="MininumUnitsRequired" type="xsd:long" minOccurs="0">
                                                <xsd:annotation>
                                                        <xsd:documentation>Minimum may be used for dispatching purposes. A process will not start unless the available resource is above this minimum.</xsd:documentation>
                                                </xsd:annotation>
                                        </xsd:element>
                                        <xsd:element name="MaximumUnitsEstimated" type="xsd:long" minOccurs="0">
                                                <xsd:annotation>
                                                        <xsd:documentation>If unspecified, there are no known upper limits. If specified, this value indicates that the job will use this value as  maximum quanta of the resource will be taken.</xsd:documentation>
                                                </xsd:annotation>
                                        </xsd:element>
                                </xsd:sequence>
                                <xsd:element name="UnitsPerSeconds" type="xsd:long">
                                        <xsd:annotation>
                                                <xsd:documentation>Rate estimated by the user for his request.</xsd:documentation>
                                        </xsd:annotation>
                                </xsd:element>
                        </xsd:choice>
                        <xsd:element name="AverageSizeOfUnit" type="xsd:float">
                                <xsd:annotation>
                                        <xsd:documentation>In MB</xsd:documentation>
                                </xsd:annotation>
                        </xsd:element>
                </xsd:sequence>
        </xsd:complexType>
        <!-- Input will have several implementations -->
        <xsd:element name="InputResource" type="IOType">
                <xsd:annotation>
                        <xsd:documentation>In SUMS, we implemented a numFilesPerHour. This gave an indication of
the input rate for a request. The request would then be split into sub-jobs
according to available resources (CPUtime limit associated to a queue). A
job would end up with 100 files each for example ... while the dataset would
be of several 1000 files. BUT, input may be implemented with a different
concept than files. For example, input can be events, tracks, gene
sequence, etc ... This tries to generalize the idea.</xsd:documentation>
                </xsd:annotation>
        </xsd:element>
        <xsd:element name="OutputResource" type="IOType">
                <xsd:annotation>
                        <xsd:documentation>Symetric of input ... Note that the type of storage is not specified here (like
if the storage is NFS, AFS, Db, etc ...). The rate combined with the unit
size will obviously limit the possibilities of where the jobs can run. This
implies that this resource alone may map to several low-level JDL
requirements (TransferRate, Type from the StorageDevice element
in Glue CE, or event connection speed if we speak of db)</xsd:documentation>
                </xsd:annotation>
        </xsd:element>
        <xsd:complexType name="IOType">
                <xsd:attribute name="type" type="xsd:string"/>
        </xsd:complexType>
        <!-- All below elements are extensions of complex types deriving from IOType  -->
        <xsd:element name="InputFiles" substitutionGroup="InputResource">
                <xsd:complexType>
                        <xsd:complexContent>
                                <xsd:extension base="InputFileType">
                                        <xsd:sequence>
                                                <xsd:element name="value" type="ResourceType"/>
                                        </xsd:sequence>
                                </xsd:extension>
                        </xsd:complexContent>
                </xsd:complexType>
        </xsd:element>
        <xsd:element name="InputTracks" substitutionGroup="InputResource">
                <xsd:complexType>
                        <xsd:complexContent>
                                <xsd:extension base="InputTrackType">
                                        <xsd:sequence>
                                                <xsd:element name="value" type="ResourceType"/>
                                        </xsd:sequence>
                                </xsd:extension>
                        </xsd:complexContent>
                </xsd:complexType>
        </xsd:element>
        <xsd:element name="InputEvents" substitutionGroup="InputResource">
                <xsd:complexType>
                        <xsd:complexContent>
                                <xsd:extension base="InputEventType">
                                        <xsd:sequence>
                                                <xsd:element name="value" type="ResourceType"/>
                                        </xsd:sequence>
                                </xsd:extension>
                        </xsd:complexContent>
                </xsd:complexType>
        </xsd:element>
        <!-- All below elements are extensions of complex types deriving from IOType  -->
        <xsd:element name="OutputFiles" substitutionGroup="OutputResource">
                <xsd:complexType>
                        <xsd:complexContent>
                                <xsd:extension base="OutputFileType">
                                        <xsd:sequence>
                                                <xsd:element name="value" type="ResourceType"/>
                                        </xsd:sequence>
                                </xsd:extension>
                        </xsd:complexContent>
                </xsd:complexType>
        </xsd:element>
        <xsd:element name="OutputTracks" substitutionGroup="OutputResource">
                <xsd:complexType>
                        <xsd:complexContent>
                                <xsd:extension base="OutputTrackType">
                                        <xsd:sequence>
                                                <xsd:element name="value" type="ResourceType"/>
                                        </xsd:sequence>
                                </xsd:extension>
                        </xsd:complexContent>
                </xsd:complexType>
        </xsd:element>
        <xsd:element name="OutputEvents" substitutionGroup="OutputResource">
                <xsd:complexType>
                        <xsd:complexContent>
                                <xsd:extension base="OutputEventType">
                                        <xsd:sequence>
                                                <xsd:element name="value" type="ResourceType"/>
                                        </xsd:sequence>
                                </xsd:extension>
                        </xsd:complexContent>
                </xsd:complexType>
        </xsd:element>
        <!-- All below  complex types extend IOType. There are implementations of IOType -->
        <xsd:complexType name="InputFileType">
                <xsd:complexContent>
                        <xsd:extension base="IOType"/>
                </xsd:complexContent>
        </xsd:complexType>
        <xsd:complexType name="InputEventType">
                <xsd:complexContent>
                        <xsd:extension base="IOType"/>
                </xsd:complexContent>
        </xsd:complexType>
        <xsd:complexType name="InputTrackType">
                <xsd:complexContent>
                        <xsd:extension base="IOType"/>
                </xsd:complexContent>
        </xsd:complexType>
        <!-- All below  complex types extend IOType. There are implementations of IOType -->
        <xsd:complexType name="OutputFileType">
                <xsd:complexContent>
                        <xsd:extension base="IOType"/>
                </xsd:complexContent>
        </xsd:complexType>
        <xsd:complexType name="OutputEventType">
                <xsd:complexContent>
                        <xsd:extension base="IOType"/>
                </xsd:complexContent>
        </xsd:complexType>
        <xsd:complexType name="OutputTrackType">
                <xsd:complexContent>
                        <xsd:extension base="IOType"/>
                </xsd:complexContent>
        </xsd:complexType>
</xsd:schema>