The bibliography example

Data

The sample is quite simple :
we have a DTD which discribe a list of bibligoraphy references :

A reference is an element which contains differents informations like : authors, title of article, abstract; ....
The objective of the set of transformation is to present this set of references in different form. In this exemple, we want to have four presentation.

  1. A Html presentation order by year of publication (see) ;
  2. A Html presentation order by author ;
  3. A Html presentation order by conference type (see);
  4. A list of bibtex entry (see).
To do this, we have defined a set of XSL files, and used the transmorpher to combine the differents XSL file.
This agregation is descibred in the 3 samples :
Sample 1 : this is a simple transormation (see Sample 1 )
Sample 2 : this is a simple transformation with a query (see Sample 2 )
Sample 3 : this is a more complex transformation (see Sample 3 )
Also, in the performance analysis (see performance) you can find a discussion on improvment issue.
<reference index="bougé2000a" type="inproceedings" language="fr">
<authors>
<p first="Patrick" last="Bougé"/>
<p first="Jérôme" last="Euzenat"/>
<p first="Jean-Paul" last="Barthès"/>
</authors>
<title>Localisation des connaissances dans les systèmes de production</title>
<conference type="journées" name="Gestion de connaissances" sponsor="Prosper">
<location city="Toulouse" country="FR"/>
</conference>
<year>2000</year>
<date>7-8 juin</date>
<pages>31-50</pages>
<links>
<url href="http://www.univ-valenciennes.fr//Prosper-loc-formatted.zip" status="public"/>
<url href="ftp://ftp.inrialpes.fr//bouge2000a.ps.gz" status="public"/>
</links>
<abstract>La gestion des connaissances s'instancie de manière extrèmement variée au sein des entreprises et elle mobilise des disciplines tout aussi ariées. Les connaissances considérées par les différentes approches peuvent être très différentes. On peut se demander si cet état de fait est dû aux approches mises en oeuvre ou exigé par la variété des applications englobées par la gestion de connaissance. On considère un ensemble de projets pouvant être considérés comme relevant de la gestion de connaissance restreinte au cadre des systèmes de productions. .</abstract>
<areas>
<li>Knowledge management/Gestion de connaissance</li>
</areas>
<contracts><li>ardeco</li></contracts>
</reference>
Figure 1.0 : A Reference

Sample 1 : this is a simple transormation

For example :
this description define a complexe transformation show in figure 1.0
<?xml version="1.0" encoding="UTF-8"?>
<transmorpher xmlns:FM="http://www.FluxMedia.fr/0.1">

<!-- WARNING ... this sample doesn't work alone, is part of the complex sample, it was split to simplify the presentation of the example -->

<!-- Definition of the rule set.
This rule set remove two kind of elements :
the first rule remove elements abstract or keywords or areas or .... in reference element
the second rule remove reference with an attribute status which as a value : private
The strip abstract can be done in XML, see here for a discussion on that points.
-->
<DefineRuleSet name="stripAbstract">
<remtag match="abstract|keywords|areas|softwares|contracts" content="reference"/>
<remtag match="*[status='private']" content="reference"/>
</DefineRuleSet>

<process name="myFirstprocess" in="R112" out="X3 Y3 Z3">
<!-- This element split the XML flow in Two XML flow, the two flow contains the same informations */
<dispatch name="Dispatcher1" in="R112" out="D1 D3"/>

<!-- this element remove the hidden element in the biblography -->
<apply-external type="xslt" name="XLST11" file="strip-hidden.xsl" in="D1" out="X1"/>
<!-- This element split the XML flow in Two XML flow, the two flow contains the same informations */
<dispatch name="Dispatcher2" in="X1" out="X11 X12"/>

<!-- this element sort the biblography by title and year -->
<apply-external type="xslt" name="XLST21" file="sort-ty.xsl" in="X11" out="X2"/>
<!-- this element compute the presentation -->
<apply-external type="xslt" name="XLST31" file="form-harea.xsl" in="X2" out="X3"/>

<!-- this element sort the biblography by content, year and author -->
<apply-external type="xslt" name="XLST22" file="sort-cya.xsl" in="X12" out="Y2"/>
<!-- this element compute the bibtex presentation -->
<apply-external type="xslt" name="XLST32" file="form-bibtex.xsl" in="Y2" out="Y3"/>

<!-- this element remove the abstract and other element in the bibliography -->
<ruleset type="Internal" name="Rule-Abstract" refOn="stripAbstract" in="D3" out="Z1"/>
<!-- this element sort the biblography by author and year -->
<apply-external type="xslt" name="XLST23" file="sort-ay.xsl" in="Z1" out="Z2"/>
<!-- this element compute the xml presentation -->
<apply-external type="xslt" name="XLST32" file="form-xml.xsl" invv="Z2" out="Z3"/>
</process>

</transmorpher>



Figure 1.0 : Complexe XSL process


bibliography sorted by type

bibliography sorted bye date

bibliography in bibtex

Figure 4.0 : The output

Sample 2 : this is a simple transormation

For example :
this description define a complexe transformation show in figure 1.0
<?xml version="1.0" encoding="UTF-8"?>
<transmorpher xmlns:FM="http://www.FluxMedia.org/schema">

<!-- This sample allow to select a set of element in the bibliography -->
<process name="mySecondprocess" >
<!-- Read the XML input file -->
<generate type="readfile" name="Reader" out="R1" file="./bibexmo.xml"/>

<!-- Select a set of element : only troncy and brunet reference -->
<query type="simpleOne" name="query1" file="query1.xml" in="R1" out="Z1"/>

<!-- Transform the XML to html -->
<apply-externaltype="xslt" name="XLST32" file="form-xml2html.xsl" in="Z1" out="Z2"/>

<!-- Write the HTML -->
<serialize name="SErializer1" in="Z2" file="Answer.html" />
</process>

</transmorpher>

<-- This query allow to select all reference of Troncy and Brunet author -->
<Query root="bibliography">
<Select expr="bibliography/reference[authors/p/@last='Troncy']"/>
<Select expr="bibliography/reference[authors/p/@last='Brunet']"/>
</Query>


Figure 1.0 : Query sample

Sample 3 : this is a more complex transformation

this description define a complexe transformation show in figure 1.0

<?xml version="1.0" encoding="UTF-8"?>
<transmorpher xmlns:TM="http://www.FluxMedia.fr/0.1">

<DefineRuleSet name="stripAbstract">
<remtag match="abstract|keywords|areas|softwares|contracts" content="reference"/>
<remtag match="*[status='private']" content="reference"/>
</DefineRuleSet>

<processname="myFirstprocess" in="R112" out="X3 Y3 Z3">
<dispatch name="Dispatcher1" in="R112" out="D1 D3"/>

<apply-external type="xslt" name="XLST11" file="strip-hidden.xsl" in="D1" out="X1"/>
<dispatch name="Dispatcher2" in="X1" out="X11 X12"/>

<apply-external type="xslt" name="XLST21" file="sort-ty.xsl" in="X11" out="X2"/>
<apply-external type="xslt" name="XLST31" file="form-harea.xsl" in="X2" out="X3"/>

<apply-external type="xslt" name="XLST22" file="sort-cya.xsl" in="X12" out="Y2"/>
<apply-external type="xslt" name="XLST32" file="form-bibtex.xsl" in="Y2" out="Y3"/>

<ruleset type="Internal" name="Rule-Abstract" refOn="stripAbstract" in="D3" out="Z1"/>
<apply-external type="xslt" name="XLST23" file="sort-ay.xsl" in="Z1" out="Z2"/>
<apply-external type="xslt" name="XLST32" file="form-xml.xsl" in="Z2" out="Z3"/>
</process>

<process name="mySecondprocess" in="R111" out="Z3">
<apply-external type="xslt" name="XLST13" file="strip-hidden.xsl" in="R111" out="Z3"/>
</process>

<main name="myMainProcess">
<generate type="readfile" name="Reader" out="R1" file="./bibexmo.xml"/>
<dispatch name="Dispatcher 1" in="R1" out="X11 X12"/>

<apply-process name="Fisrt" refOn="myFirstprocess" in="X11" out="X31 Y31 Z31" />
<apply-process name="toto" refOn="mySecondprocess" in="X12" out="W3" />

<serialize name="SErializer1" in="X31" file="biblio.html" />
<serialize name="SErializer2" in="Y31" file="biblio.bib"/>
<serialize name="SErializer3" in="Z31" file="biblio-xml.html"/>
<serialize name="SErializer4" in="W3" file="biblie_t3.html"/>
</main>

</transmorpher>



Figure 1.0 : Complexe XSL process


Figure 2.0 : Complexe XSL process


Figure 3.0 : Complexe XSL process


bibliography sorted by type

bibliography sorted bye date

bibliography in bibtex

Figure 4.0 : The output

Performance analysis

See performance.

Next chapter: Computational model


http://transmorpher.inrialpes.fr/refman/examples.html

Feel free to comment to Jérôme Euzenat, Last modified: Thu Apr 19 18:36:01 CEST 2001