about sitemap home home
Databases Data Formats Database Search Genome Browser RNA Secondary Structure Alignments Primer Design WebServices
Technology Simple Client Asynchronity
Demo XML schema Exercise WSDL
Bielefeld University Center of Biotechnoloy Institute of Bioinformatics BiBiServ
 
Technology - Demo 1
1  <?xml version="1.0" encoding="UTF-8"?>
2  <sequenceCollection xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
3			xmlns="de:unibi:techfak:bibiserv:sadr:seqcol"
4			xmlns:dna="de:unibi:techfak:bibiserv:sadr:dna" 
5			xmlns:rna="de:unibi:techfak:bibiserv:sadr:rna"
6			xsi:schemaLocation="de:unibi:techfak:bibiserv:sadr:seqcol 
                                              http://bibiserv.techfak.uni-bielefeld.de/sadr/webservices/
                                              examples/seqcollection.xsd
7			                    de:unibi:techfak:bibiserv:sadr:dna
                                              http://bibiserv.techfak.uni-bielefeld.de/sadr/webservices/
                                              examples/dnaSequence.xsd
8			                    de:unibi:techfak:bibiserv:sadr:rna
                                              http://bibiserv.techfak.uni-bielefeld.de/sadr/webservices/
                                              examples/rnaSequence.xsd">
9	<dna:fasta dna:seqID="DNA12345">
10		<dna:name>smalldemodnaseq</dna:name>
11		<dna:description>A small DNA Sequence</dna:description>
12		<dna:sequence>ACGT</dna:sequence>
13	</dna:fasta>
14	<rna:fasta rna:seqID="RNA54321">
15		<rna:name>smalldemornaseq</rna:name>
16		<rna:description>A small RNA Sequence</rna:description>
17		<rna:sequence>ACGU</rna:sequence>
18	</rna:fasta>
19  </sequenceCollection>
  
An example document containing elements from different namespaces and grammars.
  • line 3-5: three namespaces are defined. One for the whole document, one for a DNA sequence and one for a RNA sequence
  • line 6-8: a schema location (where to find the grammar) is assigned to every namespace
  • line 9-13: a DNA sequence (namespace name: dna) is defined
  • line 14-18: a RNA sequence (namespace name: rna) is defined
1  <?xml version="1.0" encoding="UTF-8"?>
2  <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" 
3  	xmlns="de:unibi:techfak:bibiserv:sadr:dna" 
4  	targetNamespace="de:unibi:techfak:bibiserv:sadr:dna">
5  	<!--                   -->
6  	<!-- ELEMENTS -->
7  	<!--                   -->
8  	<xs:element name="fasta" type="fastaType" nillable="true"/>
9  	<!--             -->
10 	<!-- TYPES -->
11 	<!--             -->
12 	<xs:complexType name="fastaType">
13 		<xs:sequence>
14 			<xs:element name="name" type="xs:string" minOccurs="0"/>
15 			<xs:element name="description" type="xs:string" minOccurs="0"/>
16 			<xs:element name="sequence">
17 				<xs:simpleType>
18 					<xs:restriction base="xs:string">
19 						<xs:whiteSpace value="replace"/>
20						<xs:pattern value="[ACGT]{0,}"/>
21					</xs:restriction>
22				</xs:simpleType>
23			</xs:element>
24		</xs:sequence>
25		<xs:attribute name="seqID" type="xs:string" use="required"/>
26	</xs:complexType>
27 </xs:schema>
  
Grammar of the DNA sequence.
  • line 2-4: A schema definition is opened, namespace is set and the target namespace is defined.
  • line 8: The only element is defined, which is of type dnaSequenceType
  • line 12-26: Definition of the Element.
  • line 20: Only the letters A,C,G,T are allowed within the DNA sequence
1   <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" 
2 	xmlns="de:unibi:techfak:bibiserv:sadr:rna" 
3 	targetNamespace="de:unibi:techfak:bibiserv:sadr:rna">
[...]
15			<xs:element name="sequence">
16				<xs:simpleType>
17					<xs:restriction base="xs:string">
18						<xs:whiteSpace value="replace"/>
19						<xs:pattern value="[ACGU]{0,}"/>
20					</xs:restriction>
21				</xs:simpleType>
22			</xs:element>
[...]
  
Difference between the RNA sequence and the DNA sequence definition.
  • line 1-3: Another namespace is defined
  • line 19: allowed letters for rna sequence are A,C,G,U (not T)