Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Data availability jungle #27

Draft
wants to merge 6 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 20 additions & 14 deletions .github/workflows/ci-build-manual.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,28 @@
name: Build and push a development version on docker
name: Build and push a development version on docker

on:
workflow_dispatch:

on:
workflow_dispatch:
inputs:
custom_tag:
type: string
description: Docker image tag
required: true
default: "latest-develop"

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Set up JDK 11
uses: actions/setup-java@v4
with:
java-version: '11'
distribution: 'temurin'
cache: 'gradle'
- name: Build with Gradle
run: ./gradlew build -x test
- uses: actions/checkout@v4
- name: Set up JDK 11
uses: actions/setup-java@v4
with:
java-version: '11'
distribution: 'temurin'
cache: 'gradle'
- name: Build with Gradle
run: ./gradlew build -x test

docker-build:
needs: [ build ]
Expand All @@ -42,6 +47,7 @@ jobs:
image: lfoppiano/pub2tei
registry: docker.io
pushImage: true
tags: latest-develop
tags: |
latest-develop, ${{ github.event.inputs.custom_tag}}
- name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}
51 changes: 48 additions & 3 deletions Stylesheets/NLM2TEI-article.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<xsl:when test="//pubfm/categ/@id[string-length() &gt; 0]">
<xsl:value-of select="$codeGenreNature"/>
</xsl:when>
<!-- if no article-type in the orignial metadata -->
<!-- if no article-type in the original metadata -->
<xsl:otherwise>
<xsl:choose>
<xsl:when test="//article/front/article-meta/abstract[string-length()&gt; 0]">
Expand Down Expand Up @@ -1195,11 +1195,12 @@
</group>
</xsl:if>

<xsl:if test="back | bm |front/article-meta/product">
<xsl:if test="back | bm | front/article-meta/product | front/article-meta/custom-meta-group/custom-meta[@id='data-availability']">
<back>
<!-- SG - source des book-reviews, données qualifiés de production chez Cambridge -->
<xsl:apply-templates select="front/article-meta/product"/>
<xsl:apply-templates select="back/* | bm/ack | bm/bibl"/>
<xsl:apply-templates select="front/article-meta/custom-meta-group/custom-meta[@id='data-availability']"/>
</back>
</xsl:if>
</text>
Expand Down Expand Up @@ -1354,7 +1355,7 @@
</xsl:template>

<!-- We do not care about components from <article-meta> which are
not explicitely addressed by means of an XPath in another template-->
not explicitly addressed by means of an XPath in another template-->
<xsl:template match="article-meta"/>

<!-- Building the sourceDesc bibliographical representation -->
Expand Down Expand Up @@ -2252,6 +2253,22 @@

<xsl:template match="ack">
<div type="acknowledgements">
<div>
<xsl:apply-templates/>
</div>
</div>
</xsl:template>

<xsl:template match="front/article-meta/custom-meta-group/custom-meta[@id='data-availability']">
<div type="availability">
<div>
<head>
<xsl:value-of select="meta-name"/>
</head>
<p>
<xsl:apply-templates select="meta-value/node()"/>
</p>
</div>
<xsl:apply-templates/>
</div>
</xsl:template>
Expand Down Expand Up @@ -2520,6 +2537,34 @@
<xsl:apply-templates/>
</div>
</xsl:template>
<xsl:template match="back/notes[@notes-type='data-availability']">
<div type="availability">
<div>
<xsl:apply-templates/>
</div>
</div>
</xsl:template>
<xsl:template match="back/notes[@notes-type='funding-information']">
<div type="funding">
<div>
<xsl:apply-templates/>
</div>
</div>
</xsl:template>
<xsl:template match="back/*/sec[@sec-type='data-availability']">
<div type="availability">
<div>
<xsl:apply-templates/>
</div>
</div>
</xsl:template>
<xsl:template match="back/*/sec[@sec-type='funding-information']">
<div type="funding">
<div>
<xsl:apply-templates/>
</div>
</div>
</xsl:template>
<xsl:template match="fn-group/fn">
<xsl:choose>
<xsl:when test="ancestor::title-group/fn-group/fn">
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ dependencies {
implementation 'javax.xml.bind:jaxb-api:2.3.0'
implementation 'org.apache.opennlp:opennlp-tools:1.9.1'
implementation 'black.ninia:jep:4.0.2'
implementation "org.apache.httpcomponents:httpclient:4.5.3"
implementation "org.apache.httpcomponents:httpclient:4.5.13"
implementation "org.apache.lucene:lucene-analyzers-common:4.5.1"
implementation group: 'org.jruby', name: 'jruby-complete', version: '9.2.13.0'

Expand Down