SlideShare uma empresa Scribd logo
1 de 43
Baixar para ler offline
<XML>
                     Pierre Lindenbaum
             http://plindenbaum.blogspot.com
         @yokofakun(http://twitter.com/yokofakun)
                INSERM-UMR1087 Nantes
                        January 2013
https://github.com/lindenb/courses/tree/master/about.xml
Extensible Markup Language
Machine Readeable
Human Readeable
DOM
... not always
artOfLineage></rdf:Description><rdf:Description
g/taxonomy/12292"><rdf:typerdf:resource="http:/
ankrdf:resource="http://purl.uniprot.org/core/S
ttp://www.w3.org/2001/XMLSchema#boolean">true</
><scientificName>Nicotianavelutinamosaicvirus</
commonName><hostrdf:resource="http://purl.unipr
ClassOfrdf:resource="http://purl.uniprot.org/ta
datatype="http://www.w3.org/2001/XMLSchema#bool
escription><rdf:Descriptionrdf:about="http://pu
df:typerdf:resource="http://purl.uniprot.org/co
p://purl.uniprot.org/core/Species"/><scientific
me><rdfs:subClassOfrdf:resource="http://purl.un
fLineagerdf:datatype="http://www.w3.org/2001/XM
eage></rdf:Description><rdf:Descriptionrdf:abou
Just a format
*.txt
PMID-   16381885
OWN -   NLM
STAT-   MEDLINE
DA -    20051229
DCOM-   20060228
LR -    20091118
IS -    1362-4962 (Electronic)
IS -    0305-1048 (Linking)
VI -    34
IP -    Database issue
DP -    2006 Jan 1
TI -    From genomics to chemical genomics: new developments in KEGG.
PG -    D354-7
AB -    The increasing amount of genomic and molecular information is the basis for
        understanding higher-order biological systems, such as the cell and the orga
        and their interactions with the environment, as well as for medical, industr
        and other practical applications. The KEGG resource (http://www.genome.jp/ke
        provides a reference knowledge base for linking genomes to biological system
        categorized as building blocks in the genomic space (KEGG GENES) and the che
        space (KEGG LIGAND), and wiring diagrams of interaction networks and reactio
        networks (KEGG PATHWAY). A fourth component, KEGG BRITE, has been formally a
        to the KEGG suite of databases. This reflects our attempt to computerize
        functional interpretations as part of the pathway reconstruction process bas
        the hierarchically structured knowledge about the genomic, chemical and netw
        spaces. In accordance with the new chemical genomics initiatives, the scope
*.xml
<?xml version="1.0"?>
<!DOCTYPE PubmedArticleSet PUBLIC "-//NLM//DTD PubMedArticle, 1st January 2008//EN
<PubmedArticleSet>
<PubmedArticle>
    <MedlineCitation Status='MEDLINE' Owner='NLM'>
        <PMID Version='1'>16381885</PMID>
        <DateCreated>
            <Year>2005</Year>
            <Month>12</Month>
            <Day>29</Day>
        </DateCreated>
        <DateCompleted>
            <Year>2006</Year>
            <Month>02</Month>
            <Day>28</Day>
        </DateCompleted>
        <DateRevised>
            <Year>2009</Year>
            <Month>11</Month>
            <Day>18</Day>
        </DateRevised>
        <Article PubModel='Print'>
            <Journal>
                <ISSN IssnType='Electronic'>1362-4962</ISSN>
                <JournalIssue CitedMedium='Internet'>
*.json
{ "header": { "type": "efetch.pubmed", "version":
"0.3" }, "result": [ { "medlinecitation": { "pmid"
: { "version": "1", "value": "17284678" }, "datecr
eated": { "year": "2007", "month": "03", "day": "0
2" }, "datecompleted": { "year": "2007", "month":
"04", "day": "05" }, "daterevised": { "year": "200
9", "month": "11", "day": "18" }, "article": { "jo
urnal": { "issn": { "issntype": "Print", "value":
"1088-9051" }, "journalissue": { "citedmedium": "P
rint", "volume": "17", "issue": "3", "pubdate": [
"2007", "Mar" ] }, "title": "Genome research", "is
oabbreviation": "Genome Res." }, "articletitle": "
Sequencing and analysis of chromosome 1 of Eimeria
 tenella reveals a unique segmental organization."
, "pagination": [ "311-9" ], "abstract": { "abstra
cttexts": [ { "value": "Eimeria tenella is an intr
acellular protozoan parasite that infects the inte
stinal tracts of domestic fowl and causes coccidio
sis, a serious and sometimes lethal enteritis. Eim
eria falls in the same phylum (Apicomplexa) as sev
eral human and animal parasites such as Cryptospor
idium, Toxoplasma, and the malaria parasite, Plasm
odium. Here we report the sequencing and analysis
of the first chromosome of E. tenella, a chromosom
e believed to carry loci associated with drug resi
XML namespace
<my-database>                       <my-database
  <record>                           xmlns="http://mydatabase.org"
    <title>Record1</title>           xmlns:h="http://www.w3.org/1999/xhtml">
    <html>                            <record>
      <head>                            <title>Record1</title>
       <title>hello</title>             <h:html>
      </head>                             <h:head>
      <body>                               <h:title>hello</title>
        <h1>Hello</h1>                    </h:head>
      </body>                             <h:body>
    </html>                                 <h:h1>Hello</h:h1>
  </record>                               </h:body>
</my-database>                          </h:html>
                                      </record>
                                    </my-database>
xmllint
xsltproc
Parsing
DOM
Element root = document.getDocumentElement();
for (Node item=root.getFirstChild();
        item!=null;
        item=item.getNextSibling()){
       if (item.getNodeType()==Node.ELEMENT_NODE)
          {
          System.out.println(
             ((Element)item).getAttribute("id"));
          }
}
StAx


public interface XMLStreamReader {
  public int next();
  public boolean hasNext() ;
  public String getText();
  public String getLocalName();
  public String getNamespaceURI();
  // ...other methods not shown
}
SAX


public interface ContentHandler
    {
    public void startDocument () ;
    public void endDocument();
    public void startElement(String name, Attri
    public void endElement (String name);
    public void characters (char ch[], int star
    }
XPath
<?xml version="1.0" encoding="UTF-8"?>               $ xmllint -xpath 
<genes>                                                '/genes/gene[1]/name[2]/text()' 
  <gene id="1">                                        genes1.xml
    <name>Gene1</name>
    <name>gene-1</name>                              gene-1
    <sequence>ATAATGCTAGCTAGCTATCGAATG</sequence>
  </gene>                                            $  xmllint -xpath 
  <gene id="2">                                       '/genes/gene[1]/name[2]' 
    <name>Gene2</name>                                genes1.xml
    <name>gene-2</name>
    <sequence>AATTGCGATTCATCGATGCTATA</sequence>     <name>gene-1</name>
  </gene>
</genes>                                             $ xmllint -xpath 
                                                       'count(/genes/gene)' 
                                                       genes1.xml
                                                     2

                                                     $ xmllint -xpath 
                                                       '/genes/gene[@id='2']/name[1]/text()' 
                                                       genes1.xml

                                                     Gene2
XInclude

<?xml version="1.0" encoding="UTF-8"?>
<genes xmlns:xi="http://www.w3.org/2001/XInclud
  <gene id="1">
    <name>Gene1</name>
    <name>gene-1</name>
    <sequence><xi:include
     href="sequence.txt"
     parse="text"
     /></sequence>
  </gene>
  <xi:include
   href="gene2.xml"
   parse="xml"/>
</genes>
XHTML
SVG
<svg
 xmlns="http://www.w3.org/2000/svg"
 width='300px' height='300px'>

<circle
 cx='120' cy='150' r='60' style='fill: gold;'
 />

<polyline
 points='120 30, 25 150, 290 150'
 stroke-width='4' stroke='brown'
 style='fill: none;' />

<polygon
 points='210 100, 210 200, 270 150'
 style='fill: lawngreen;' />

<text x='60' y='250'
  fill='blue'>Hello, World!</text>

</svg>
XSL-FO
<?xml version="1.0" encoding="ISO-8859-1"?>

<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">

<fo:layout-master-set>
  <fo:simple-page-master master-name="A4">
    <!-- Page template goes here -->
  </fo:simple-page-master>
</fo:layout-master-set>

<fo:page-sequence master-reference="A4">
  <!-- Page content goes here -->
</fo:page-sequence>

</fo:root>
RDF

<?xml version="1.0" encoding="UTF-8"?>
<rdf:RDF (...)>
<rdf:Description rdf:about="http://…/isbn/20203
    <f:titre xml:lang="fr">Le palais des mirroi
    <f:original rdf:resource="http://…/isbn/000
</rdf:Description>
</rdf:RDF>
RDF
SOAP

<?xml version="1.0" encoding="UTF-8"?>
    <SOAP-ENV:Envelope (...)>
    <SOAP-ENV:Body>
    <r:queryPathwaysForReferenceIdentifiers>
    <r:referenceIdentifiers>
    <soapenc:string>Q9Y266</soapenc:string>
    <soapenc:string>P17480</soapenc:string>
    <soapenc:string>P2048</soapenc:string>
    </r:referenceIdentifiers>
    </r:queryPathwaysForReferenceIdentifiers>
    </SOAP-ENV:Body>
    </SOAP-ENV:Envelope>
WSDL

(...)
  <wsdl:message name="getEvsData">
    <wsdl:part element="tns:getEvsData" name="p
    </wsdl:part>
  </wsdl:message>
  <wsdl:message name="getEvsDataResponse">
    <wsdl:part element="tns:getEvsDataResponse"
    </wsdl:part>
  </wsdl:message>
  <wsdl:portType name="DataQuery">
    <wsdl:operation name="getEvsData">
      <wsdl:input message="tns:getEvsData" name
    </wsdl:input>
      <wsdl:output message="tns:getEvsDataRespo
WSDL

$ wsimport 
 "http://evs.gs.washington.edu/wsEVS/EVSDataQue

parsing WSDL...
Generating code...
Compiling code...
WSDL
$ more ./edu/washington/gs/evs/webservice/Locus.java

package edu.washington.gs.evs.webservice;
(...)
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "locus", propOrder = {
    "geneName",
    "chromosome",
    "strand",
    "mrnaAccession",
    "geneId",
    "txStart",
    "txEnd",
    "keggPathwayIds"
})
public class Locus {

   protected String geneName;
   protected String chromosome;
   protected String strand;
   protected String mrnaAccession;
   protected int geneId;
   protected int txStart;
   protected int txEnd;
   @XmlElement(nillable = true)
   (...)
Well formed..<a><b>c</a></b>
Validated (DTD)
$ cat genes1.dtd


<!ELEMENT   genes (gene+)>
<!ELEMENT   gene ((name+),sequence)>
<!ELEMENT   name (#PCDATA)>
<!ELEMENT   sequence (#PCDATA)>
<!ATTLIST   gene id CDATA #REQUIRED>



$   xmllint --dtdvalid genes1.dtd genes1.xml
DTD/JAXB : no need to create a parser

$ xjc genes1.xsd

$ xjc -dtd genes1.dtd
parsing a schema...
compiling a schema...
generated/Gene.java
generated/Genes.java
generated/Name.java
generated/ObjectFactory.java
Validated (XSD)
<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema
 xmlns:xsd="http://www.w3.org/2001/XMLSchema"
 >

   <xsd:complexType name="Genes">
     <xsd:sequence>
       <xsd:element name="gene"
            type="Gene"
            maxOccurs="unbounded"
            />
     </xsd:sequence>
   </xsd:complexType>

  <xsd:complexType name="Gene">
   <xsd:sequence>
     <xsd:element name="name" maxOccurs="unbounded" type="xsd:string"/>
     <xsd:element name="sequence" type="xsd:string"/>
   </xsd:sequence>
   <xsd:attribute name="id" use="required" type="xsd:int"/>
 </xsd:complexType>

 <xsd:element type="Genes" name="genes"/>

 </xsd:schema>
Validated (XSD)

$ xmllint --noout 
 --schema genes1.xsd 
 genes1.xml

genes1.xml validates
XSD/JAXB : no need to create a parser

$ xjc genes1.xsd

parsing a schema...
compiling a schema...
generated/Gene.java
generated/Genes.java
generated/ObjectFactory.java
XSLT
XSLT (text)
<?xml version='1.0' encoding="ISO-8859-1"?>
<xsl:stylesheet                                $ xsltproc   genes2txt.xsl
xmlns:xsl='http://www.w3.org/1999/XSL/Transform'
version='1.0'
>
                                               >id:1|Gene1
<xsl:output method='text'/>
                                               ATAATGCTAGCTAGCTATCGAATG
<xsl:template match="/">
<xsl:apply-templates select="genes"/>
</xsl:template>
                                               >id:2|Gene2
<xsl:template match="genes">
                                               AATTGCGATTCATCGATGCTATA
<xsl:apply-templates select="gene"/>
</xsl:template>

<xsl:template match="gene">
<xsl:text>&gt;id:</xsl:text>
<xsl:value-of select="@id"/>
<xsl:text>|</xsl:text>
<xsl:value-of select="name[1]"/>
<xsl:text>
</xsl:text>
<xsl:value-of select="sequence"/>
<xsl:text>
</xsl:text>
</xsl:template>

</xsl:stylesheet>
XSLT (html)
<?xml version='1.0' encoding="ISO-8859-1"?>
<xsl:stylesheet                                    $ xsltproc 
xmlns:xsl='http://www.w3.org/1999/XSL/Transform'
version='1.0'
>
                                                    genes2html.xsl 
<xsl:output method='html'/>                          genes1.xml
<xsl:template match="/">
<html><body>
<xsl:apply-templates select="genes"/>
</body></html>
                                                   <html><body>
</xsl:template>
                                                   <h1>2 genes</h1>
<xsl:template match="genes">
<h1>                                               <h2>&gt;id:1|Gene1</h2>
  <xsl:value-of select="count(gene)"/> genes
</h1>
<xsl:apply-templates select="gene"/>
                                                   <pre>ATAATGCTAGCTAGCTATCG
</xsl:template>
                                                   <h2>&gt;id:2|Gene2</h2>
<xsl:template match="gene">
<h2>                                               <pre>AATTGCGATTCATCGATGCT
<xsl:text>&gt;id:</xsl:text>
<xsl:value-of select="@id"/>
<xsl:text>|</xsl:text>
                                                   </body></html>
<xsl:value-of select="name[1]"/>
</h2>
<pre>
<xsl:value-of select="sequence"/>
</pre>
</xsl:template>
XSLT Embedded
<?xml-stylesheet type="text/xsl" href="genes2html.xsl"?>
XSLT (xml)
<?xml version='1.0' encoding="ISO-8859-1"?>
<xsl:stylesheet
xmlns:xsl='http://www.w3.org/1999/XSL/Transform'
xmlns="http://www.w3.org/2000/svg"
xmlns:math="http://exslt.org/math"
version="1.0"
>

<xsl:output method='xml'/>

<xsl:template match="/">
<svg width="500" height="500" version='1.0'>
<xsl:apply-templates select="genes"/>
</svg>
</xsl:template>

<xsl:template match="genes">
<xsl:apply-templates select="gene[1]"/>
</xsl:template>

<xsl:template match="gene">
<text x="250" y="250">
 <xsl:value-of select="name[1]"/>
</text>
<xsl:call-template name="drawseq">
 <xsl:with-param name="i" select="number(1.0)"/>
 <xsl:with-param name="s" select="sequence"/>
</xsl:call-template>
</xsl:template>

<xsl:template name="drawseq">
 <xsl:param name="i"/>
 <xsl:param name="s" />
 <xsl:variable name="L" select="string-length($s)"/>
<text>
 <xsl:variable name="angle" select="$i * ( (2.0*3.14159) div $L )"/>
 <xsl:attribute name="x"><xsl:value-of select="250+200*math:cos( $angle )"/></xsl:attribute>
 <xsl:attribute name="y"><xsl:value-of select="250+200*math:sin( $angle )"/></xsl:attribute>
 <xsl:value-of select="substring($s,$i,1)"/>
</text>

<xsl:if test="$i+1 &lt;= $L">
<xsl:call-template name="drawseq">
 <xsl:with-param name="i" select="1 + $i"/>
 <xsl:with-param name="s" select="$s"/>
</xsl:call-template>
</xsl:if>

</xsl:template>


</xsl:stylesheet>
END
Photos from wikipedia and W3C.

Mais conteúdo relacionado

Mais procurados

R版Getopt::Longを作ってみた
R版Getopt::Longを作ってみたR版Getopt::Longを作ってみた
R版Getopt::Longを作ってみたTakeshi Arabiki
 
I, For One, Welcome Our New Perl6 Overlords
I, For One, Welcome Our New Perl6 OverlordsI, For One, Welcome Our New Perl6 Overlords
I, For One, Welcome Our New Perl6 Overlordsheumann
 
Perl 6 for Concurrency and Parallel Computing
Perl 6 for Concurrency and Parallel ComputingPerl 6 for Concurrency and Parallel Computing
Perl 6 for Concurrency and Parallel ComputingAndrew Shitov
 
Mengembalikan data yang terhapus atau rusak pada hardisk menggunakan ubuntu
Mengembalikan data yang terhapus atau rusak pada hardisk menggunakan ubuntuMengembalikan data yang terhapus atau rusak pada hardisk menggunakan ubuntu
Mengembalikan data yang terhapus atau rusak pada hardisk menggunakan ubuntuAlferizhy Chalter
 
GedcomX SDK - Getting Started
GedcomX SDK - Getting StartedGedcomX SDK - Getting Started
GedcomX SDK - Getting StartedDave Nash
 
Joy of Six - Discover the Joy of Perl 6
Joy of Six - Discover the Joy of Perl 6Joy of Six - Discover the Joy of Perl 6
Joy of Six - Discover the Joy of Perl 6trexy
 
Nigel hamilton-megameet-2013
Nigel hamilton-megameet-2013Nigel hamilton-megameet-2013
Nigel hamilton-megameet-2013trexy
 
いろいろ
いろいろいろいろ
いろいろtekezo
 
Coming Out Of Your Shell - A Comparison of *Nix Shells
Coming Out Of Your Shell - A Comparison of *Nix ShellsComing Out Of Your Shell - A Comparison of *Nix Shells
Coming Out Of Your Shell - A Comparison of *Nix ShellsKel Cecil
 
Integration with Camel
Integration with CamelIntegration with Camel
Integration with CamelJosué Neis
 
Getting groovy
Getting groovyGetting groovy
Getting groovyNick Dixon
 
Service intergration
Service intergration Service intergration
Service intergration 재민 장
 
Legacy applications - 4Developes konferencja, Piotr Pasich
Legacy applications  - 4Developes konferencja, Piotr PasichLegacy applications  - 4Developes konferencja, Piotr Pasich
Legacy applications - 4Developes konferencja, Piotr PasichPiotr Pasich
 
多治見IT勉強会 Groovy Grails
多治見IT勉強会 Groovy Grails多治見IT勉強会 Groovy Grails
多治見IT勉強会 Groovy GrailsTsuyoshi Yamamoto
 
Manifests of Future Past
Manifests of Future PastManifests of Future Past
Manifests of Future PastPuppet
 

Mais procurados (20)

R版Getopt::Longを作ってみた
R版Getopt::Longを作ってみたR版Getopt::Longを作ってみた
R版Getopt::Longを作ってみた
 
I, For One, Welcome Our New Perl6 Overlords
I, For One, Welcome Our New Perl6 OverlordsI, For One, Welcome Our New Perl6 Overlords
I, For One, Welcome Our New Perl6 Overlords
 
Perl 6 for Concurrency and Parallel Computing
Perl 6 for Concurrency and Parallel ComputingPerl 6 for Concurrency and Parallel Computing
Perl 6 for Concurrency and Parallel Computing
 
Mengembalikan data yang terhapus atau rusak pada hardisk menggunakan ubuntu
Mengembalikan data yang terhapus atau rusak pada hardisk menggunakan ubuntuMengembalikan data yang terhapus atau rusak pada hardisk menggunakan ubuntu
Mengembalikan data yang terhapus atau rusak pada hardisk menggunakan ubuntu
 
GedcomX SDK - Getting Started
GedcomX SDK - Getting StartedGedcomX SDK - Getting Started
GedcomX SDK - Getting Started
 
Joy of Six - Discover the Joy of Perl 6
Joy of Six - Discover the Joy of Perl 6Joy of Six - Discover the Joy of Perl 6
Joy of Six - Discover the Joy of Perl 6
 
Nigel hamilton-megameet-2013
Nigel hamilton-megameet-2013Nigel hamilton-megameet-2013
Nigel hamilton-megameet-2013
 
いろいろ
いろいろいろいろ
いろいろ
 
C99[2]
C99[2]C99[2]
C99[2]
 
Bioinformatica 10-11-2011-p6-bioperl
Bioinformatica 10-11-2011-p6-bioperlBioinformatica 10-11-2011-p6-bioperl
Bioinformatica 10-11-2011-p6-bioperl
 
Training on php by cyber security infotech (csi)
Training on  php by cyber security infotech (csi)Training on  php by cyber security infotech (csi)
Training on php by cyber security infotech (csi)
 
My First Ruby
My First RubyMy First Ruby
My First Ruby
 
Coming Out Of Your Shell - A Comparison of *Nix Shells
Coming Out Of Your Shell - A Comparison of *Nix ShellsComing Out Of Your Shell - A Comparison of *Nix Shells
Coming Out Of Your Shell - A Comparison of *Nix Shells
 
Integration with Camel
Integration with CamelIntegration with Camel
Integration with Camel
 
Getting groovy
Getting groovyGetting groovy
Getting groovy
 
Service intergration
Service intergration Service intergration
Service intergration
 
Legacy applications - 4Developes konferencja, Piotr Pasich
Legacy applications  - 4Developes konferencja, Piotr PasichLegacy applications  - 4Developes konferencja, Piotr Pasich
Legacy applications - 4Developes konferencja, Piotr Pasich
 
多治見IT勉強会 Groovy Grails
多治見IT勉強会 Groovy Grails多治見IT勉強会 Groovy Grails
多治見IT勉強会 Groovy Grails
 
Manifests of Future Past
Manifests of Future PastManifests of Future Past
Manifests of Future Past
 
git internals
git internalsgit internals
git internals
 

Semelhante a XML for bioinformatics

bioinfolec_5th_20070713
bioinfolec_5th_20070713bioinfolec_5th_20070713
bioinfolec_5th_20070713sesejun
 
bioinfolec_20070706 4th
bioinfolec_20070706 4thbioinfolec_20070706 4th
bioinfolec_20070706 4thsesejun
 
PostgreSQL's Secret NoSQL Superpowers
PostgreSQL's Secret NoSQL SuperpowersPostgreSQL's Secret NoSQL Superpowers
PostgreSQL's Secret NoSQL SuperpowersAmanda Gilmore
 
Solr Anti-Patterns: Presented by Rafał Kuć, Sematext
Solr Anti-Patterns: Presented by Rafał Kuć, SematextSolr Anti-Patterns: Presented by Rafał Kuć, Sematext
Solr Anti-Patterns: Presented by Rafał Kuć, SematextLucidworks
 
SXML: S-expression eXtensible Markup Language
SXML: S-expression eXtensible Markup LanguageSXML: S-expression eXtensible Markup Language
SXML: S-expression eXtensible Markup Languageelliando dias
 
XML Support: Specifications and Development
XML Support: Specifications and DevelopmentXML Support: Specifications and Development
XML Support: Specifications and DevelopmentPeter Eisentraut
 
20070407 Rit2007 Xmltype Samokhvalov
20070407 Rit2007 Xmltype Samokhvalov20070407 Rit2007 Xmltype Samokhvalov
20070407 Rit2007 Xmltype SamokhvalovNikolay Samokhvalov
 
Ex[1].3 php db connectivity
Ex[1].3 php db connectivityEx[1].3 php db connectivity
Ex[1].3 php db connectivityMouli Chandira
 
Solr vs. Elasticsearch, Case by Case: Presented by Alexandre Rafalovitch, UN
Solr vs. Elasticsearch,  Case by Case: Presented by Alexandre Rafalovitch, UNSolr vs. Elasticsearch,  Case by Case: Presented by Alexandre Rafalovitch, UN
Solr vs. Elasticsearch, Case by Case: Presented by Alexandre Rafalovitch, UNLucidworks
 
お題でGroovyプログラミング: Part A
お題でGroovyプログラミング: Part Aお題でGroovyプログラミング: Part A
お題でGroovyプログラミング: Part AKazuchika Sekiya
 
XML - State of the Art
XML - State of the ArtXML - State of the Art
XML - State of the ArtJakub Malý
 
eXtensible Markup Language (XML)
eXtensible Markup Language (XML)eXtensible Markup Language (XML)
eXtensible Markup Language (XML)Serhii Kartashov
 
[제1회 루씬 한글분석기 기술세미나] solr로 나만의 검색엔진을 만들어보자
[제1회 루씬 한글분석기 기술세미나] solr로 나만의 검색엔진을 만들어보자[제1회 루씬 한글분석기 기술세미나] solr로 나만의 검색엔진을 만들어보자
[제1회 루씬 한글분석기 기술세미나] solr로 나만의 검색엔진을 만들어보자Donghyeok Kang
 
Solr vs. Elasticsearch - Case by Case
Solr vs. Elasticsearch - Case by CaseSolr vs. Elasticsearch - Case by Case
Solr vs. Elasticsearch - Case by CaseAlexandre Rafalovitch
 
Sample data and other ur ls
Sample data and other ur lsSample data and other ur ls
Sample data and other ur lsMark Wilkinson
 

Semelhante a XML for bioinformatics (20)

bioinfolec_5th_20070713
bioinfolec_5th_20070713bioinfolec_5th_20070713
bioinfolec_5th_20070713
 
bioinfolec_20070706 4th
bioinfolec_20070706 4thbioinfolec_20070706 4th
bioinfolec_20070706 4th
 
Broadleaf Presents Thymeleaf
Broadleaf Presents ThymeleafBroadleaf Presents Thymeleaf
Broadleaf Presents Thymeleaf
 
PostgreSQL's Secret NoSQL Superpowers
PostgreSQL's Secret NoSQL SuperpowersPostgreSQL's Secret NoSQL Superpowers
PostgreSQL's Secret NoSQL Superpowers
 
Solr Anti-Patterns: Presented by Rafał Kuć, Sematext
Solr Anti-Patterns: Presented by Rafał Kuć, SematextSolr Anti-Patterns: Presented by Rafał Kuć, Sematext
Solr Anti-Patterns: Presented by Rafał Kuć, Sematext
 
SXML: S-expression eXtensible Markup Language
SXML: S-expression eXtensible Markup LanguageSXML: S-expression eXtensible Markup Language
SXML: S-expression eXtensible Markup Language
 
XML Support: Specifications and Development
XML Support: Specifications and DevelopmentXML Support: Specifications and Development
XML Support: Specifications and Development
 
XML Schemas
XML SchemasXML Schemas
XML Schemas
 
DB2 Native XML
DB2 Native XMLDB2 Native XML
DB2 Native XML
 
20070407 Rit2007 Xmltype Samokhvalov
20070407 Rit2007 Xmltype Samokhvalov20070407 Rit2007 Xmltype Samokhvalov
20070407 Rit2007 Xmltype Samokhvalov
 
Xml & Java
Xml & JavaXml & Java
Xml & Java
 
Ex[1].3 php db connectivity
Ex[1].3 php db connectivityEx[1].3 php db connectivity
Ex[1].3 php db connectivity
 
Xml 2
Xml  2 Xml  2
Xml 2
 
Solr vs. Elasticsearch, Case by Case: Presented by Alexandre Rafalovitch, UN
Solr vs. Elasticsearch,  Case by Case: Presented by Alexandre Rafalovitch, UNSolr vs. Elasticsearch,  Case by Case: Presented by Alexandre Rafalovitch, UN
Solr vs. Elasticsearch, Case by Case: Presented by Alexandre Rafalovitch, UN
 
お題でGroovyプログラミング: Part A
お題でGroovyプログラミング: Part Aお題でGroovyプログラミング: Part A
お題でGroovyプログラミング: Part A
 
XML - State of the Art
XML - State of the ArtXML - State of the Art
XML - State of the Art
 
eXtensible Markup Language (XML)
eXtensible Markup Language (XML)eXtensible Markup Language (XML)
eXtensible Markup Language (XML)
 
[제1회 루씬 한글분석기 기술세미나] solr로 나만의 검색엔진을 만들어보자
[제1회 루씬 한글분석기 기술세미나] solr로 나만의 검색엔진을 만들어보자[제1회 루씬 한글분석기 기술세미나] solr로 나만의 검색엔진을 만들어보자
[제1회 루씬 한글분석기 기술세미나] solr로 나만의 검색엔진을 만들어보자
 
Solr vs. Elasticsearch - Case by Case
Solr vs. Elasticsearch - Case by CaseSolr vs. Elasticsearch - Case by Case
Solr vs. Elasticsearch - Case by Case
 
Sample data and other ur ls
Sample data and other ur lsSample data and other ur ls
Sample data and other ur ls
 

Mais de Pierre Lindenbaum

Next Generation Sequencing file Formats ( 2017 )
Next Generation Sequencing file Formats ( 2017 )Next Generation Sequencing file Formats ( 2017 )
Next Generation Sequencing file Formats ( 2017 )Pierre Lindenbaum
 
Mum, I 3D printed a gel comb !
Mum, I 3D printed a gel comb !Mum, I 3D printed a gel comb !
Mum, I 3D printed a gel comb !Pierre Lindenbaum
 
"Mon make à moi", (tout sauf Galaxy)
"Mon make à moi", (tout sauf Galaxy)"Mon make à moi", (tout sauf Galaxy)
"Mon make à moi", (tout sauf Galaxy)Pierre Lindenbaum
 
File formats for Next Generation Sequencing
File formats for Next Generation SequencingFile formats for Next Generation Sequencing
File formats for Next Generation SequencingPierre Lindenbaum
 
Building a Simple LIMS with the Eclipse Modeling Framework (EMF) ,my notebook
Building a Simple LIMS with the Eclipse Modeling Framework (EMF) ,my notebookBuilding a Simple LIMS with the Eclipse Modeling Framework (EMF) ,my notebook
Building a Simple LIMS with the Eclipse Modeling Framework (EMF) ,my notebookPierre Lindenbaum
 
Introduction to mongodb for bioinformatics
Introduction to mongodb for bioinformaticsIntroduction to mongodb for bioinformatics
Introduction to mongodb for bioinformaticsPierre Lindenbaum
 
Tweeting for the BioStar Paper
Tweeting for the BioStar PaperTweeting for the BioStar Paper
Tweeting for the BioStar PaperPierre Lindenbaum
 
Analyzing Exome Data with KNIME
Analyzing Exome Data with KNIMEAnalyzing Exome Data with KNIME
Analyzing Exome Data with KNIMEPierre Lindenbaum
 
20110114 Next Generation Sequencing Course
20110114 Next Generation Sequencing Course20110114 Next Generation Sequencing Course
20110114 Next Generation Sequencing CoursePierre Lindenbaum
 

Mais de Pierre Lindenbaum (20)

Next Generation Sequencing file Formats ( 2017 )
Next Generation Sequencing file Formats ( 2017 )Next Generation Sequencing file Formats ( 2017 )
Next Generation Sequencing file Formats ( 2017 )
 
Introduction to Linux
Introduction to LinuxIntroduction to Linux
Introduction to Linux
 
Mum, I 3D printed a gel comb !
Mum, I 3D printed a gel comb !Mum, I 3D printed a gel comb !
Mum, I 3D printed a gel comb !
 
"Mon make à moi", (tout sauf Galaxy)
"Mon make à moi", (tout sauf Galaxy)"Mon make à moi", (tout sauf Galaxy)
"Mon make à moi", (tout sauf Galaxy)
 
Advanced NCBI
Advanced NCBI Advanced NCBI
Advanced NCBI
 
File formats for Next Generation Sequencing
File formats for Next Generation SequencingFile formats for Next Generation Sequencing
File formats for Next Generation Sequencing
 
Building a Simple LIMS with the Eclipse Modeling Framework (EMF) ,my notebook
Building a Simple LIMS with the Eclipse Modeling Framework (EMF) ,my notebookBuilding a Simple LIMS with the Eclipse Modeling Framework (EMF) ,my notebook
Building a Simple LIMS with the Eclipse Modeling Framework (EMF) ,my notebook
 
20120423.NGS.Rennes
20120423.NGS.Rennes20120423.NGS.Rennes
20120423.NGS.Rennes
 
Sketching 20120412
Sketching 20120412Sketching 20120412
Sketching 20120412
 
Introduction to mongodb for bioinformatics
Introduction to mongodb for bioinformaticsIntroduction to mongodb for bioinformatics
Introduction to mongodb for bioinformatics
 
Biostar17037
Biostar17037Biostar17037
Biostar17037
 
Tweeting for the BioStar Paper
Tweeting for the BioStar PaperTweeting for the BioStar Paper
Tweeting for the BioStar Paper
 
Variation Toolkit
Variation ToolkitVariation Toolkit
Variation Toolkit
 
Bioinformatician 2.0
Bioinformatician 2.0Bioinformatician 2.0
Bioinformatician 2.0
 
Analyzing Exome Data with KNIME
Analyzing Exome Data with KNIMEAnalyzing Exome Data with KNIME
Analyzing Exome Data with KNIME
 
NOTCH2 backstage
NOTCH2 backstageNOTCH2 backstage
NOTCH2 backstage
 
Bioinfo tweets
Bioinfo tweetsBioinfo tweets
Bioinfo tweets
 
Post doctoriales 2011
Post doctoriales 2011Post doctoriales 2011
Post doctoriales 2011
 
20110114 Next Generation Sequencing Course
20110114 Next Generation Sequencing Course20110114 Next Generation Sequencing Course
20110114 Next Generation Sequencing Course
 
MyWordle.java
MyWordle.javaMyWordle.java
MyWordle.java
 

Último

Active Learning Strategies (in short ALS).pdf
Active Learning Strategies (in short ALS).pdfActive Learning Strategies (in short ALS).pdf
Active Learning Strategies (in short ALS).pdfPatidar M
 
31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...
31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...
31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...Nguyen Thanh Tu Collection
 
Unraveling Hypertext_ Analyzing Postmodern Elements in Literature.pptx
Unraveling Hypertext_ Analyzing  Postmodern Elements in  Literature.pptxUnraveling Hypertext_ Analyzing  Postmodern Elements in  Literature.pptx
Unraveling Hypertext_ Analyzing Postmodern Elements in Literature.pptxDhatriParmar
 
4.16.24 Poverty and Precarity--Desmond.pptx
4.16.24 Poverty and Precarity--Desmond.pptx4.16.24 Poverty and Precarity--Desmond.pptx
4.16.24 Poverty and Precarity--Desmond.pptxmary850239
 
MS4 level being good citizen -imperative- (1) (1).pdf
MS4 level   being good citizen -imperative- (1) (1).pdfMS4 level   being good citizen -imperative- (1) (1).pdf
MS4 level being good citizen -imperative- (1) (1).pdfMr Bounab Samir
 
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxINTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxHumphrey A Beña
 
Mythology Quiz-4th April 2024, Quiz Club NITW
Mythology Quiz-4th April 2024, Quiz Club NITWMythology Quiz-4th April 2024, Quiz Club NITW
Mythology Quiz-4th April 2024, Quiz Club NITWQuiz Club NITW
 
Scientific Writing :Research Discourse
Scientific  Writing :Research  DiscourseScientific  Writing :Research  Discourse
Scientific Writing :Research DiscourseAnita GoswamiGiri
 
week 1 cookery 8 fourth - quarter .pptx
week 1 cookery 8  fourth  -  quarter .pptxweek 1 cookery 8  fourth  -  quarter .pptx
week 1 cookery 8 fourth - quarter .pptxJonalynLegaspi2
 
How to Fix XML SyntaxError in Odoo the 17
How to Fix XML SyntaxError in Odoo the 17How to Fix XML SyntaxError in Odoo the 17
How to Fix XML SyntaxError in Odoo the 17Celine George
 
Measures of Position DECILES for ungrouped data
Measures of Position DECILES for ungrouped dataMeasures of Position DECILES for ungrouped data
Measures of Position DECILES for ungrouped dataBabyAnnMotar
 
Multi Domain Alias In the Odoo 17 ERP Module
Multi Domain Alias In the Odoo 17 ERP ModuleMulti Domain Alias In the Odoo 17 ERP Module
Multi Domain Alias In the Odoo 17 ERP ModuleCeline George
 
Expanded definition: technical and operational
Expanded definition: technical and operationalExpanded definition: technical and operational
Expanded definition: technical and operationalssuser3e220a
 
Decoding the Tweet _ Practical Criticism in the Age of Hashtag.pptx
Decoding the Tweet _ Practical Criticism in the Age of Hashtag.pptxDecoding the Tweet _ Practical Criticism in the Age of Hashtag.pptx
Decoding the Tweet _ Practical Criticism in the Age of Hashtag.pptxDhatriParmar
 
Narcotic and Non Narcotic Analgesic..pdf
Narcotic and Non Narcotic Analgesic..pdfNarcotic and Non Narcotic Analgesic..pdf
Narcotic and Non Narcotic Analgesic..pdfPrerana Jadhav
 
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfGrade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfJemuel Francisco
 
Mental Health Awareness - a toolkit for supporting young minds
Mental Health Awareness - a toolkit for supporting young mindsMental Health Awareness - a toolkit for supporting young minds
Mental Health Awareness - a toolkit for supporting young mindsPooky Knightsmith
 
Transaction Management in Database Management System
Transaction Management in Database Management SystemTransaction Management in Database Management System
Transaction Management in Database Management SystemChristalin Nelson
 

Último (20)

Active Learning Strategies (in short ALS).pdf
Active Learning Strategies (in short ALS).pdfActive Learning Strategies (in short ALS).pdf
Active Learning Strategies (in short ALS).pdf
 
31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...
31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...
31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...
 
Unraveling Hypertext_ Analyzing Postmodern Elements in Literature.pptx
Unraveling Hypertext_ Analyzing  Postmodern Elements in  Literature.pptxUnraveling Hypertext_ Analyzing  Postmodern Elements in  Literature.pptx
Unraveling Hypertext_ Analyzing Postmodern Elements in Literature.pptx
 
4.16.24 Poverty and Precarity--Desmond.pptx
4.16.24 Poverty and Precarity--Desmond.pptx4.16.24 Poverty and Precarity--Desmond.pptx
4.16.24 Poverty and Precarity--Desmond.pptx
 
Faculty Profile prashantha K EEE dept Sri Sairam college of Engineering
Faculty Profile prashantha K EEE dept Sri Sairam college of EngineeringFaculty Profile prashantha K EEE dept Sri Sairam college of Engineering
Faculty Profile prashantha K EEE dept Sri Sairam college of Engineering
 
MS4 level being good citizen -imperative- (1) (1).pdf
MS4 level   being good citizen -imperative- (1) (1).pdfMS4 level   being good citizen -imperative- (1) (1).pdf
MS4 level being good citizen -imperative- (1) (1).pdf
 
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxINTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
 
Mythology Quiz-4th April 2024, Quiz Club NITW
Mythology Quiz-4th April 2024, Quiz Club NITWMythology Quiz-4th April 2024, Quiz Club NITW
Mythology Quiz-4th April 2024, Quiz Club NITW
 
Mattingly "AI & Prompt Design: Large Language Models"
Mattingly "AI & Prompt Design: Large Language Models"Mattingly "AI & Prompt Design: Large Language Models"
Mattingly "AI & Prompt Design: Large Language Models"
 
Scientific Writing :Research Discourse
Scientific  Writing :Research  DiscourseScientific  Writing :Research  Discourse
Scientific Writing :Research Discourse
 
week 1 cookery 8 fourth - quarter .pptx
week 1 cookery 8  fourth  -  quarter .pptxweek 1 cookery 8  fourth  -  quarter .pptx
week 1 cookery 8 fourth - quarter .pptx
 
How to Fix XML SyntaxError in Odoo the 17
How to Fix XML SyntaxError in Odoo the 17How to Fix XML SyntaxError in Odoo the 17
How to Fix XML SyntaxError in Odoo the 17
 
Measures of Position DECILES for ungrouped data
Measures of Position DECILES for ungrouped dataMeasures of Position DECILES for ungrouped data
Measures of Position DECILES for ungrouped data
 
Multi Domain Alias In the Odoo 17 ERP Module
Multi Domain Alias In the Odoo 17 ERP ModuleMulti Domain Alias In the Odoo 17 ERP Module
Multi Domain Alias In the Odoo 17 ERP Module
 
Expanded definition: technical and operational
Expanded definition: technical and operationalExpanded definition: technical and operational
Expanded definition: technical and operational
 
Decoding the Tweet _ Practical Criticism in the Age of Hashtag.pptx
Decoding the Tweet _ Practical Criticism in the Age of Hashtag.pptxDecoding the Tweet _ Practical Criticism in the Age of Hashtag.pptx
Decoding the Tweet _ Practical Criticism in the Age of Hashtag.pptx
 
Narcotic and Non Narcotic Analgesic..pdf
Narcotic and Non Narcotic Analgesic..pdfNarcotic and Non Narcotic Analgesic..pdf
Narcotic and Non Narcotic Analgesic..pdf
 
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfGrade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
 
Mental Health Awareness - a toolkit for supporting young minds
Mental Health Awareness - a toolkit for supporting young mindsMental Health Awareness - a toolkit for supporting young minds
Mental Health Awareness - a toolkit for supporting young minds
 
Transaction Management in Database Management System
Transaction Management in Database Management SystemTransaction Management in Database Management System
Transaction Management in Database Management System
 

XML for bioinformatics

  • 1. <XML> Pierre Lindenbaum http://plindenbaum.blogspot.com @yokofakun(http://twitter.com/yokofakun) INSERM-UMR1087 Nantes January 2013 https://github.com/lindenb/courses/tree/master/about.xml
  • 5. DOM
  • 8. *.txt PMID- 16381885 OWN - NLM STAT- MEDLINE DA - 20051229 DCOM- 20060228 LR - 20091118 IS - 1362-4962 (Electronic) IS - 0305-1048 (Linking) VI - 34 IP - Database issue DP - 2006 Jan 1 TI - From genomics to chemical genomics: new developments in KEGG. PG - D354-7 AB - The increasing amount of genomic and molecular information is the basis for understanding higher-order biological systems, such as the cell and the orga and their interactions with the environment, as well as for medical, industr and other practical applications. The KEGG resource (http://www.genome.jp/ke provides a reference knowledge base for linking genomes to biological system categorized as building blocks in the genomic space (KEGG GENES) and the che space (KEGG LIGAND), and wiring diagrams of interaction networks and reactio networks (KEGG PATHWAY). A fourth component, KEGG BRITE, has been formally a to the KEGG suite of databases. This reflects our attempt to computerize functional interpretations as part of the pathway reconstruction process bas the hierarchically structured knowledge about the genomic, chemical and netw spaces. In accordance with the new chemical genomics initiatives, the scope
  • 9. *.xml <?xml version="1.0"?> <!DOCTYPE PubmedArticleSet PUBLIC "-//NLM//DTD PubMedArticle, 1st January 2008//EN <PubmedArticleSet> <PubmedArticle> <MedlineCitation Status='MEDLINE' Owner='NLM'> <PMID Version='1'>16381885</PMID> <DateCreated> <Year>2005</Year> <Month>12</Month> <Day>29</Day> </DateCreated> <DateCompleted> <Year>2006</Year> <Month>02</Month> <Day>28</Day> </DateCompleted> <DateRevised> <Year>2009</Year> <Month>11</Month> <Day>18</Day> </DateRevised> <Article PubModel='Print'> <Journal> <ISSN IssnType='Electronic'>1362-4962</ISSN> <JournalIssue CitedMedium='Internet'>
  • 10. *.json { "header": { "type": "efetch.pubmed", "version": "0.3" }, "result": [ { "medlinecitation": { "pmid" : { "version": "1", "value": "17284678" }, "datecr eated": { "year": "2007", "month": "03", "day": "0 2" }, "datecompleted": { "year": "2007", "month": "04", "day": "05" }, "daterevised": { "year": "200 9", "month": "11", "day": "18" }, "article": { "jo urnal": { "issn": { "issntype": "Print", "value": "1088-9051" }, "journalissue": { "citedmedium": "P rint", "volume": "17", "issue": "3", "pubdate": [ "2007", "Mar" ] }, "title": "Genome research", "is oabbreviation": "Genome Res." }, "articletitle": " Sequencing and analysis of chromosome 1 of Eimeria tenella reveals a unique segmental organization." , "pagination": [ "311-9" ], "abstract": { "abstra cttexts": [ { "value": "Eimeria tenella is an intr acellular protozoan parasite that infects the inte stinal tracts of domestic fowl and causes coccidio sis, a serious and sometimes lethal enteritis. Eim eria falls in the same phylum (Apicomplexa) as sev eral human and animal parasites such as Cryptospor idium, Toxoplasma, and the malaria parasite, Plasm odium. Here we report the sequencing and analysis of the first chromosome of E. tenella, a chromosom e believed to carry loci associated with drug resi
  • 11.
  • 12. XML namespace <my-database> <my-database <record> xmlns="http://mydatabase.org" <title>Record1</title> xmlns:h="http://www.w3.org/1999/xhtml"> <html> <record> <head> <title>Record1</title> <title>hello</title> <h:html> </head> <h:head> <body> <h:title>hello</title> <h1>Hello</h1> </h:head> </body> <h:body> </html> <h:h1>Hello</h:h1> </record> </h:body> </my-database> </h:html> </record> </my-database>
  • 16. DOM Element root = document.getDocumentElement(); for (Node item=root.getFirstChild(); item!=null; item=item.getNextSibling()){ if (item.getNodeType()==Node.ELEMENT_NODE) { System.out.println( ((Element)item).getAttribute("id")); } }
  • 17. StAx public interface XMLStreamReader { public int next(); public boolean hasNext() ; public String getText(); public String getLocalName(); public String getNamespaceURI(); // ...other methods not shown }
  • 18. SAX public interface ContentHandler { public void startDocument () ; public void endDocument(); public void startElement(String name, Attri public void endElement (String name); public void characters (char ch[], int star }
  • 19. XPath <?xml version="1.0" encoding="UTF-8"?> $ xmllint -xpath <genes> '/genes/gene[1]/name[2]/text()' <gene id="1"> genes1.xml <name>Gene1</name> <name>gene-1</name> gene-1 <sequence>ATAATGCTAGCTAGCTATCGAATG</sequence> </gene> $ xmllint -xpath <gene id="2"> '/genes/gene[1]/name[2]' <name>Gene2</name> genes1.xml <name>gene-2</name> <sequence>AATTGCGATTCATCGATGCTATA</sequence> <name>gene-1</name> </gene> </genes> $ xmllint -xpath 'count(/genes/gene)' genes1.xml 2 $ xmllint -xpath '/genes/gene[@id='2']/name[1]/text()' genes1.xml Gene2
  • 20. XInclude <?xml version="1.0" encoding="UTF-8"?> <genes xmlns:xi="http://www.w3.org/2001/XInclud <gene id="1"> <name>Gene1</name> <name>gene-1</name> <sequence><xi:include href="sequence.txt" parse="text" /></sequence> </gene> <xi:include href="gene2.xml" parse="xml"/> </genes>
  • 21. XHTML
  • 22. SVG <svg xmlns="http://www.w3.org/2000/svg" width='300px' height='300px'> <circle cx='120' cy='150' r='60' style='fill: gold;' /> <polyline points='120 30, 25 150, 290 150' stroke-width='4' stroke='brown' style='fill: none;' /> <polygon points='210 100, 210 200, 270 150' style='fill: lawngreen;' /> <text x='60' y='250' fill='blue'>Hello, World!</text> </svg>
  • 23. XSL-FO <?xml version="1.0" encoding="ISO-8859-1"?> <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"> <fo:layout-master-set> <fo:simple-page-master master-name="A4"> <!-- Page template goes here --> </fo:simple-page-master> </fo:layout-master-set> <fo:page-sequence master-reference="A4"> <!-- Page content goes here --> </fo:page-sequence> </fo:root>
  • 24. RDF <?xml version="1.0" encoding="UTF-8"?> <rdf:RDF (...)> <rdf:Description rdf:about="http://…/isbn/20203 <f:titre xml:lang="fr">Le palais des mirroi <f:original rdf:resource="http://…/isbn/000 </rdf:Description> </rdf:RDF>
  • 25. RDF
  • 26. SOAP <?xml version="1.0" encoding="UTF-8"?> <SOAP-ENV:Envelope (...)> <SOAP-ENV:Body> <r:queryPathwaysForReferenceIdentifiers> <r:referenceIdentifiers> <soapenc:string>Q9Y266</soapenc:string> <soapenc:string>P17480</soapenc:string> <soapenc:string>P2048</soapenc:string> </r:referenceIdentifiers> </r:queryPathwaysForReferenceIdentifiers> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
  • 27. WSDL (...) <wsdl:message name="getEvsData"> <wsdl:part element="tns:getEvsData" name="p </wsdl:part> </wsdl:message> <wsdl:message name="getEvsDataResponse"> <wsdl:part element="tns:getEvsDataResponse" </wsdl:part> </wsdl:message> <wsdl:portType name="DataQuery"> <wsdl:operation name="getEvsData"> <wsdl:input message="tns:getEvsData" name </wsdl:input> <wsdl:output message="tns:getEvsDataRespo
  • 28. WSDL $ wsimport "http://evs.gs.washington.edu/wsEVS/EVSDataQue parsing WSDL... Generating code... Compiling code...
  • 29. WSDL $ more ./edu/washington/gs/evs/webservice/Locus.java package edu.washington.gs.evs.webservice; (...) @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "locus", propOrder = { "geneName", "chromosome", "strand", "mrnaAccession", "geneId", "txStart", "txEnd", "keggPathwayIds" }) public class Locus { protected String geneName; protected String chromosome; protected String strand; protected String mrnaAccession; protected int geneId; protected int txStart; protected int txEnd; @XmlElement(nillable = true) (...)
  • 31. Validated (DTD) $ cat genes1.dtd <!ELEMENT genes (gene+)> <!ELEMENT gene ((name+),sequence)> <!ELEMENT name (#PCDATA)> <!ELEMENT sequence (#PCDATA)> <!ATTLIST gene id CDATA #REQUIRED> $ xmllint --dtdvalid genes1.dtd genes1.xml
  • 32. DTD/JAXB : no need to create a parser $ xjc genes1.xsd $ xjc -dtd genes1.dtd parsing a schema... compiling a schema... generated/Gene.java generated/Genes.java generated/Name.java generated/ObjectFactory.java
  • 33. Validated (XSD) <?xml version="1.0" encoding="UTF-8"?> <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" > <xsd:complexType name="Genes"> <xsd:sequence> <xsd:element name="gene" type="Gene" maxOccurs="unbounded" /> </xsd:sequence> </xsd:complexType> <xsd:complexType name="Gene"> <xsd:sequence> <xsd:element name="name" maxOccurs="unbounded" type="xsd:string"/> <xsd:element name="sequence" type="xsd:string"/> </xsd:sequence> <xsd:attribute name="id" use="required" type="xsd:int"/> </xsd:complexType> <xsd:element type="Genes" name="genes"/> </xsd:schema>
  • 34. Validated (XSD) $ xmllint --noout --schema genes1.xsd genes1.xml genes1.xml validates
  • 35. XSD/JAXB : no need to create a parser $ xjc genes1.xsd parsing a schema... compiling a schema... generated/Gene.java generated/Genes.java generated/ObjectFactory.java
  • 36. XSLT
  • 37. XSLT (text) <?xml version='1.0' encoding="ISO-8859-1"?> <xsl:stylesheet $ xsltproc genes2txt.xsl xmlns:xsl='http://www.w3.org/1999/XSL/Transform' version='1.0' > >id:1|Gene1 <xsl:output method='text'/> ATAATGCTAGCTAGCTATCGAATG <xsl:template match="/"> <xsl:apply-templates select="genes"/> </xsl:template> >id:2|Gene2 <xsl:template match="genes"> AATTGCGATTCATCGATGCTATA <xsl:apply-templates select="gene"/> </xsl:template> <xsl:template match="gene"> <xsl:text>&gt;id:</xsl:text> <xsl:value-of select="@id"/> <xsl:text>|</xsl:text> <xsl:value-of select="name[1]"/> <xsl:text> </xsl:text> <xsl:value-of select="sequence"/> <xsl:text> </xsl:text> </xsl:template> </xsl:stylesheet>
  • 38. XSLT (html) <?xml version='1.0' encoding="ISO-8859-1"?> <xsl:stylesheet $ xsltproc xmlns:xsl='http://www.w3.org/1999/XSL/Transform' version='1.0' > genes2html.xsl <xsl:output method='html'/> genes1.xml <xsl:template match="/"> <html><body> <xsl:apply-templates select="genes"/> </body></html> <html><body> </xsl:template> <h1>2 genes</h1> <xsl:template match="genes"> <h1> <h2>&gt;id:1|Gene1</h2> <xsl:value-of select="count(gene)"/> genes </h1> <xsl:apply-templates select="gene"/> <pre>ATAATGCTAGCTAGCTATCG </xsl:template> <h2>&gt;id:2|Gene2</h2> <xsl:template match="gene"> <h2> <pre>AATTGCGATTCATCGATGCT <xsl:text>&gt;id:</xsl:text> <xsl:value-of select="@id"/> <xsl:text>|</xsl:text> </body></html> <xsl:value-of select="name[1]"/> </h2> <pre> <xsl:value-of select="sequence"/> </pre> </xsl:template>
  • 40. XSLT (xml) <?xml version='1.0' encoding="ISO-8859-1"?> <xsl:stylesheet xmlns:xsl='http://www.w3.org/1999/XSL/Transform' xmlns="http://www.w3.org/2000/svg" xmlns:math="http://exslt.org/math" version="1.0" > <xsl:output method='xml'/> <xsl:template match="/"> <svg width="500" height="500" version='1.0'> <xsl:apply-templates select="genes"/> </svg> </xsl:template> <xsl:template match="genes"> <xsl:apply-templates select="gene[1]"/> </xsl:template> <xsl:template match="gene"> <text x="250" y="250"> <xsl:value-of select="name[1]"/> </text> <xsl:call-template name="drawseq"> <xsl:with-param name="i" select="number(1.0)"/> <xsl:with-param name="s" select="sequence"/> </xsl:call-template> </xsl:template> <xsl:template name="drawseq"> <xsl:param name="i"/> <xsl:param name="s" /> <xsl:variable name="L" select="string-length($s)"/> <text> <xsl:variable name="angle" select="$i * ( (2.0*3.14159) div $L )"/> <xsl:attribute name="x"><xsl:value-of select="250+200*math:cos( $angle )"/></xsl:attribute> <xsl:attribute name="y"><xsl:value-of select="250+200*math:sin( $angle )"/></xsl:attribute> <xsl:value-of select="substring($s,$i,1)"/> </text> <xsl:if test="$i+1 &lt;= $L"> <xsl:call-template name="drawseq"> <xsl:with-param name="i" select="1 + $i"/> <xsl:with-param name="s" select="$s"/> </xsl:call-template> </xsl:if> </xsl:template> </xsl:stylesheet>
  • 41.
  • 42. END