Results 1 to 4 of 4
Hi,
I really need help.
There is this web portal which generates a command line or XML file of bioinformatics tools. In short, the portal generates a program.
Now I'm ...
- 07-01-2009 #1Just Joined!
- Join Date
- Apr 2009
- Location
- Philippines
- Posts
- 23
Generating application with XML file
Hi,
I really need help.
There is this web portal which generates a command line or XML file of bioinformatics tools. In short, the portal generates a program.
Now I'm very confused on how these portal generates the program using xml file.
Here's an example of the program in xml file:
I ask these because I want to generate this program to other portal, but I don't know how.Code:<?xml version="1.0" encoding="ISO-8859-1"?> <program> <head> <name>yank</name> <version>5.0.0</version> <doc> <title>yank</title> <description> <text lang="en">Reads a sequence range, appends the full USA to a list file</text> </description> <authors>EMBOSS</authors> <reference>url</reference> </doc> <category>sequence:edit</category> <command>yank</command> </head> <parameters> <paragraph> <name>input</name> <prompt lang="en">Input section</prompt> <parameters> <parameter issimple="1" ismandatory="1"> <name>sequence</name> <prompt lang="en">Sequence option</prompt> <type> <datatype> <class>Sequence</class> </datatype> <acceptedDataFormats> <dataFormat>EMBL</dataFormat> <dataFormat>FASTA</dataFormat> <dataFormat>GCG</dataFormat> <dataFormat>GENBANK</dataFormat> <dataFormat>NBRF</dataFormat> <dataFormat>PIR</dataFormat> <dataFormat>RAW</dataFormat> <dataFormat>SWISSPROT</dataFormat> </acceptedDataFormats> <card>1,1</card> </type> <format> <code proglang="python">("", " -sequence=" + str(value))[value is not None]</code> </format> <argpos>1</argpos> </parameter> </parameters> </paragraph> <paragraph> <name>output</name> <prompt lang="en">Output section</prompt> <parameters> <parameter> <name>newfile</name> <prompt lang="en">Overwrite existing output file</prompt> <type> <datatype> <class>Boolean</class> </datatype> </type> <vdef> <value>0</value> </vdef> <format> <code proglang="python">("", " -newfile")[ bool(value) ]</code> </format> <argpos>2</argpos> </parameter> <parameter> <name>outfile</name> <prompt lang="en">Name of the output file (outfile)</prompt> <type> <datatype> <class>Filename</class> </datatype> </type> <vdef> <value>yank.outfile</value> </vdef> <format> <code proglang="python">(" -outfile=" + str(vdef), " -outfile=" + str(value))[value is not None]</code> </format> <argpos>3</argpos> </parameter> <parameter isout="1"> <name>outfile_out</name> <prompt lang="en">Outfile_out option</prompt> <type> <datatype> <class>USA_list</class> <superclass>AbstractText</superclass> </datatype> </type> <filenames> <code proglang="python">outfile</code> </filenames> </parameter> </parameters> </paragraph> <parameter ishidden="1"> <name>auto</name> <prompt lang="en">Turn off any prompting</prompt> <type> <datatype> <class>String</class> </datatype> </type> <format> <code proglang="python">" -auto -stdout"</code> </format> <argpos>4</argpos> </parameter> </parameters> </program>
Do you guys have any idea? I don't know XML that well.
Any advice will be very much appreciated.
Thanks.
- 07-01-2009 #2Linux Guru
- Join Date
- Apr 2009
- Location
- I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
- Posts
- 8,974
From the XML document it appears that it is intended to be used to generate a python script. You need a program to convert the xml to python, but since the document as you show it has no XSS or DTD information embedded there is no way to properly decode it other than by guess-work. My suggestion is to check on the portal that generates this code for a translator application or script.
Sometimes, real fast is almost as good as real time.
Just remember, Semper Gumbi - always be flexible!
- 07-02-2009 #3Just Joined!
- Join Date
- Apr 2009
- Location
- Philippines
- Posts
- 23
Thanks.
The program has a 3 other files aside from xml files called portal.rng, portal.sch and portal.rnc
PORTAL.RNC
PORTAL.RNGCode:tart = Program|JobState|UserSpace #Mobyle Program Definition Program = element program { element head { # the name of the program& it must be the same as the xml filename # ex : blast2 (blast2.xml) Name& element version { text }?& element doc { element title { text }& element description { (Text*|anyXHTML) }& element authors { anyXHTML }?& element reference { attribute doi {xsd:anyURI}?& anyXHTML }*& element doclink { xsd:anyURI }*& Comment? }& element category { text }*& element biomobyCategory { text }?& #this element stores the biomoby serviceType property value. (element command { attribute path { text }?& text } | element biomobyInvocation { # the biomobyInvocation part contains information that is needed in case the XML is used to invoke a # biomoby Web Service element authURI {xsd:anyURI}& element registry { element endpoint {xsd:anyURI}& element namespace{xsd:anyURI}? } })?& element env { attribute name { text }?& text }*& Layout? }& Parameters } Name = element name {xsd:ID} Comment = element comment { (Text*|anyXHTML) } Parameters = element parameters { (Parameter | Paragraph)* } Parameter = element parameter { attlist.parameter& Name& ( Prompt* & element type { 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/ }& element acceptedDataFormats { attribute force { xsd:boolean }?& DataFormat+ # the format of the data # if datatype == Sequence format could have this values : # IG & GENBANK & NBRF & EMBL & GCG & DNASTRIDER & FASTA & RAW & # PIR & XML & SWISSPROT & GDE & }?& element card { text }?& # the cardinality of the datatype &a number or a couple of value & int&int or int&n # biotype=Protein datatype=( class = Sequence ) & format=Fasta & card=1 means # the user must provide 1 and only one Protein Sequence in Fasta format to fill this input parameter # biotype=Protein datatype=( class = Sequence ) & format=Fasta & card=1.n means # the user must provide 1 or more Protein Sequence in Fasta format to fill this input parameter element biomoby { element datatype {text}?& element namespace {text}? }? # the name of the object in the bioMoby ontology. it's implied # that it's a primary and if not specify the parameter is a secondary in biomoby })& Precond?& element vdef { Value+ }?& # the default value or list of values (clustalw) for the parameter # the vdef element is mandatory if the parameter has a vlist or a flist. ( element vlist { element velem { ListElem }+ }? # a list of the available values for this parameter? | element flist { # flist permit to associate a code with a value which is associate to a label in interface # you could associate different codes with different proglangs for one value element felem { ListElem& Code+ }* }? )& element separator { text }?& # the character used to split the elements of a vlist for the MultipleChoice? Format?& element ctrl { Message& Code+ }*& # associated a message to a code& the code permit to # specify the valids values for a parameter* element scale { element min { (Value | Code+) }& element max { (Value | Code+) }& element inc { text }? }?& Argpos?& Comment?& element paramfile { text }?& element width { text }?& element height { text }?& # the name of the file when the parameters are specified in a file instead on command line element filenames { Code+ }?& # this element is required if the attribute isout="1" # it's indicate the name of a file where a result is stored # each code must have ONLY ONE file unix mask element interface { (attribute field {"select"|"radio"} |anyXHTML) }?& element example { text }? # example data for a given parameter } ListElem = (attribute undef { xsd:boolean }?& Value& Label) # the undef attribute specifies if an element is an alias for a non specified value. # this links a label to the undefined value in the selectbox of the web form. attlist.parameter &= attribute ismaininput { xsd:boolean }?& attribute ismandatory { xsd:boolean }?& attribute iscommand { xsd:boolean }?& attribute ishidden { xsd:boolean }?& attribute issimple { xsd:boolean }?& (attribute isout { xsd:boolean }? | attribute isstdout { xsd:boolean }?) # ismaininput : if True& the parameter is a primary article of the corresponding biomoby service (as used in PlayMoby) # ismandatory : if true& this parameter should be specified by the user # iscommand : if true& this parameter specify the line of command to run the program used when the command line is more complicated. # issimple : specify if this parameter will be displayed only in the simple web form. # isout : if true& this parameter is a produce by this service # isstdout : if true& this parameter is the standart output of the service. if true that implies isout=1 and only one parameter could be isstdout="1" per service DataFormat = element dataFormat { text } Prompt = element prompt { Lang?& text } Lang = attribute lang { xsd:language } # lang as in RFC-1766 (e.g.& en-US& fr& fr-FR& etc.) Format = element format { Code+ } # a code which will be evaluated to form the command line Argpos = element argpos { text } # in parameter: specify the position of this parameter on the command line # in paragraph: specifiy the position on the command line for all parameters of this paragraph # by convention the argpos of command must be 0. if we want args before command we could get negative argpos. Label = element label { text } # the text associated to a value which will be display on the form Message = element message { Text+ } # a message displayed when the control fail Precond = element precond { Code+ } # in parameter : the parameter is linked to a condition # ex : this parameter could be used only if an other parameter has been specified Value = element value { text } # Code = element code { attlist.code& text } # a code snipet in a programming language attlist.code &= attribute proglang { text } # proglang: the language in wich the code is written # eg: perl& python& acd& seqlab Text = element text { attlist.text& text } attlist.text &= attribute proglang { text }?& Lang& attribute href { text }? # anyXHTML = (element xhtml:* { (attribute * { text } | text | anyXHTML)* }|text) xhtmlDiv = element xhtml:div { (attribute * { text } | text | anyXHTML)* } Paragraph = element paragraph { Name& Prompt*& Precond*& Format?& Argpos?& Comment?& Parameters& Layout? } Layout = element layout { (Hbox | Vbox)+ } Hbox = element hbox { (Box | Layout) + } Vbox = element vbox { (Box | Layout) + } Box = element box { text } #Mobyle JobState Definition JobState = element jobState { #this part describes the elements specific to the file that stores job information element name {xsd:anyURI}& #name is the url of the program invoked to run the job element host {xsd:anyURI}& #host is the host server of the job element id {xsd:anyURI}& #id is the job identifier element date {xsd:token}& #date on which the job has been submitted on the server element status{ element value{ "building"|"submitted"|"pending"|"running"|"finished"|"error" |"killed"|"hold"|"finishing" }& element message{text}? }& Email?& element sessionKey {text}?& element workflowId {text}?& element data{ Input*& Output* }?& element paramFiles { File* }?& element commandLine{text}? } Email = element email {xsd:token {pattern = "[a-z0-9\-\._]+@([a-z0-9\-]+\.)+([a-z]){2,4}"}} Input = element input{ Parameter& ((File& element fmtProgram {text}?& element formattedFile{ FileContent }?) |element value {text}) } Output = element output{ Parameter& File* } File = element file{ FileContent } FileContent = ( attribute size{xsd:positiveInteger}?& attribute fmt{xsd:string}?& attribute origName{xsd:string}& text ) #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 date {xsd:string}& element status {xsd:string}& element dataUsed { attribute id {xsd:string} }& element dataProduced { attribute id {xsd:string} } }* } }
PORTAL.SCHCode:<?xml version="1.0" encoding="UTF-8"?> <start> <choice> <ref name="Program"/> <ref name="JobState"/> <ref name="UserSpace"/> </choice> </start> <!-- Mobyle Program Definition --> <define name="Program"> <element name="program"> <interleave> <element name="head"> <interleave> <!-- the name of the program& it must be the same as the xml filename ex : blast2 (blast2.xml) --> <ref name="Name"/> <optional> <element name="version"> <text/> </element> </optional> <element name="doc"> <interleave> <element name="title"> <text/> </element> <element name="description"> <choice> <zeroOrMore> <ref name="Text"/> </zeroOrMore> <ref name="anyXHTML"/> </choice> </element> <optional> <element name="authors"> <ref name="anyXHTML"/> </element> </optional> <zeroOrMore> <element name="reference"> <interleave> <optional> <attribute name="doi"> <data type="anyURI"/> </attribute> </optional> <ref name="anyXHTML"/> </interleave> </element> </zeroOrMore> <zeroOrMore> <element name="doclink"> <data type="anyURI"/> </element> </zeroOrMore> <optional> <ref name="Comment"/> </optional> </interleave> </element> <zeroOrMore> <element name="category"> <text/> </element> </zeroOrMore> <optional> <element name="biomobyCategory"> <text/> </element> </optional> <optional> <!-- this element stores the biomoby serviceType property value. --> <choice> <element name="command"> <interleave> <optional> <attribute name="path"/> </optional> <text/> </interleave> </element> <element name="biomobyInvocation"> <interleave> <!-- the biomobyInvocation part contains information that is needed in case the XML is used to invoke a biomoby Web Service --> <element name="authURI"> <data type="anyURI"/> </element> <element name="registry"> <interleave> <element name="endpoint"> <data type="anyURI"/> </element> <optional> <element name="namespace"> <data type="anyURI"/> </element> </optional> </interleave> </element> </interleave> </element> </choice> </optional> <zeroOrMore> <element name="env"> <interleave> <optional> <attribute name="name"/> </optional> <text/> </interleave> </element> </zeroOrMore> <optional> <ref name="Layout"/> </optional> </interleave> </element> <ref name="Parameters"/> </interleave> </element> </define> <define name="Name"> <element name="name"> <data type="ID"/> </element> </define> <define name="Comment"> <element name="comment"> <choice> <zeroOrMore> <ref name="Text"/> </zeroOrMore> <ref name="anyXHTML"/> </choice> </element> </define> <define name="Parameters"> <element name="parameters"> <zeroOrMore> <choice> <ref name="Parameter"/> <ref name="Paragraph"/> </choice> </zeroOrMore> </element> </define> <define name="Parameter"> <element name="parameter"> <interleave> <ref name="attlist.parameter"/> <ref name="Name"/> <interleave> <zeroOrMore> <ref name="Prompt"/> </zeroOrMore> <element name="type"> <interleave> <zeroOrMore> <element name="biotype"> <text/> </element> </zeroOrMore> <!-- 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 name="datatype"> <interleave> <!-- type of the data Sequence & Structure & Matrix ... --> <element name="class"> <text/> </element> <optional> <element name="superclass"> <text/> </element> </optional> </interleave> <!-- superclass& or class if class does not exist is a Mobyle parameter Class defined in Src/Mobyle/Core.py or in Local/CustomClasses/ --> </element> <optional> <element name="acceptedDataFormats"> <interleave> <optional> <attribute name="force"> <data type="boolean"/> </attribute> </optional> <oneOrMore> <ref name="DataFormat"/> </oneOrMore> </interleave> <!-- the format of the data if datatype == Sequence format could have this values : IG & GENBANK & NBRF & EMBL & GCG & DNASTRIDER & FASTA & RAW & PIR & XML & SWISSPROT & GDE & --> </element> </optional> <optional> <element name="card"> <text/> </element> </optional> <optional> <!-- the cardinality of the datatype &a number or a couple of value & int&int or int&n biotype=Protein datatype=( class = Sequence ) & format=Fasta & card=1 means the user must provide 1 and only one Protein Sequence in Fasta format to fill this input parameter biotype=Protein datatype=( class = Sequence ) & format=Fasta & card=1.n means the user must provide 1 or more Protein Sequence in Fasta format to fill this input parameter --> <element name="biomoby"> <interleave> <optional> <element name="datatype"> <text/> </element> </optional> <optional> <element name="namespace"> <text/> </element> </optional> </interleave> </element> </optional> </interleave> <!-- the name of the object in the bioMoby ontology. it's implied that it's a primary and if not specify the parameter is a secondary in biomoby --> </element> </interleave> <optional> <ref name="Precond"/> </optional> <optional> <element name="vdef"> <oneOrMore> <ref name="Value"/> </oneOrMore> </element> </optional> <!-- the default value or list of values (clustalw) for the parameter the vdef element is mandatory if the parameter has a vlist or a flist. --> <choice> <optional> <element name="vlist"> <oneOrMore> <element name="velem"> <ref name="ListElem"/> </element> </oneOrMore> </element> </optional> <optional> <!-- a list of the available values for this parameter? --> <element name="flist"> <zeroOrMore> <!-- flist permit to associate a code with a value which is associate to a label in interface you could associate different codes with different proglangs for one value --> <element name="felem"> <interleave> <ref name="ListElem"/> <oneOrMore> <ref name="Code"/> </oneOrMore> </interleave> </element> </zeroOrMore> </element> </optional> </choice> <optional> <element name="separator"> <text/> </element> </optional> <optional> <!-- the character used to split the elements of a vlist for the MultipleChoice? --> <ref name="Format"/> </optional> <zeroOrMore> <element name="ctrl"> <interleave> <ref name="Message"/> <oneOrMore> <ref name="Code"/> </oneOrMore> </interleave> </element> </zeroOrMore> <optional> <!-- associated a message to a code& the code permit to specify the valids values for a parameter* --> <element name="scale"> <interleave> <element name="min"> <choice> <ref name="Value"/> <oneOrMore> <ref name="Code"/> </oneOrMore> </choice> </element> <element name="max"> <choice> <ref name="Value"/> <oneOrMore> <ref name="Code"/> </oneOrMore> </choice> </element> <optional> <element name="inc"> <text/> </element> </optional> </interleave> </element> </optional> <optional> <ref name="Argpos"/> </optional> <optional> <ref name="Comment"/> </optional> <optional> <element name="paramfile"> <text/> </element> </optional> <optional> <element name="width"> <text/> </element> </optional> <optional> <element name="height"> <text/> </element> </optional> <optional> <!-- the name of the file when the parameters are specified in a file instead on command line --> <element name="filenames"> <oneOrMore> <ref name="Code"/> </oneOrMore> </element> </optional> <optional> <!-- this element is required if the attribute isout="1" it's indicate the name of a file where a result is stored each code must have ONLY ONE file unix mask --> <element name="interface"> <choice> <attribute name="field"> <choice> <value>select</value> <value>radio</value> </choice> </attribute> <ref name="anyXHTML"/> </choice> </element> </optional> <optional> <element name="example"> <text/> </element> </optional> </interleave> <!-- example data for a given parameter --> </element> </define> <define name="ListElem"> <interleave> <optional> <attribute name="undef"> <data type="boolean"/> </attribute> </optional> <ref name="Value"/> <ref name="Label"/> </interleave> </define> <!-- the undef attribute specifies if an element is an alias for a non specified value. this links a label to the undefined value in the selectbox of the web form. --> <define name="attlist.parameter" combine="interleave"> <interleave> <optional> <attribute name="ismaininput"> <data type="boolean"/> </attribute> </optional> <optional> <attribute name="ismandatory"> <data type="boolean"/> </attribute> </optional> <optional> <attribute name="iscommand"> <data type="boolean"/> </attribute> </optional> <optional> <attribute name="ishidden"> <data type="boolean"/> </attribute> </optional> <optional> <attribute name="issimple"> <data type="boolean"/> </attribute> </optional> <choice> <optional> <attribute name="isout"> <data type="boolean"/> </attribute> </optional> <optional> <attribute name="isstdout"> <data type="boolean"/> </attribute> </optional> </choice> </interleave> </define> <!-- ismaininput : if True& the parameter is a primary article of the corresponding biomoby service (as used in PlayMoby) ismandatory : if true& this parameter should be specified by the user iscommand : if true& this parameter specify the line of command to run the program used when the command line is more complicated. issimple : specify if this parameter will be displayed only in the simple web form. isout : if true& this parameter is a produce by this service isstdout : if true& this parameter is the standart output of the service. if true that implies isout=1 and only one parameter could be isstdout="1" per service --> <define name="DataFormat"> <element name="dataFormat"> <text/> </element> </define> <define name="Prompt"> <element name="prompt"> <interleave> <optional> <ref name="Lang"/> </optional> <text/> </interleave> </element> </define> <define name="Lang"> <attribute name="lang"> <data type="language"/> </attribute> </define> <!-- lang as in RFC-1766 (e.g.& en-US& fr& fr-FR& etc.) --> <define name="Format"> <element name="format"> <oneOrMore> <ref name="Code"/> </oneOrMore> </element> </define> <!-- a code which will be evaluated to form the command line --> <define name="Argpos"> <element name="argpos"> <text/> </element> </define> <!-- in parameter: specify the position of this parameter on the command line in paragraph: specifiy the position on the command line for all parameters of this paragraph by convention the argpos of command must be 0. if we want args before command we could get negative argpos. --> <define name="Label"> <element name="label"> <text/> </element> </define> <!-- the text associated to a value which will be display on the form --> <define name="Message"> <element name="message"> <oneOrMore> <ref name="Text"/> </oneOrMore> </element> </define> <!-- a message displayed when the control fail --> <define name="Precond"> <element name="precond"> <oneOrMore> <ref name="Code"/> </oneOrMore> </element> </define> <!-- in parameter : the parameter is linked to a condition ex : this parameter could be used only if an other parameter has been specified --> <define name="Value"> <element name="value"> <text/> </element> </define> <!----> <define name="Code"> <element name="code"> <interleave> <ref name="attlist.code"/> <text/> </interleave> </element> </define> <!-- a code snipet in a programming language --> <define name="attlist.code" combine="interleave"> <attribute name="proglang"/> </define> <!-- proglang: the language in wich the code is written eg: perl& python& acd& seqlab --> <define name="Text"> <element name="text"> <interleave> <ref name="attlist.text"/> <text/> </interleave> </element> </define> <define name="attlist.text" combine="interleave"> <interleave> <optional> <attribute name="proglang"/> </optional> <ref name="Lang"/> <optional> <attribute name="href"/> </optional> </interleave> </define> <!----> <define name="anyXHTML"> <choice> <element> <nsName ns="http://www.w3.org/1999/xhtml"/> <zeroOrMore> <choice> <attribute> <anyName/> </attribute> <text/> <ref name="anyXHTML"/> </choice> </zeroOrMore> </element> <text/> </choice> </define> <define name="xhtmlDiv"> <element name="xhtml:div"> <zeroOrMore> <choice> <attribute> <anyName/> </attribute> <text/> <ref name="anyXHTML"/> </choice> </zeroOrMore> </element> </define> <define name="Paragraph"> <element name="paragraph"> <interleave> <ref name="Name"/> <zeroOrMore> <ref name="Prompt"/> </zeroOrMore> <zeroOrMore> <ref name="Precond"/> </zeroOrMore> <optional> <ref name="Format"/> </optional> <optional> <ref name="Argpos"/> </optional> <optional> <ref name="Comment"/> </optional> <ref name="Parameters"/> <optional> <ref name="Layout"/> </optional> </interleave> </element> </define> <define name="Layout"> <element name="layout"> <oneOrMore> <choice> <ref name="Hbox"/> <ref name="Vbox"/> </choice> </oneOrMore> </element> </define> <define name="Hbox"> <element name="hbox"> <oneOrMore> <choice> <ref name="Box"/> <ref name="Layout"/> </choice> </oneOrMore> </element> </define> <define name="Vbox"> <element name="vbox"> <oneOrMore> <choice> <ref name="Box"/> <ref name="Layout"/> </choice> </oneOrMore> </element> </define> <define name="Box"> <element name="box"> <text/> </element> </define> <!-- Mobyle JobState Definition --> <define name="JobState"> <element name="jobState"> <interleave> <!-- this part describes the elements specific to the file that stores job information --> <element name="name"> <data type="anyURI"/> </element> <!-- name is the url of the program invoked to run the job --> <element name="host"> <data type="anyURI"/> </element> <!-- host is the host server of the job --> <element name="id"> <data type="anyURI"/> </element> <!-- id is the job identifier --> <element name="date"> <data type="token"/> </element> <!-- date on which the job has been submitted on the server --> <element name="status"> <interleave> <element name="value"> <choice> <value>building</value> <value>submitted</value> <value>pending</value> <value>running</value> <value>finished</value> <value>error</value> <value>killed</value> <value>hold</value> <value>finishing</value> </choice> </element> <optional> <element name="message"> <text/> </element> </optional> </interleave> </element> <optional> <ref name="Email"/> </optional> <optional> <element name="sessionKey"> <text/> </element> </optional> <optional> <element name="workflowId"> <text/> </element> </optional> <optional> <element name="data"> <interleave> <zeroOrMore> <ref name="Input"/> </zeroOrMore> <zeroOrMore> <ref name="Output"/> </zeroOrMore> </interleave> </element> </optional> <optional> <element name="paramFiles"> <zeroOrMore> <ref name="File"/> </zeroOrMore> </element> </optional> <optional> <element name="commandLine"> <text/> </element> </optional> </interleave> </element> </define> <define name="Email"> <element name="email"> <data type="token"> <param name="pattern">[a-z0-9\-\._]+@([a-z0-9\-]+\.)+([a-z]){2,4}</param> </data> </element> </define> <define name="Input"> <element name="input"> <interleave> <ref name="Parameter"/> <choice> <interleave> <ref name="File"/> <optional> <element name="fmtProgram"> <text/> </element> </optional> <optional> <element name="formattedFile"> <ref name="FileContent"/> </element> </optional> </interleave> <element name="value"> <text/> </element> </choice> </interleave> </element> </define> <define name="Output"> <element name="output"> <interleave> <ref name="Parameter"/> <zeroOrMore> <ref name="File"/> </zeroOrMore> </interleave> </element> </define> <define name="File"> <element name="file"> <ref name="FileContent"/> </element> </define> <define name="FileContent"> <interleave> <optional> <attribute name="size"> <data type="positiveInteger"/> </attribute> </optional> <optional> <attribute name="fmt"> <data type="string"/> </attribute> </optional> <attribute name="origName"> <data type="string"/> </attribute> <text/> </interleave> </define> <!-- Mobyle UserSpace Definition --> <define name="UserSpace"> <element name="userSpace"> <interleave> <element name="authenticated"> <data type="boolean"/> </element> <element name="activated"> <data type="boolean"/> </element> <element name="activatingKey"> <data type="string"/> </element> <ref name="Email"/> <element name="passwd"> <data type="string"/> </element> <optional> <element name="captchaSolution"> <data type="string"/> </element> </optional> <element name="dataList"> <zeroOrMore> <element name="data"> <interleave> <attribute name="id"> <data type="ID"/> </attribute> <attribute name="size"> <data type="positiveInteger"/> </attribute> <attribute name="count"> <data type="positiveInteger"/> </attribute> <element name="userName"> <data type="string"/> </element> <element name="type"> <interleave> <zeroOrMore> <!-- warning: the type format will soon be unified between program& job and userSpace documents. --> <element name="biotype"> <text/> </element> </zeroOrMore> <!-- 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 name="datatype"> <interleave> <!-- type of the data Sequence & Structure & Matrix ... --> <element name="class"> <text/> </element> <optional> <element name="superclass"> <text/> </element> </optional> </interleave> <!-- superclass& or class if class does not exist is a Mobyle parameter Class defined in Src/Mobyle/Core.py or in Local/CustomClasses/ --> </element> <zeroOrMore> <ref name="DataFormat"/> </zeroOrMore> </interleave> </element> <element name="headOfData"> <data type="string"/> </element> <element name="inputModes"> <element name="inputMode"> <choice> <value>db</value> <value>paste</value> <value>upload</value> <value>result</value> </choice> </element> </element> <element name="producedBy"> <attribute name="id"> <data type="IDREF"/> </attribute> </element> <element name="usedBy"> <attribute name="id"> <data type="IDREF"/> </attribute> </element> </interleave> </element> </zeroOrMore> </element> <element name="jobList"> <zeroOrMore> <element name="job"> <interleave> <attribute name="id"> <data type="anyURI"/> </attribute> <element name="userName"> <data type="string"/> </element> <element name="programName"> <data type="string"/> </element> <element name="date"> <data type="string"/> </element> <element name="status"> <data type="string"/> </element> <element name="dataUsed"> <attribute name="id"> <data type="string"/> </attribute> </element> <element name="dataProduced"> <attribute name="id"> <data type="string"/> </attribute> </element> </interleave> </element> </zeroOrMore> </element> </interleave> </element> </define> </grammar>
Do you think those three files are the one that communicates with the portal so the portal can execute those bioinformatics XML files?Code:<?xml version="1.0" encoding="UTF-8"?> <!-- This is a validating schematron file for the mobyle program --> <!-- definitions, heavily inspired by existing python-based --> <!-- validators from Bertrand Néron and Nicolas Joly --> <!-- --> <!-- Author: Hervé Ménager --> <!-- 'Biological Software and Databases' Group, Institut Pasteur, Paris. --> <!-- Distributed under LGPLv2 Licence. Please refer to the COPYING.LIB document.--> <schema xmlns="http://purl.oclc.org/dsdl/schematron" > <pattern name="Check program"> <rule context="program"> <let name="commandElementsCount" value="./head/command"/> <let name="iscommandParametersCount" value="count(.//parameter[@iscommand='1' and not(precond) and not(ancestor::paragraph/precond)])"/> <let name="stdoutParametersCount" value="count(.//parameter[@isstdout='1' and not(precond) and not(ancestor::paragraph/precond)])"/> <let name="stderrParametersCount" value="count(.//parameter[@isstderr='1' and not(precond) and not(ancestor::paragraph/precond)])"/> <assert test="not(count(.//parameter[@iscommand='1'])=1 and $commandElementsCount=1)"> A program cannot contain both a command element and an iscommand parameter </assert> <assert test="not($iscommandParametersCount=0 and $commandElementsCount=0)"> A program has to contain one command element or one iscommand parameter: (<value-of select="$iscommandParametersCount"/> iscommand parameters, <value-of select="$commandElementsCount"/> command elements) </assert> <assert test="$iscommandParametersCount <= 1"> Only one parameter can be iscommand if no precond specified (current number in document: <value-of select="$iscommandParametersCount"/>) </assert> <assert test="$stdoutParametersCount <= 1"> Only one parameter can link to standard output if no precond specified (current number in document: <value-of select="$stdoutParametersCount"/>) </assert> <assert test="$stderrParametersCount <= 1"> Only one parameter can link to standard error if no precond specified (current number in document: <value-of select="$stderrParametersCount"/>) </assert> </rule> <rule context="program/head/name"> <assert test="concat(text(),'.xml')=$fileNameParameter"> Inconsistency between file name (<value-of select="$fileNameParameter"/>) and name value (<value-of select="text()"/>). </assert> </rule> <rule context="parameter"> <let name="parameter" value="."/> <let name="parameterName" value="$parameter/name"/> <assert test="count($parameter//*[@undef='1']) < 2"> Invalid value list for parameter '<value-of select="$parameterName"/>': this parameter has multiple undefined values. </assert> </rule> <rule context="parameter/vlist/velem | parameter/flist/felem"> <let name="value" value="value/text()"/> <let name="label" value="label/text()"/> <let name="parameter" value="../.."/> <let name="parameterName" value="$parameter/name"/> <assert test="not(preceding-sibling::*/value[text()=$value])" > Invalid value list for parameter '<value-of select="$parameterName"/>': duplicate value '<value-of select="$value"/>'. </assert> <assert test="not(preceding-sibling::*/label[text()=$label])" > Invalid value list for parameter '<value-of select="$parameterName"/>': duplicate label '<value-of select="$label"/>'. </assert> </rule> <rule context="parameter[@isout='1']"> <let name="parameterName" value="name"/> <assert test="count(filenames) > 0"> Invalid parameter: <value-of select="$parameterName"/>: an isout parameter must include a filename </assert> </rule> <rule context="parameter[((not(@isout)) or (@isout='0')) and ((not(@isstdout)) or (@isstdout='0')) and ((not(@isstderr)) or (@isstderr='0'))]"> <let name="parameterName" value="name"/> <assert test="count(filenames) = 0"> Invalid parameter: <value-of select="$parameterName"/>: an input parameter cannot include a filename </assert> </rule> <rule context="parameter/type/datatype/class"> <let name="parameter" value="../../.."/> <let name="parameterName" value="$parameter/name"/> <let name="isOut" value="$parameter/@isout='1'"/> <let name="isStdout" value="$parameter/@isstdout='1'"/> <let name="isIn" value="not($isOut or $isStdout)"/> <let name="isHidden" value="$parameter/@ishidden='1'"/> <let name="class" value="text()"/> <let name="hasDataFormats" value="count(../../acceptedDataFormats/dataFormat) > 0"/> <assert test="not(starts-with($class,'Abstract'))"> Invalid parameter datatype class for parameter '<value-of select="$parameterName"/>': no parameter datatype class can be abstract. </assert> <!-- <assert test="not($class='Text' and not($isIn))"> Invalid parameter datatype class for parameter '<value-of select="$parameterName"/>': no output parameter datatype class can be set to "Text". </assert> --> <assert test="not($class='Text' and $isHidden)"> Invalid parameter datatype class for parameter '<value-of select="$parameterName"/>': no hidden parameter datatype class can be set to "Text". </assert> <assert test="($hasDataFormats and ($class='Sequence' or $class='Alignment')) or not($hasDataFormats) or not($isIn)"> Invalid parameter datatype class for parameter '<value-of select="$parameterName"/>': so far Mobyle does not handle well acceptedDataFormats with non-"Sequence"/"Alignment" types. </assert> <assert test="(not($hasDataFormats) and ($class!='Sequence' and $class!='Alignment')) or $hasDataFormats or not($isIn)"> Invalid parameter datatype class for parameter '<value-of select="$parameterName"/>': it is better to specify which formats are accepted with Sequence and Alignment data types. </assert> <assert test="$class='MultipleChoice' or count($parameter/vdef/value) < 2"> Invalid parameter datatype class or default value for parameter '<value-of select="$parameterName"/>': this parameter has multiple default values, yet it is not typed as a MultipleChoice. </assert> <assert test="not($class!='MultipleChoice' and $parameter/separator)"> Invalid parameter datatype class or separator for parameter '<value-of select="$parameterName"/>': this parameter has a value separator specified, yet it is typed as a MultipleChoice. </assert> <assert test="not(($class='Boolean' or $class='Integer' or $class='Float' or $class='String' or $class='Choice' or $class='MultipleChoice' or $class='FileName') and ($isOut or $isStdout))"> Invalid parameter datatype class for parameter '<value-of select="$parameterName"/>': no output parameter datatype class can be set to <value-of select="$class"/>. </assert> </rule> <rule context="parameter/vdef/value"> <let name="value" value="text()"/> <let name="parameter" value="../.."/> <let name="parameterName" value="$parameter/name"/> <let name="class" value="$parameter/type/datatype/class"/> <let name="list" value="$parameter/vlist | $parameter/flist"/> <let name="values" value="$list//value"/> <let name="label" value="$list//label"/> <assert test="count($list)=0 or count($values[text()=$value])"> Invalid default value for parameter '<value-of select="$parameterName"/>': default value <value-of select="$value"/> is not part of the possible values list. </assert> </rule> </pattern> </schema>
I really want to use these Program for our new developed portal.
- 07-02-2009 #4Linux Guru
- Join Date
- Apr 2009
- Location
- I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
- Posts
- 8,974
I'm sure that there is something, such as a php, jsp, or such that can deal with these in a coherent and consistent manner. You need to research this much more thoroughly. I'm not personally familiar with the schema. That it will do what you want is without a doubt, but as I said, there is a missing part that can properly interpret this data and either execute in memory the resultant program, or can turn it into a program/script on disc that can subsequently be executed and the results returned via the portal. How is the question, and to that I don't have the answer.
Sometimes, real fast is almost as good as real time.
Just remember, Semper Gumbi - always be flexible!


Reply With Quote
