Commit 12caf166 authored by Antoine's avatar Antoine
Browse files

lexique to rdf transformation working for simple terms

parent 6a0f5f44
# Converter lexique_to_opale
In order to use this converter, follow those steps :
1. Copy your Lexique file(s) (.scar or .zip) into the input directory.
2. Execute the run that correspond to your OS.
3. You will find the result into the output directory. The names of the output are linked to the hour it was processed.
libdir=${basedir}/lib
rngdir=${basedir}/rng
xsldir=${basedir}/xsl
srcdir=${basedir}/in
outdir=${basedir}/out
InputPath=${basedir}/input
OutputPath=${basedir}/output
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project name="project" default="clean" basedir=".">
<property file="build.properties"/>
<taskdef name="jing" classname="com.thaiopensource.relaxng.util.JingTask">
<classpath>
<pathelement location="${libdir}/jing.jar"/>
</classpath>
</taskdef>
<taskdef resource="net/sf/antcontrib/antlib.xml">
<classpath>
<pathelement location="lib/ant-contrib.jar"/>
</classpath>
</taskdef>
<target name="rmOutputDir">
<if>
<available file="${OutputPath}" type="dir"/>
<then>
<delete dir="${OutputPath}"/>
</then>
</if>
</target>
<target name="init" depends="rmOutputDir">
<mkdir dir="${outdir}"/>
<chmod perm="777" dir="${outdir}"></chmod>
<mkdir dir="${srcdir}"/>
<chmod perm="777" dir="${srcdir}"></chmod>
<mkdir dir="${OutputPath}"/>
<chmod perm="777" dir="${OutputPath}"></chmod>
</target>
<target name="unzipSource" depends="init">
<for param="file">
<path>
<fileset dir="${InputPath}" id="inputsId">
<include name="*.zip"/>
<include name="*.scar"/>
</fileset>
</path>
<sequential>
<local name="TODAY_MY"/>
<tstamp>
<format property="TODAY_MY" pattern="yyyyMMdd-HHmmss" locale="en,UK" />
</tstamp>
<var name="name" unset="true"/>
<basename file="@{file}" property="name" />
<unzip src="${InputPath}/${name}" dest="${srcdir}/${TODAY_MY}"></unzip>
<sleep seconds="1"> </sleep>
</sequential>
</for>
</target>
<target name="buildOutput" depends="unzipSource">
<xslt classpath="${libdir}/saxon9he.jar" style="${xsldir}/termToRef.xsl" basedir="${srcdir}" destdir="${OutputPath}" followsymlinks="false" extension=".ref">
<include name="**/*.term"/>
</xslt>
<copy file="opale.wspmeta" tofile="${OutputPath}/.wspmeta"></copy>
<!--<jing rngfile="${rngdir}/op_glos.rng">
<fileset dir="${outdir}">
<include name="**/*.ref"/>
</fileset>
</jing>-->
</target>
<target name="clean" depends="buildOutput">
<delete dir="${srcdir}" />
<delete dir="${outdir}" />
</target>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8" ?>
<wspType defaultCode="Opale" title="Opale 3.5 (fr-FR)" description="" uri="Opale3-5_fr-FR_010" key="Opale3-5" lang="fr-FR" version="3.5.010"><wspUpdate localAutoUpdate="minor"><res key="Opale3-5.wsp"/></wspUpdate><systemSpace space="~param/Opale3-5/ss"><res key="Opale3-5.ss"/></systemSpace><systemSpace space="~param/Opale3-5/bs" optional="true"><res key="Opale3-5.bs"/></systemSpace><systemSpace space="~param/Opale3-5/gen/web"><res key="Opale3-5.gen.web"/></systemSpace><systemSpace space="~param/Opale3-5/gen/scormMono"><res key="Opale3-5.gen.scormMono"/></systemSpace><systemSpace space="~param/Opale3-5/gen/scormMulti"><res key="Opale3-5.gen.scormMulti"/></systemSpace><systemSpace space="~param/Opale3-5/gen/paper"><res key="Opale3-5.gen.paper"/></systemSpace><systemSpace space="~param/Opale3-5/gen/pres"><res key="Opale3-5.gen.pres"/></systemSpace><systemSpace space="~param/Opale3-5/gen/previewPresShort"><res key="Opale3-5.gen.previewPresShort"/></systemSpace><systemSpace space="~param/Opale3-5/gen/previewPresStandard"><res key="Opale3-5.gen.previewPresStandard"/></systemSpace><systemSpace space="~param/Opale3-5/gen/previewWebStandard"><res key="Opale3-5.gen.previewWebStandard"/></systemSpace><systemSpace space="~param/Opale3-5/gen/previewWebShort"><res key="Opale3-5.gen.previewWebShort"/></systemSpace><systemSpace space="~param/Opale3-5/gen/previewWebStandardComments"><res key="Opale3-5.gen.previewWebStandardComments"/></systemSpace><systemSpace space="~param/Opale3-5/gen/previewWebShortComments"><res key="Opale3-5.gen.previewWebShortComments"/></systemSpace><systemSpace space="~param/Opale3-5/gen/packScorm12"><res key="Opale3-5.gen.packScorm12"/></systemSpace><systemSpace space="~param/Opale3-5/gen/packScorm2k4"><res key="Opale3-5.gen.packScorm2k4"/></systemSpace><editionSheet pack="Opale3-5_fr-FR_010" brickSelector="{Opale3-5.moz;3.5.010;fr-FR}"/></wspType>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<sng:grammar xmlns:sp="http://www.utc.fr/ics/scenari/v3/primitive"
xmlns:sc="http://www.utc.fr/ics/scenari/v3/core" xmlns:lx="scpf.org:lexicon"
xmlns:sng="http://relaxng.org/ns/structure/1.0"
xmlns:snga="http://relaxng.org/ns/compatibility/annotations/1.0"
datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
<sng:start>
<sng:element name="sc:item">
<sng:ref name="lx_term"/>
</sng:element>
</sng:start>
<sng:define xmlns:sng="http://relaxng.org/ns/structure/1.0" name="lx_term">
<sng:element name="lx:term" snga:title="Terme">
<snga:documentation>L'item Terme permet de définir un mot du lexique.</snga:documentation>
<sng:ref name="lx_termM"/>
<sng:optional>
<sng:element name="sp:pronunciation" snga:title="Prononciation">
<snga:documentation>Permet de donner la forme phonétique et d'écouter la prononciation du terme.</snga:documentation>
<sng:attribute name="sc:refUri">
<sng:data type="string">
<sng:param name="minLength">1</sng:param>
</sng:data>
</sng:attribute>
<sng:ref name="lx_pronunciationM"/>
<sng:empty/>
</sng:element>
</sng:optional>
<sng:zeroOrMore>
<sng:element xmlns:sng="http://relaxng.org/ns/structure/1.0" name="sp:def"
snga:title="Définition">
<snga:documentation>Permet de saisir une ou plusieurs définitions du terme en question.</snga:documentation>
<sng:choice>
<sng:group>
<sng:attribute name="sc:refUri">
<sng:data type="string">
<sng:param name="minLength">1</sng:param>
</sng:data>
</sng:attribute>
<sng:empty/>
</sng:group>
<sng:ref xmlns:sng="http://relaxng.org/ns/structure/1.0"
name="lx_definition"/>
</sng:choice>
</sng:element>
</sng:zeroOrMore>
<sng:optional>
<sng:element name="sp:index" snga:title="Indexation">
<snga:documentation>Permet de lier des Tags au terme défini afin de le rattacher à des critères de recherche (thèmes, catégories...)</snga:documentation>
<sng:ref xmlns:sng="http://relaxng.org/ns/structure/1.0" name="lx_index"/>
</sng:element>
</sng:optional>
</sng:element>
</sng:define>
<sng:define xmlns:sng="http://relaxng.org/ns/structure/1.0" name="lx_index">
<sng:element name="lx:index" snga:title="Indexation">
<sng:oneOrMore>
<sng:element xmlns:sng="http://relaxng.org/ns/structure/1.0" name="sp:tag"
snga:title="Tag">
<snga:documentation> Permet de créer un critère de recherche. Les Tags sont liés aux termes du lexique et permettent ainsi une entrée alternative, par thèmes ou catégories, aux définitions du lexique, via la recherche avancée.</snga:documentation>
<sng:attribute name="sc:refUri">
<sng:data type="string">
<sng:param name="minLength">1</sng:param>
</sng:data>
</sng:attribute>
<sng:empty/>
</sng:element>
</sng:oneOrMore>
</sng:element>
</sng:define>
<sng:define xmlns:sng="http://relaxng.org/ns/structure/1.0" name="lx_definition">
<sng:element name="lx:definition" snga:title="Définition">
<sng:element name="sp:desc" snga:title="Texte">
<sng:ref xmlns:sng="http://relaxng.org/ns/structure/1.0" name="lx_defTxt"/>
</sng:element>
<sng:optional>
<sng:element name="sp:source" snga:title="Source">
<snga:documentation> Permet d'identifier l'origine d'une définition (site internet, bibliographie,...).</snga:documentation>
<sng:choice>
<sng:group>
<sng:attribute name="sc:refUri">
<sng:data type="string">
<sng:param name="minLength">1</sng:param>
</sng:data>
</sng:attribute>
<sng:empty/>
</sng:group>
<sng:ref xmlns:sng="http://relaxng.org/ns/structure/1.0" name="lx_source"/>
</sng:choice>
</sng:element>
</sng:optional>
<sng:optional>
<sng:element name="sp:links" snga:title="Liens vers d'autres termes">
<snga:documentation>Permet de faire des liens vers d'autres termes du lexique en fonction des relations entre ces termes.</snga:documentation>
<sng:ref name="lx_linkTermM"/>
<sng:empty/>
</sng:element>
</sng:optional>
<sng:zeroOrMore>
<sng:element xmlns:sng="http://relaxng.org/ns/structure/1.0" name="sp:moreInfo"
snga:title="Complément">
<snga:documentation>Permet de donner des informations complémentaires concernant le terme défini.</snga:documentation>
<sng:ref name="lx_moreInfoM"/>
<sng:ref xmlns:sng="http://relaxng.org/ns/structure/1.0" name="lx_txt"/>
</sng:element>
</sng:zeroOrMore>
</sng:element>
</sng:define>
<sng:define xmlns:sng="http://relaxng.org/ns/structure/1.0" name="lx_defTxt">
<sng:element name="lx:defTxt" snga:title="Texte de la définition d'un terme">
<sng:ref name="lx_defTxt_blocs"/>
</sng:element>
</sng:define>
<sng:define xmlns:sng="http://relaxng.org/ns/structure/1.0" name="lx_defTxt_blocs">
<sng:oneOrMore>
<sng:choice>
<sng:element name="sc:para" snga:title="Paragraphe">
<sng:ref name="lx_defTxt_id"/>
<sng:optional>
<sng:attribute name="xml:space">
<sng:value>preserve</sng:value>
</sng:attribute>
</sng:optional>
<sng:ref name="lx_defTxt_inline"/>
</sng:element>
<sng:element name="sc:itemizedList" snga:title="Liste à puce">
<sng:optional>
<sng:attribute name="role">
<sng:value/>
</sng:attribute>
</sng:optional>
<sng:ref name="lx_defTxt_id"/>
<sng:zeroOrMore>
<sng:element name="sc:listItem">
<sng:ref name="lx_defTxt_id"/>
<sng:ref name="lx_defTxt_blocs"/>
</sng:element>
</sng:zeroOrMore>
</sng:element>
<sng:element name="sc:orderedList" snga:title="Liste ordonnée">
<sng:optional>
<sng:attribute name="role">
<sng:value/>
</sng:attribute>
</sng:optional>
<sng:ref name="lx_defTxt_id"/>
<sng:zeroOrMore>
<sng:element name="sc:listItem">
<sng:ref name="lx_defTxt_id"/>
<sng:ref name="lx_defTxt_blocs"/>
</sng:element>
</sng:zeroOrMore>
</sng:element>
<sng:element name="sc:table" snga:title="Tableau">
<sng:optional>
<sng:attribute name="role">
<sng:value/>
</sng:attribute>
</sng:optional>
<sng:ref name="lx_defTxt_id"/>
<sng:optional>
<sng:element name="sc:caption" snga:title="">
<sng:ref name="lx_defTxt_id"/>
<sng:ref name="lx_defTxt_inline"/>
<sng:optional>
<sng:attribute name="xml:space">
<sng:value>preserve</sng:value>
</sng:attribute>
</sng:optional>
</sng:element>
</sng:optional>
<sng:zeroOrMore>
<sng:choice>
<sng:element name="sc:column" snga:title="Colonne">
<sng:optional>
<sng:attribute name="role">
<sng:value/>
</sng:attribute>
</sng:optional>
<sng:ref name="lx_defTxt_id"/>
<sng:attribute name="width">
<sng:data type="string"/>
</sng:attribute>
</sng:element>
<sng:element name="sc:column" snga:title="Colonne de total">
<sng:attribute name="role">
<sng:value>total</sng:value>
</sng:attribute>
<sng:ref name="lx_defTxt_id"/>
<sng:attribute name="width">
<sng:data type="string"/>
</sng:attribute>
</sng:element>
</sng:choice>
</sng:zeroOrMore>
<sng:zeroOrMore>
<sng:choice>
<sng:element name="sc:row" snga:title="Ligne">
<sng:optional>
<sng:attribute name="role">
<sng:value/>
</sng:attribute>
</sng:optional>
<sng:ref name="lx_defTxt_id"/>
<sng:ref name="lx_defTxt_cells_"/>
</sng:element>
<sng:element name="sc:row" snga:title="Ligne d'entête">
<sng:attribute name="role">
<sng:value>head</sng:value>
</sng:attribute>
<sng:ref name="lx_defTxt_id"/>
<sng:ref name="lx_defTxt_cells_"/>
</sng:element>
<sng:element name="sc:row" snga:title="Ligne de total">
<sng:attribute name="role">
<sng:value>total</sng:value>
</sng:attribute>
<sng:ref name="lx_defTxt_id"/>
<sng:ref name="lx_defTxt_cells_"/>
</sng:element>
</sng:choice>
</sng:zeroOrMore>
<sng:ref name="lx_defTxt_cells_"/>
</sng:element>
<sng:element name="sc:extBlock" snga:title="Image informative">
<sng:attribute name="role">
<sng:value>img</sng:value>
</sng:attribute>
<sng:ref name="lx_defTxt_id"/>
<sng:attribute name="sc:refUri">
<sng:data type="string">
<sng:param name="minLength">1</sng:param>
</sng:data>
</sng:attribute>
</sng:element>
<sng:element name="sc:extBlock" snga:title="Image décorative">
<sng:attribute name="role">
<sng:value>illus</sng:value>
</sng:attribute>
<sng:ref name="lx_defTxt_id"/>
<sng:attribute name="sc:refUri">
<sng:data type="string">
<sng:param name="minLength">1</sng:param>
</sng:data>
</sng:attribute>
</sng:element>
<sng:element name="sc:extBlock" snga:title="Animation">
<sng:attribute name="role">
<sng:value>anim</sng:value>
</sng:attribute>
<sng:ref name="lx_defTxt_id"/>
<sng:attribute name="sc:refUri">
<sng:data type="string">
<sng:param name="minLength">1</sng:param>
</sng:data>
</sng:attribute>
</sng:element>
</sng:choice>
</sng:oneOrMore>
</sng:define>
<sng:define xmlns:sng="http://relaxng.org/ns/structure/1.0" name="lx_defTxt_inline">
<sng:zeroOrMore>
<sng:choice>
<sng:text/>
<sng:element name="sc:uLink" snga:title="Lien vers un autre terme">
<sng:attribute name="role">
<sng:value>lnkTerm</sng:value>
</sng:attribute>
<sng:ref name="lx_defTxt_id"/>
<sng:optional>
<sng:attribute name="url">
<sng:data type="string">
<sng:param name="minLength">1</sng:param>
</sng:data>
</sng:attribute>
</sng:optional>
<sng:optional>
<sng:attribute name="sc:refUri">
<sng:data type="string">
<sng:param name="minLength">1</sng:param>
</sng:data>
</sng:attribute>
</sng:optional>
<sng:ref name="lx_defTxt_inline"/>
</sng:element>
<sng:element name="sc:uLink" snga:title="Lien vers un document interne">
<sng:attribute name="role">
<sng:value>ref</sng:value>
</sng:attribute>
<sng:ref name="lx_defTxt_id"/>
<sng:optional>
<sng:attribute name="url">
<sng:data type="string">
<sng:param name="minLength">1</sng:param>
</sng:data>
</sng:attribute>
</sng:optional>
<sng:optional>
<sng:attribute name="sc:refUri">
<sng:data type="string">
<sng:param name="minLength">1</sng:param>
</sng:data>
</sng:attribute>
</sng:optional>
<sng:ref name="lx_defTxt_inline"/>
</sng:element>
<sng:element name="sc:phrase"
snga:title="Adresse web, email, lien vers un document externe">
<sng:attribute name="role">
<sng:value>url</sng:value>
</sng:attribute>
<sng:ref name="lx_defTxt_id"/>
<sng:optional>
<sng:attribute name="xml:lang">
<sng:data type="string"/>
</sng:attribute>
</sng:optional>
<sng:ref name="lx_urlM"/>
<sng:ref name="lx_defTxt_inline"/>
</sng:element>
<sng:element name="sc:phrase" snga:title="Citation">
<sng:attribute name="role">
<sng:value>quote</sng:value>
</sng:attribute>
<sng:ref name="lx_defTxt_id"/>
<sng:optional>
<sng:attribute name="xml:lang">
<sng:data type="string"/>
</sng:attribute>
</sng:optional>
<sng:optional>
<sng:ref name="lx_langM"/>
</sng:optional>
<sng:ref name="lx_defTxt_inline"/>
</sng:element>
<sng:element name="sc:phrase" snga:title="Terme spécifique">
<sng:attribute name="role">
<sng:value>special</sng:value>
</sng:attribute>
<sng:ref name="lx_defTxt_id"/>
<sng:optional>
<sng:attribute name="xml:lang">
<sng:data type="string"/>
</sng:attribute>
</sng:optional>
<sng:optional>
<sng:ref name="lx_langM"/>
</sng:optional>
<sng:ref name="lx_defTxt_inline"/>
</sng:element>
<sng:element name="sc:inlineStyle" snga:title="Mise en relief">
<sng:attribute name="role">
<sng:value>emphasis</sng:value>
</sng:attribute>
<sng:ref name="lx_defTxt_id"/>
<sng:ref name="lx_defTxt_inline"/>
</sng:element>
<sng:element name="sc:inlineImg" snga:title="Imagette informative">
<sng:attribute name="role">
<sng:value>ico</sng:value>
</sng:attribute>
<sng:ref name="lx_defTxt_id"/>
<sng:attribute name="sc:refUri">
<sng:data type="string">
<sng:param name="minLength">1</sng:param>
</sng:data>
</sng:attribute>
<sng:text/>
</sng:element>
<sng:element name="sc:inlineImg" snga:title="Imagette décorative">
<sng:attribute name="role">
<sng:value>icoIllus</sng:value>
</sng:attribute>
<sng:ref name="lx_defTxt_id"/>
<sng:attribute name="sc:refUri">
<sng:data type="string">
<sng:param name="minLength">1</sng:param>
</sng:data>
</sng:attribute>
<sng:text/>
</sng:element>
</sng:choice>
</sng:zeroOrMore>
</sng:define>
<sng:define xmlns:sng="http://relaxng.org/ns/structure/1.0" name="lx_defTxt_id">
<sng:optional>
<sng:attribute name="sc:id">
<sng:data type="ID"/>
</sng:attribute>
</sng:optional>
</sng:define>
<sng:define xmlns:sng="http://relaxng.org/ns/structure/1.0" name="lx_defTxt_cells_">
<sng:zeroOrMore>
<sng:choice>
<sng:element name="sc:cell" snga:title="Cellule de texte">
<sng:optional>
<sng:attribute name="role">
<sng:value/>
</sng:attribute>
</sng:optional>
<sng:ref name="lx_defTxt_id"/>
<sng:optional>
<sng:attribute name="rowSpan">
<sng:data type="string"/>
</sng:attribute>
</sng:optional>
<sng:optional>
<sng:attribute name="colSpan">
<sng:data type="string"/>
</sng:attribute>
</sng:optional>
<sng:optional>
<sng:ref name="lx_defTxt_blocs"/>
</sng:optional>
</sng:element>
<sng:element name="sc:cell" snga:title="Cellule de nombre">
<sng:attribute name="role">
<sng:value>num</sng:value>
</sng:attribute>
<sng:ref name="lx_defTxt_id"/>
<sng:optional>
<sng:attribute name="rowSpan">
<sng:data type="string"/>
</sng:attribute>
</sng:optional>
<sng:optional>
<sng:attribute name="colSpan">
<sng:data type="string"/>
</sng:attribute>
</sng:optional>
<sng:optional>
<sng:ref name="lx_defTxt_blocs"/>
</sng:optional>
</sng:element>
<sng:element name="sc:cell" snga:title="Cellule de mot">
<sng:attribute name="role">
<sng:value>word</sng:value>
</sng:attribute>
<sng:ref name="lx_defTxt_id"/>
<sng:optional>
<sng:attribute name="rowSpan">
<sng:data type="string"/>
</sng:attribute>
</sng:optional>
<sng:optional>
<sng:attribute name="colSpan">
<sng:data type="string"/>
</sng:attribute>
</sng:optional>
<sng:optional>
<sng:ref name="lx_defTxt_blocs"/>
</sng:optional>
</sng:element>
</sng:choice>
</sng:zeroOrMore>
</sng:define>
<sng:define xmlns:sng="http://relaxng.org/ns/structure/1.0" name="lx_urlM">
<sng:element name="lx:urlM" snga:title="Url">
<sng:element name="sp:url" snga:title="Url, adresse web">
<snga:documentation>Permet de saisir l'adresse de la source sur internet.</snga:documentation>
<sng:data type="string">
<sng:param name="minLength">1</sng:param>
</sng:data>
</sng:element>
<sng:optional>
<sng:element name="sp:title" snga:title="Titre">
<snga:documentation>Permet de décrire la fonction et la destination du lien, lorsque le texte sur lequel est rattachée l'URL n'est pas explicite.</snga:documentation>
<sng:data type="string">
<sng:param name="minLength">1</sng:param>
</sng:data>
</sng:element>
</sng:optional>
<sng:optional>
<sng:element name="sp:doc" snga:title="Compléments pour un document lié">
<snga:documentation>Permet de saisir des précisions sir l'url conduit à un document bureautique.</snga:documentation>
<sng:optional>
<sng:element name="sp:type" snga:title="Format du document (PDF...)">
<snga:documentation>Permet de définir le format du document (PDF, RTF...).</snga:documentation>
<sng:data type="string">
<sng:param name="minLength">1</sng:param>
</sng:data>
</sng:element>
</sng:optional>
<sng:optional>
<sng:element name="sp:weight" snga:title="Poids">
<snga:documentation>Permet de saisir le poids (en kO) du document, afin d'anticiper le temps de téléchargement.</snga:documentation>
<sng:data type="string">
<sng:param name="minLength">1</sng:param>
</sng:data>
</sng:element>
</sng:optional>
<sng:optional>
<sng:element name="sp:lang" snga:title="Langue">
<snga:documentation>Permet de préciser le code de la langue du fichier, notamment pour les lecteurs d'écran. Une liste de suggestions apparaît au fur et à mesure de la saisie. </snga:documentation>
<sng:choice>
<sng:ref name="lx_langM"/>
</sng:choice>
</sng:element>
</sng:optional>
</sng:element>
</sng:optional>
</sng:element>
</sng:define>