datatypes xsd = "http://www.w3.org/2001/XMLSchema-datatypes" 
namespace xhtml = "http://www.w3.org/1999/xhtml"


include "common.rnc"

start = UserSpace

#---------------------------------------------------------------#
#                     Mobyle UserSpace Definition               #
#---------------------------------------------------------------#

UserSpace = element userSpace { 
	element authenticated{xsd:boolean}&
	element activated{xsd:boolean}&
	element activatingKey{xsd:string}&
	Email&
	element passwd{xsd:string}&
	element captchaSolution{xsd:string}?&
	element dataList{
		element data{
  			attribute id {xsd:ID}&
  			attribute size {xsd:positiveInteger}&
  			attribute count {xsd:positiveInteger}&
  			element userName {xsd:string}&
  			element type { #warning: the type format will soon be unified between program& job and userSpace documents.
				element biotype { text }*&
				# the biological type of the parameter DNA & Protein ...
				# the biotypes list represents the list of accepted 'types'
				# for input parameters and the list of 'types' that an 
				# output may belong to
				element datatype { 
					# type of the data Sequence & Structure & Matrix ...
					element class { text }&
					element superclass { text }?
					#  superclass& or class if class does not exist
					# is a Mobyle parameter Class defined in Src/Mobyle/Core.py or in Local/CustomClasses/
				}&
				DataFormat*				
  			}&
  			element headOfData {xsd:string}&
  			element inputModes {
  				element inputMode {"db"|"paste"|"upload"|"result"}
  			}&
  			element producedBy {
	  			attribute id {xsd:IDREF}
  			}&
  			element usedBy {
	  			attribute id {xsd:IDREF}
  			}
		}*
	}&
	element jobList{
		element job{
  			attribute id {xsd:anyURI}&
  			element userName {xsd:string}&
  			element programName {xsd:string}&
  			element userAnnotation {
  				element description {xsd:string}?&
  				element labels {xsd:string}*
  				}*&
  			element date {xsd:string}&  						
  			element status {xsd:string}&
  			element dataUsed {
	  			attribute id {xsd:string}
  			}&
  			element dataProduced {
	  			attribute id {xsd:string}
  			}
		}*
	}
}