Commit message:
planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/main/tools-ecology/tools/make_data_paper_sketches commit 34f4e0604adc2a2ba4902ce6b8e6df2460eda292 |
added:
draft_data_paper.xml emldown_templates/addmap2.xsl emldown_templates/bootstrap2.xsl emldown_templates/dataset2.xsl emldown_templates/datatable2.xsl emldown_templates/footer.xsl emldown_templates/geographic_coverage.xsl emldown_templates/head.xsl emldown_templates/method.xsl emldown_templates/otherentity.xsl emldown_templates/rights.xsl emldown_templates/spatraster2.xsl emldown_templates/spatvector2.xsl emldown_templates/taxonomic_coverage.xsl emldown_templates/temporal_coverage.xsl emldown_templates/units.xsl map_geographical_coverage.R test-data/EML.xml |
b |
diff -r 000000000000 -r cfe884e53600 draft_data_paper.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/draft_data_paper.xml Tue Oct 15 20:33:48 2024 +0000 |
[ |
@@ -0,0 +1,71 @@ +<tool id="data_paper_from_EML" name="Make data paper sketches" version="0.1.0+galaxy0" profile="21.05"> + <description>from EML</description> + <requirements> + <requirement type="package" version="4.3.3">r-base</requirement> + <requirement type="package" version="1.1.39">libxslt</requirement> + <requirement type="package" version="3.5">pandoc</requirement> + <requirement type="package" version="1.1.4">r-dplyr</requirement> + <requirement type="package" version="2.11.2">r-mapview</requirement> + <requirement type="package" version="1.4.6">r-xslt</requirement> + <requirement type="package" version="1.3.6">r-xml2</requirement> + <requirement type="package" version="2.1.1">phantomjs</requirement> + + </requirements> + <command detect_errors="exit_code"><![CDATA[ + + Rscript '$__tool_directory__/map_geographical_coverage.R' '$inputmetadatafile' && + + xsltproc -o datapaper.html '$__tool_directory__/emldown_templates/bootstrap2.xsl' '${inputmetadatafile}' && + pandoc datapaper.html -o data_paper.docx + + ]]></command> + <inputs> + <param name="inputmetadatafile" type="data" format="xml" label="EML metadata file" help="Insert only metadata using EML standard"/> + </inputs> + <outputs> + <data name="datapaper_docx" from_work_dir="data_paper.docx" format="docx" label="data_paper.docx"/> + </outputs> + <tests> + <test> + <param name="inputmetadatafile" value="EML.xml"/> + <output name='datapaper_docx'> + <assert_contents> + <has_size value="31756" delta="50"/> + </assert_contents> + </output> + </test> + </tests> + <help><![CDATA[ + +**What it does?** +-------------------- + +This tool derived from the archived R Opensci emldown package thanks to French Fund for open science "OpenMetaPaper" project emldown R code improvements https://github.com/TanguyGen/emldown and creation fo the MetaShRIMPS R Shiny App <https://github.com/TanguyGen/metaCure> is made to produce draft of data paper from Ecological Metadata Language (EML) based metadata documents. + +**How to use it?** +-------------------- + +You need to input an EML (Ecological Metadata Language) metadata file (xml format) and run the tool that will produce a draft of data paper in docx format that you can edit. + + + ]]></help> + + <citations> + <citation type="bibtex">@misc{githubsurvey2023, + author = {Tanguy Genthon}, + title = {{Metadata Shiny for Retroactive Information Management and Production of data paper Sketches}}, + publisher = {Github}, + url = {https://github.com/TanguyGen/metaCure}, + year = {2023} + } + }</citation> + <citation type="bibtex">@misc{githubsurvey2023b, + author = {Tanguy Genthon}, + title = {{Produce beautifull website from EML}}, + publisher = {Github}, + url = {https://github.com/TanguyGen/emldown}, + year = {2023} + } + }</citation> + </citations> +</tool> |
b |
diff -r 000000000000 -r cfe884e53600 emldown_templates/addmap2.xsl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/emldown_templates/addmap2.xsl Tue Oct 15 20:33:48 2024 +0000 |
b |
@@ -0,0 +1,14 @@ +<?xml version="1.0" encoding="UTF-8"?> +<xsl:stylesheet version="1.0" +xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> +<xsl:template name="addmap2" match="/"> +<xsl:choose> + <xsl:when test=".//geographicCoverage"> + <div class="embed-responsive embed-responsive-4by3"> + <img src="map.png" style="padding:50px" ></img> + </div> + </xsl:when> +</xsl:choose> +</xsl:template> +</xsl:stylesheet> + |
b |
diff -r 000000000000 -r cfe884e53600 emldown_templates/bootstrap2.xsl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/emldown_templates/bootstrap2.xsl Tue Oct 15 20:33:48 2024 +0000 |
b |
@@ -0,0 +1,77 @@ +<?xml version="1.0" encoding="UTF-8"?> +<xsl:stylesheet version="1.0" +xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> + +<xsl:include href="head.xsl"/> +<xsl:include href="temporal_coverage.xsl"/> +<xsl:include href="geographic_coverage.xsl"/> +<xsl:include href="taxonomic_coverage.xsl"/> +<xsl:include href="dataset2.xsl"/> +<xsl:include href="datatable2.xsl"/> +<xsl:include href="spatraster2.xsl"/> +<xsl:include href="spatvector2.xsl"/> +<xsl:include href="units.xsl"/> +<xsl:include href="otherentity.xsl"/> +<xsl:include href="footer.xsl"/> +<xsl:include href="rights.xsl"/> +<xsl:include href="addmap2.xsl"/> +<xsl:include href="method.xsl"/> +<xsl:template match="/"> +<html lang="en"> + + <xsl:call-template name="head"/> + <body> + <div class="container" id="dataset_info"> + <div class="starter-template"> + <xsl:call-template name="dataset2"/> + </div> + </div> + <div class="container" id="method"> + <xsl:call-template name="method"/> + </div> + +<div class="container" id="temporal"> + <xsl:call-template name="temporal_coverage"/> + </div><!-- /.container --> + + <div class="container" id="geographic"> + <xsl:call-template name="geographic_coverage"/> + <xsl:call-template name="addmap2"/> + </div><!-- /.container --> + + <div class="container" id="taxonomic"> + <xsl:call-template name="taxonomic_coverage"/> + </div><!-- /.container --> + + <div class="container" id="datatable"> + <xsl:call-template name="datatable2"/> + </div><!-- /.container --> + + <div class="container" id="spatraster"> + <xsl:call-template name="spatraster2"/> + </div><!-- /.container --> + + <div class="container" id="spavector"> + <xsl:call-template name="spatvector2"/> + </div><!-- /.container --> + + <div class="container" id="units"> + <xsl:call-template name="units"/> + </div><!-- /.container --> + + <div class="container" id="otherentity"> + <xsl:call-template name="otherentity"/> + </div><!-- /.container --> + + <div class="container"> + <xsl:call-template name="rights"/> + </div> + + </body> + + <xsl:call-template name="footer"/> + +</html> + +</xsl:template> +</xsl:stylesheet> |
b |
diff -r 000000000000 -r cfe884e53600 emldown_templates/dataset2.xsl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/emldown_templates/dataset2.xsl Tue Oct 15 20:33:48 2024 +0000 |
b |
@@ -0,0 +1,88 @@ +<?xml version="1.0" encoding="UTF-8"?> +<xsl:stylesheet version="1.0" +xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> + +<xsl:template name="dataset2" match="/"> +<xsl:choose> + <xsl:when test=".//dataset/pubDate"> + <h3>Publication date </h3> + <xsl:value-of select="//dataset/pubDate"/> + </xsl:when> +</xsl:choose> + +<xsl:choose> + <xsl:when test=".//dataset/abstract"> + <h3>Abstract</h3> +<div class="container"> +<div class="jumbotron"> + <p class="lead"><xsl:value-of select="//dataset/abstract" /></p> +</div> +</div> + </xsl:when> +</xsl:choose> + +<xsl:choose> + <xsl:when test=".//metadataProvider"> + <h3>Metadata Provider</h3> + <p> + <xsl:value-of select="//metadataProvider/individualName/givenName"/>  + <xsl:value-of select="//metadataProvider/individualName/surName"/> + </p> + </xsl:when> +</xsl:choose> + <h3>Author list</h3> + <h4>Creators</h4> + <ul class="list-group"> + <xsl:for-each select="//dataset/creator"> + <li class="list-group-item"> + <xsl:value-of select="individualName/givenName"/>  + <xsl:value-of select="individualName/surName"/>  + <xsl:value-of select="electronicMailAddress"/> + </li> + </xsl:for-each> + </ul> + +<xsl:choose> + <xsl:when test=".//associatedParty"> + <h4>Associated parties</h4> + <ul class="list-group"> + <xsl:for-each select="//dataset/associatedParty"> + <li class="list-group-item"> + <xsl:value-of select="individualName/givenName"/>  + <xsl:value-of select="individualName/surName"/>  + <xsl:value-of select="electronicMailAddress"/> + </li> + </xsl:for-each> + </ul> + </xsl:when> +</xsl:choose> +<xsl:choose> + <xsl:when test=".//dataset/keywordSet/keyword"> + <h3>Keywords</h3> + <p> + <xsl:for-each select="//dataset/keywordSet/keyword"> + <ul> + <li><xsl:value-of select="."/></li> + </ul> + </xsl:for-each> + </p> + </xsl:when> +</xsl:choose> + +<xsl:choose> + <xsl:when test=".//dataset/annotation"> + <h3>Annotations</h3> + <p> + <xsl:for-each select="//dataset/annotation"> + <ul> + <li> +<xsl:value-of select="./valueURI/@label"/>  +<a href="{valueURI}"><xsl:value-of select="./valueURI"/></a> + </li> + </ul> + </xsl:for-each> + </p> + </xsl:when> +</xsl:choose> +</xsl:template> +</xsl:stylesheet> |
b |
diff -r 000000000000 -r cfe884e53600 emldown_templates/datatable2.xsl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/emldown_templates/datatable2.xsl Tue Oct 15 20:33:48 2024 +0000 |
b |
@@ -0,0 +1,38 @@ +<?xml version="1.0" encoding="UTF-8"?> +<xsl:stylesheet version="1.0" +xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> + +<xsl:template name="datatable2" match="/"> +<xsl:choose> + <xsl:when test=".//dataTable"> + <h3>Data tables</h3> + <xsl:for-each select=".//dataTable"> + <br/> +<h4><xsl:value-of select="entityName"/></h4> + <br/> + <tr> + Physical:<xsl:text> </xsl:text><xsl:value-of select="physical/objectName"/> + </tr> + <div class="table-responsive"> +<table class="table table-striped"> + <tr> + <th>attribute name</th> + <th>definition</th> + <th>format, unit or codes</th> + </tr> + <xsl:for-each select="attributeList/attribute"> + <tr> + <td><xsl:value-of select="attributeName"/></td> + <td><xsl:value-of select="attributeDefinition"/></td> + <td><xsl:value-of select="measurementScale/dateTime"/><xsl:value-of select="measurementScale/ratio/unit"/><xsl:value-of select="measurementScale/interval/unit"/><xsl:for-each select="measurementScale/nominal/nonNumericDomain/enumeratedDomain/codeDefinition"><xsl:value-of select="code"/><xsl:text> = </xsl:text><xsl:value-of select="definition"/> <xsl:text> </xsl:text></xsl:for-each></td> + </tr> + </xsl:for-each> + </table> + </div> + </xsl:for-each> + </xsl:when> + </xsl:choose> +</xsl:template> +</xsl:stylesheet> + + |
b |
diff -r 000000000000 -r cfe884e53600 emldown_templates/footer.xsl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/emldown_templates/footer.xsl Tue Oct 15 20:33:48 2024 +0000 |
b |
@@ -0,0 +1,15 @@ +<?xml version="1.0" encoding="UTF-8"?> +<xsl:stylesheet version="1.0" +xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> + +<xsl:template name = "footer" match="/"> + <footer> + <div class="copyright"> + Development supported by <a href='https://ropensci.org/'>rOpenSci</a> + </div> + <div class ="madeby"> + Created with <a href="https://github.com/ropenscilabs/emldown">emldown</a> + </div> + </footer> +</xsl:template> +</xsl:stylesheet> |
b |
diff -r 000000000000 -r cfe884e53600 emldown_templates/geographic_coverage.xsl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/emldown_templates/geographic_coverage.xsl Tue Oct 15 20:33:48 2024 +0000 |
b |
@@ -0,0 +1,33 @@ +<?xml version="1.0" encoding="UTF-8"?> +<xsl:stylesheet version="1.0" + xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> + + <xsl:template name="geographic_coverage" match="/"> + <xsl:choose> + <xsl:when test=".//geographicCoverage"> + <h3>Geographic coverage</h3> + <div class="row"> + <xsl:for-each select="//dataset/coverage/geographicCoverage"> + <div class="col-sm-3"> + + <p><b><xsl:value-of select="geographicDescription"/></b></p> + + <p> + West: <xsl:value-of select="boundingCoordinates/westBoundingCoordinate"/><br/> + East: <xsl:value-of select="boundingCoordinates/eastBoundingCoordinate"/><br/> + North: <xsl:value-of select="boundingCoordinates/northBoundingCoordinate"/><br/> + South: <xsl:value-of select="boundingCoordinates/southBoundingCoordinate"/> + </p> + + </div> + + </xsl:for-each> + + </div> + </xsl:when> + </xsl:choose> + </xsl:template> +</xsl:stylesheet> + + + |
b |
diff -r 000000000000 -r cfe884e53600 emldown_templates/head.xsl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/emldown_templates/head.xsl Tue Oct 15 20:33:48 2024 +0000 |
b |
@@ -0,0 +1,11 @@ +<?xml version="1.0" encoding="UTF-8"?> +<xsl:stylesheet version="1.0" +xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> + +<xsl:template name="head" match="/"> + +<head> + <title><xsl:value-of select="//dataset/title" /></title> +</head> +</xsl:template> +</xsl:stylesheet> |
b |
diff -r 000000000000 -r cfe884e53600 emldown_templates/method.xsl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/emldown_templates/method.xsl Tue Oct 15 20:33:48 2024 +0000 |
b |
@@ -0,0 +1,34 @@ +<?xml version="1.0" encoding="UTF-8"?> +<xsl:stylesheet version="1.0" +xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> + +<xsl:template name="method" match="/"> + <h3>Method</h3> + +<div class="container"> + <xsl:for-each select="//dataset/methods"> + <xsl:choose> + <xsl:when test=".//methodStep"> + <h4>Method step</h4> + <p class="editor"><xsl:value-of select="methodStep" /></p> + </xsl:when> + </xsl:choose> + + <xsl:choose> + <xsl:when test=".//sampling"> + <h4>Sampling</h4> + <p class="editor"><xsl:value-of select="sampling" /></p> + </xsl:when> + </xsl:choose> + + <xsl:choose> + <xsl:when test=".//qualityControl"> + <h4>Quality control</h4> + <p class="editor"><xsl:value-of select="qualityControl" /></p> + </xsl:when> + </xsl:choose> + + </xsl:for-each> +</div> +</xsl:template> +</xsl:stylesheet> |
b |
diff -r 000000000000 -r cfe884e53600 emldown_templates/otherentity.xsl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/emldown_templates/otherentity.xsl Tue Oct 15 20:33:48 2024 +0000 |
b |
@@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="UTF-8"?> +<xsl:stylesheet version="1.0" +xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> + + <xsl:template name="otherentity" match="/"> + <xsl:choose> + <xsl:when test=".//otherEntity"> + <h3>Other entities</h3> + <xsl:for-each select=".//otherEntity"> + <br/> + <xsl:value-of select="entityName"/> + <br/> + </xsl:for-each> + </xsl:when> + </xsl:choose> +</xsl:template> +</xsl:stylesheet> + + |
b |
diff -r 000000000000 -r cfe884e53600 emldown_templates/rights.xsl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/emldown_templates/rights.xsl Tue Oct 15 20:33:48 2024 +0000 |
b |
@@ -0,0 +1,16 @@ +<?xml version="1.0" encoding="UTF-8"?> +<xsl:stylesheet version="1.0" +xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> + +<xsl:template name="rights" match="/"> + <xsl:choose> + <xsl:when test=".//intellectualRights"> + <h3>Intellectual Rights</h3> + <p> + <xsl:value-of select="//dataset/intellectualRights" /> + </p> + </xsl:when> +</xsl:choose> +</xsl:template> +</xsl:stylesheet> + |
b |
diff -r 000000000000 -r cfe884e53600 emldown_templates/spatraster2.xsl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/emldown_templates/spatraster2.xsl Tue Oct 15 20:33:48 2024 +0000 |
b |
@@ -0,0 +1,39 @@ +<?xml version="1.0" encoding="UTF-8"?> + <xsl:stylesheet version="1.0" + xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> + + <xsl:template name="spatraster2" match="/"> + <xsl:choose> + <xsl:when test=".//spatialRaster"> + <h3>Spatial Rasters</h3> + <xsl:for-each select=".//spatialRaster"> + <br/> + <h4> + <xsl:value-of select="entityName"/></h4> + <br/> + <tr> + Physical:<xsl:text> </xsl:text><xsl:value-of select="physical/objectName"/> + </tr> + <div class="table-responsive"> + <table class="table table-striped"> + <tr> + <th>attribute name</th> + <th>definition</th> + <th>format, unit or codes</th> + </tr> + <xsl:for-each select="attributeList/attribute"> + <tr> + <td><xsl:value-of select="attributeName"/></td> + <td><xsl:value-of select="attributeDefinition"/></td> + <td><xsl:value-of select="measurementScale/dateTime"/><xsl:value-of select="measurementScale/ratio/unit"/><xsl:value-of select="measurementScale/interval/unit"/><xsl:for-each select="measurementScale/nominal/nonNumericDomain/enumeratedDomain/codeDefinition"><xsl:value-of select="code"/><xsl:text> = </xsl:text><xsl:value-of select="definition"/> <xsl:text> </xsl:text></xsl:for-each></td> + </tr> + </xsl:for-each> + </table> + </div> + </xsl:for-each> + </xsl:when> + </xsl:choose> + </xsl:template> + </xsl:stylesheet> + + |
b |
diff -r 000000000000 -r cfe884e53600 emldown_templates/spatvector2.xsl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/emldown_templates/spatvector2.xsl Tue Oct 15 20:33:48 2024 +0000 |
b |
@@ -0,0 +1,38 @@ +<?xml version="1.0" encoding="UTF-8"?> + <xsl:stylesheet version="1.0" + xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> + + <xsl:template name="spatvector2" match="/"> + <xsl:choose> + <xsl:when test=".//spatialVector"> + <h3>Spatial Vectors</h3> + <xsl:for-each select=".//spatialVector"> + <br/> + <h4><xsl:value-of select="entityName"/></h4> + <br/> + <tr> + Physical:<xsl:text> </xsl:text><xsl:value-of select="physical/objectName"/> + </tr> + <div class="table-responsive"> + <table class="table table-striped"> + <tr> + <th>attribute name</th> + <th>definition</th> + <th>format, unit or codes</th> + </tr> + <xsl:for-each select="attributeList/attribute"> + <tr> + <td><xsl:value-of select="attributeName"/></td> + <td><xsl:value-of select="attributeDefinition"/></td> + <td><xsl:value-of select="measurementScale/dateTime"/><xsl:value-of select="measurementScale/ratio/unit"/><xsl:value-of select="measurementScale/interval/unit"/><xsl:for-each select="measurementScale/nominal/nonNumericDomain/enumeratedDomain/codeDefinition"><xsl:value-of select="code"/><xsl:text> = </xsl:text><xsl:value-of select="definition"/> <xsl:text> </xsl:text></xsl:for-each></td> + </tr> + </xsl:for-each> + </table> + </div> + </xsl:for-each> + </xsl:when> + </xsl:choose> + </xsl:template> + </xsl:stylesheet> + + |
b |
diff -r 000000000000 -r cfe884e53600 emldown_templates/taxonomic_coverage.xsl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/emldown_templates/taxonomic_coverage.xsl Tue Oct 15 20:33:48 2024 +0000 |
b |
@@ -0,0 +1,42 @@ +<?xml version="1.0" encoding="UTF-8"?> +<xsl:stylesheet version="1.0" + xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> + + <xsl:template name="taxonomic_coverage" match="/"> + <xsl:choose> + <xsl:when test=".//dataset/coverage/taxonomicCoverage"> + <h3>Taxonomic coverage</h3> + <div class="table-responsive"> + <table class="table table-striped"> + <tr> + <th>Rank</th> + <th>Value</th> + </tr> + <xsl:for-each select="//dataset/coverage/taxonomicCoverage/taxonomicClassification"> + <xsl:call-template name="loop"/> + </xsl:for-each> + </table> + </div> + </xsl:when> + </xsl:choose> + </xsl:template> + <xsl:template name="loop" match="/"> + <xsl:for-each select="taxonomicClassification"> + <xsl:choose> + <xsl:when test="descendant::taxonomicClassification"> + <xsl:call-template name="loop"/> + </xsl:when> + <xsl:otherwise> + <tr> + <td><xsl:value-of select="taxonRankName"/></td> + <td><xsl:value-of select="taxonRankValue"/></td> + </tr> + </xsl:otherwise> + </xsl:choose> + </xsl:for-each> + </xsl:template> +</xsl:stylesheet> + + + + |
b |
diff -r 000000000000 -r cfe884e53600 emldown_templates/temporal_coverage.xsl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/emldown_templates/temporal_coverage.xsl Tue Oct 15 20:33:48 2024 +0000 |
b |
@@ -0,0 +1,43 @@ +<?xml version="1.0" encoding="UTF-8"?> +<xsl:stylesheet version="1.0" + xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> + + <xsl:template name="temporal_coverage" match="/"> + <xsl:choose> + <xsl:when test=".//temporalCoverage"> + <h3>Temporal coverage</h3> + + <!-- If there is a rangeOfDates node, create a table of the values --> + <xsl:if test="//dataset/coverage/temporalCoverage/rangeOfDates"> + <table class="table table-striped"> + <tr> + <th>Start date</th> + <th>End date</th> + </tr> + <xsl:for-each select="//dataset/coverage/temporalCoverage/rangeOfDates"> + <tr> + <td><xsl:value-of select="beginDate/calendarDate"/></td> + <td><xsl:value-of select="endDate/calendarDate"/></td> + </tr> + </xsl:for-each> + </table> + </xsl:if> + + <!-- If there is a singleDateTime node, create a table of the values --> + <xsl:if test="//dataset/coverage/temporalCoverage/singleDateTime"> + <table class="table table-striped"> + <tr> + <th>Date</th> + </tr> + <xsl:for-each select="//dataset/coverage/temporalCoverage/singleDateTime"> + <tr> + <td><xsl:value-of select="calendarDate"/></td> + </tr> + </xsl:for-each> + </table> + </xsl:if> + </xsl:when> + </xsl:choose> + </xsl:template> +</xsl:stylesheet> + |
b |
diff -r 000000000000 -r cfe884e53600 emldown_templates/units.xsl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/emldown_templates/units.xsl Tue Oct 15 20:33:48 2024 +0000 |
b |
@@ -0,0 +1,30 @@ +<?xml version="1.0" encoding="UTF-8"?> +<xsl:stylesheet version="1.0" +xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> + +<xsl:template name="units" match="/"> + <xsl:choose> + <xsl:when test=".//unitList"> + <h3>Custom units</h3> + <table class="table"> + <tr> + <th>unit name</th> + <th>parent SI unit</th> + <th>unit type</th> + <th>description</th> + </tr> + <xsl:for-each select="//unitList/unit"> + <tr> + <td><xsl:value-of select="@name"/></td> + <td><xsl:value-of select="@parentSI"/></td> + <td><xsl:value-of select="@unitType"/></td> + <td><xsl:value-of select="description"/></td> + </tr> + </xsl:for-each> + </table> + </xsl:when> + </xsl:choose> +</xsl:template> +</xsl:stylesheet> + + |
b |
diff -r 000000000000 -r cfe884e53600 map_geographical_coverage.R --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/map_geographical_coverage.R Tue Oct 15 20:33:48 2024 +0000 |
[ |
@@ -0,0 +1,64 @@ +#From https://github.com/TanguyGen/metaCure/blob/main/R/eml_down.R +#Modified by Seguineau Pauline (2024-10-15) +library(dplyr) +library(xslt) +library(xml2) +library(mapview) +library(leaflet) + +args = commandArgs(trailingOnly=TRUE) +if (length(args)==0) +{ + stop("This tool needs at least one argument") +}else{ + data <- args[1] +} + +#' map_geographical_coverage +#'Make a map from EML +#' @param eml Metadata using EML standard in XML format +#' +#' @return A map +#' @export + +map_geographical_coverage <- function(eml){ + name <- xml2::xml_find_all(eml, "//geographicCoverage/geographicDescription") + name <- unlist(xml2::as_list(name)) + + west <- xml2::xml_find_all(eml, "//geographicCoverage/boundingCoordinates/westBoundingCoordinate") + west <- as.numeric(unlist(xml2::as_list(west))) + + east <- xml2::xml_find_all(eml, "//geographicCoverage/boundingCoordinates/eastBoundingCoordinate") + east <- as.numeric(unlist(xml2::as_list(east))) + + north <- xml2::xml_find_all(eml, "//geographicCoverage/boundingCoordinates/northBoundingCoordinate") + north <- as.numeric(unlist(xml2::as_list(north))) + + south <- xml2::xml_find_all(eml, "//geographicCoverage/boundingCoordinates/southBoundingCoordinate") + south <- as.numeric(unlist(xml2::as_list(south))) + + geo_info <- data.frame(name = name, west = west, east = east, south = south, north = north) + + map <- leaflet(geo_info) %>% + addProviderTiles("CartoDB.Positron") + + for (i in 1:nrow(geo_info)) { + if (geo_info$west[i]==geo_info$east[i] && geo_info$south[i]==geo_info$north[i]){ + map <- map %>% addCircles(lng = geo_info$west[i] , lat= geo_info$south[i], fillColor = "transparent" ) %>% addScaleBar()} + + else if(geo_info$west[i]!=geo_info$east[i] && geo_info$south[i]!=geo_info$north[i]){ + map <- map %>% addRectangles(lng1 = geo_info$west[i], lat1 = geo_info$south[i], + lng2 = geo_info$east[i], lat2 = geo_info$north[i], fillColor = "transparent") %>% addScaleBar()} + } + mapview::mapshot(map, file = "map.png",remove_controls = c("zoomControl", "layersControl", "homeButton","drawToolbar", "easyButton")) +} + +doc <- read_xml(data) + +if (is.na(xml2::xml_find_first(doc, "//geographicCoverage"))){ + mes = "No geographic coverage found, skipping geographic coverage step." + mes +}else{ + map_geographical_coverage(doc) +} + |
b |
diff -r 000000000000 -r cfe884e53600 test-data/EML.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test-data/EML.xml Tue Oct 15 20:33:48 2024 +0000 |
b |
b'@@ -0,0 +1,609 @@\n+<?xml version="1.0" encoding="UTF-8"?>\n+<?xml-stylesheet href="datatable.xsl" type="text/xsl"?>\n+<eml:eml xmlns:eml="https://eml.ecoinformatics.org/eml-2.2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:stmml="http://www.xml-cml.org/schema/stmml-1.2" packageId="def513c0-1dbf-46d4-964d-f2730c7c3ac5" xsi:schemaLocation="https://eml.ecoinformatics.org/eml-2.2.0/eml.xsd https://eml.ecoinformatics.org/eml-2.2.0/eml.xsd" system="unknown">\n+ <dataset id="dataDDU">\n+ <title>Dumont D Urville sea abiotic and physical parameters and Jupyter notebook</title>\n+ <creator>\n+ <individualName>\n+ <givenName>Marc</givenName>\n+ <surName>El\xc3\xa9aume</surName>\n+ </individualName>\n+ <organizationName>Mus\xc3\xa9um National d\'Histoire Naturelle</organizationName>\n+ <electronicMailAddress>marc.eleaume@mnhn.fr</electronicMailAddress>\n+ <userId directory="https://orcid.org">https://orcid.org/0000-0003-1999-1177</userId>\n+ </creator>\n+ <creator>\n+ <individualName>\n+ <givenName>Lena\xc3\xafg</givenName>\n+ <givenName>G.</givenName>\n+ <surName>Hemery</surName>\n+ </individualName>\n+ <organizationName>Pacific Northwest National Laboratory Marine Sciences Laboratory</organizationName>\n+ <electronicMailAddress>lenaighemery@gmail.com,lenaig.hemery@pnnl.gov</electronicMailAddress>\n+ <userId directory="https://orcid.org">https://orcid.org/0000-0001-5337-4514</userId>\n+ </creator>\n+ <creator>\n+ <individualName>\n+ <givenName>Pauline</givenName>\n+ <surName>Seguineau</surName>\n+ </individualName>\n+ <organizationName>Mus\xc3\xa9um National d\'Histoire Naturelle</organizationName>\n+ <electronicMailAddress>pauline.seguineau@mnhn.fr</electronicMailAddress>\n+ <userId directory="https://orcid.org">https://orcid.org/0009-0009-5969-8478</userId>\n+ </creator>\n+ <creator>\n+ <individualName>\n+ <givenName>Yvan</givenName>\n+ <surName>Le Bras</surName>\n+ </individualName>\n+ <organizationName>Mus\xc3\xa9um National d\'Histoire Naturelle</organizationName>\n+ <electronicMailAddress>yvan.le-bras@mnhn.fr</electronicMailAddress>\n+ <userId directory="https://orcid.org">https://orcid.org/0000-0002-8504-068X</userId>\n+ </creator>\n+ <pubDate>2024-05-28</pubDate>\n+ <abstract>\n+ <para>Antarctica and the Southern Ocean play a central role in regulating the Earth climate and its singularity dating back 25 Mya also includes ecological processes that need to be better understood. The Dumont D\xe2\x80\x99Urville sea located off George V and Ad\xc3\xa9lie Land, is one of the better known East-Antarctic marine area displaying a diversity of abiotic and physical parameters that have been shown to drive the distribution of marine organisms. The dataset presented here contribute to our understanding of these interactions, providing essential information for ongoing research and conservation efforts in this Antarctic ecosystem. This dataset presents a table containing abiotic and physical parameters specific to the Dumont D\xe2\x80\x99Urville Sea and a Jupyter notebook to execute a R script in the ecoregionalization Galaxy workflow. The abiotic and physical parameters were first presented in the research article \'Predicting habitat preferences for Anthometrina adriani (Echinodermata) on the East Antarctic continental shelf\' by Hemery et al. (2011). The jupyter notebook is dedicated to the pivot_wider function from the tidyr R package. This notebook is the final part of the data preparation for the ecoregionalization Galaxy workflow.\n+</para>\n+ </abstract>\n+ <keywordSet>\n+ <keyword>Antarctica</keyword>\n+ <keyword>Ocean circulation model</keyword>\n+ <keyword>Southern Ocean</keyword>\n+ <keyword>Dumont D\'Urville sea</keyword>\n+ <keyword>CEAMARC</keyword>\n+ <keyword>Abiotic and physical parameters</keyword>\n+ <keyword>Ecoregionalization</keyword>\n+ <keyword>Tidyr</keyword>\n+ <k'..b'rType>\n+ <bounds>\n+ <minimum exclusive="false">0.01</minimum>\n+ <maximum exclusive="false">0.08</maximum>\n+ </bounds>\n+ </numericDomain>\n+ </ratio>\n+ </measurementScale>\n+ <missingValueCode>\n+ <code>-9999</code>\n+ <codeExplanation>no data available</codeExplanation>\n+ </missingValueCode>\n+ </attribute>\n+ <attribute id="att-standsal">\n+ <attributeName>Standsal</attributeName>\n+ <attributeDefinition>Salinity standard deviation</attributeDefinition>\n+ <storageType>float</storageType>\n+ <measurementScale>\n+ <ratio>\n+ <unit>\n+ <customUnit>PSU</customUnit>\n+ </unit>\n+ <numericDomain>\n+ <numberType>real</numberType>\n+ <bounds>\n+ <minimum exclusive="false">0.00584563100710511</minimum>\n+ <maximum exclusive="false">0.26</maximum>\n+ </bounds>\n+ </numericDomain>\n+ </ratio>\n+ </measurementScale>\n+ <missingValueCode>\n+ <code>-9999</code>\n+ <codeExplanation>no data available</codeExplanation>\n+ </missingValueCode>\n+ </attribute>\n+ <attribute id="att-standthe">\n+ <attributeName>Standtheta</attributeName>\n+ <attributeDefinition>Temperature standard deviation</attributeDefinition>\n+ <storageType>float</storageType>\n+ <measurementScale>\n+ <ratio>\n+ <unit>\n+ <customUnit>degreeCelsius</customUnit>\n+ </unit>\n+ <numericDomain>\n+ <numberType>real</numberType>\n+ <bounds>\n+ <minimum exclusive="false">0.03</minimum>\n+ <maximum exclusive="false">0.52</maximum>\n+ </bounds>\n+ </numericDomain>\n+ </ratio>\n+ </measurementScale>\n+ <missingValueCode>\n+ <code>-9999</code>\n+ <codeExplanation>no data available</codeExplanation>\n+ </missingValueCode>\n+ </attribute>\n+ </attributeList>\n+ <numberOfRecords>155823</numberOfRecords>\n+ </dataTable>\n+ <otherEntity>\n+ <entityName>pivot_wider_jupytool_notebook</entityName>\n+ <entityDescription>This jupyter notebook is dedicated to the pivot_wider function from the tidyr R package. It is the final part of the data preparation for the ecoregionalization Galaxy workflow.</entityDescription>\n+ <physical>\n+ <objectName>pivot_wider_jupytool_notebook.ipynb</objectName>\n+ <size unit="bytes">2794</size>\n+ <authentication method="MD5">2065faa032869e3da5f20b56c7904290</authentication>\n+ <dataFormat>\n+ <externallyDefinedFormat>\n+ <formatName>Unknown</formatName>\n+ </externallyDefinedFormat>\n+ </dataFormat>\n+ </physical>\n+ <entityType>executable</entityType>\n+ </otherEntity>\n+ </dataset>\n+ <additionalMetadata>\n+ <metadata>\n+ <unitList>\n+ <unit id="PSU" multiplierToSI="0.001" name="PSU" parentSI="gramPerGram" unitType="density">\n+ <description>1 PSU = 1g/kg</description>\n+ </unit>\n+ <unit id="degreeCelsius" multiplierToSI="1" name="degreeCelsius" parentSI="dimensionless" unitType="temperature">\n+ <description>0 \xc2\xb0C + 273,15 = 273,15 Kelvin</description>\n+ </unit>\n+ <unit id="meterPerYear" multiplierToSI="0.01" name="meterPerYear" parentSI="centimeterPerYear" unitType="speed">\n+ <description>meter per year</description>\n+ </unit>\n+ </unitList>\n+ </metadata>\n+ </additionalMetadata>\n+ <additionalMetadata>\n+ <metadata>\n+ <emlEditor>\n+ <app>EMLassemblyline</app>\n+ <release>3.5.5</release>\n+ </emlEditor>\n+ </metadata>\n+ </additionalMetadata>\n+</eml:eml>\n' |