Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • bibliothek-der-neologie/intermediate-format
1 result
Show changes
Commits on Source (27)
Showing with 1057 additions and 205 deletions
expath-pkg.xml
/archive
/build
/.build
/xml
/local
/logs
/test
.DS_Store
.com.apple.timemachine.supported
node_modules
image: docker.gitlab.gwdg.de/fontane-notizbuecher/build:latest
image: docker.gitlab.gwdg.de/sade/build:latest
stages:
- build
- test
- deploy
- release
build-develop:
except:
- master
- tags
stage: build
script:
- ant
artifacts:
paths:
- build/*.xar
.npm-setup: &npm-setup
- curl -sL https://deb.nodesource.com/setup_12.x | bash -
- apt-get install -y nodejs
- npm ci --unsafe-perm --cache .npm --prefer-offline
build-master:
only:
- master
build:
stage: build
script:
- cp master.build.properties local.build.properties
- ant
- ./build
artifacts:
paths:
- build/*.xar
- .build/*.xar
except:
- tags
installation:
except:
......@@ -33,23 +27,21 @@ installation:
stage: test
script:
- ant test
- bash test/eXist-db-*/bin/startup.sh | tee output.log &
- bash local/exist-db/bin/startup.sh | tee output.log &
# wait for eXist
- while [ $(curl --head --silent http://localhost:8080 | grep -c "200 OK") == 0 ]; do sleep 2s; done
# shutdown eXist
- bash test/eXist-db-*/bin/shutdown.sh
- bash local/exist-db/bin/shutdown.sh
artifacts:
paths:
- output.log
- test/eXist-db-*/webapp/WEB-INF/logs/expath-repo.log
- local/exist-db/webapp/WEB-INF/logs/expath-repo.log
upload:
only:
- master
- develop
except:
- tags
stage: deploy
release:
stage: release
before_script:
- *npm-setup
script:
- FILENAME=$(ls build/*.xar)
- curl -u ci:${EXIST_UPLOAD_PW} -X POST -F file=@${FILENAME} https://ci.de.dariah.eu/exist-upload
- npx semantic-release
only:
- master
# [1.3.0](https://gitlab.gwdg.de/bibliothek-der-neologie/intermediate-format/compare/v1.2.0...v1.3.0) (2021-04-12)
### Bug Fixes
* **ifweb:** register library modules ([ea33a54](https://gitlab.gwdg.de/bibliothek-der-neologie/intermediate-format/commit/ea33a547dd1c8228dc17d3d543d56700a0b19d19)), closes [#5](https://gitlab.gwdg.de/bibliothek-der-neologie/intermediate-format/issues/5)
* **semantic-release:** change release branch from `production` to master ([9fb57d9](https://gitlab.gwdg.de/bibliothek-der-neologie/intermediate-format/commit/9fb57d97659502a4597fa2f05060f5039b5ccd9c))
* **whitespaces:** do not purge single spaces ([4aade28](https://gitlab.gwdg.de/bibliothek-der-neologie/intermediate-format/commit/4aade28993c597c23aa1bdf59630001f1e5a3d1e)), closes [#3](https://gitlab.gwdg.de/bibliothek-der-neologie/intermediate-format/issues/3)
### Features
* **semantic-release:** provide helper scripts for semantic-release ([dbf8b19](https://gitlab.gwdg.de/bibliothek-der-neologie/intermediate-format/commit/dbf8b1940a88499f1156380b0c562e35bc309444))
# Changelog
All notable changes to this project will be documented in this file.
......
This diff is collapsed.
......@@ -8,7 +8,7 @@ This repository contains the BdN IntermediateFormat-conversion application to pr
# Setup
- call `ant` to build the app as `build/interformat.{VERSION}.xar`
- call `./build` to build the app as `.build/interformat-{VERSION}.xar`
- integrate it into your eXistDB instance
......
#!/bin/bash
ant
project.abbrev=interformat-dev
project.title=BdN Intermediate Format (Development)
project.version=${env.SR_PV}+${env.CI_COMMIT_SHORT_SHA}
\ No newline at end of file
project.abbrev=interformat
project.title=BdN Intermediate Format
project.version=${env.SR_PV}
\ No newline at end of file
project.name=http://bdn-edition.de/intermediate_format-develop
project.version=1.2
project.title=BdN Intermediate Format
project.abbrev=interformat-develop
project.processorversion=4.6.0
destfile=${build.dir}/${project.abbrev}-${project.version}.xar
test.dir=test
<?xml version="1.0" encoding="UTF-8"?>
<project default="xar" name="interformat" xmlns:xdb="http://exist-db.org/ant">
<property environment="env"/>
<property name="build.dir" value="build"/>
<property file="local.build.properties"/>
<property file="build.properties"/>
<xmlproperty file="expath-pkg.xml.tmpl"/>
<target name="xar" depends="cleanup">
<copy file="expath-pkg.xml.tmpl" tofile="expath-pkg.xml" filtering="true" overwrite="true">
<filterset>
<filter token="project.version" value="${project.version}"/>
<filter token="project.title" value="${project.title}"/>
<filter token="project.abbrev" value="${project.abbrev}"/>
<filter token="project.name" value="${project.name}"/>
<filter token="project.processorversion" value="${project.processorversion}"/>
</filterset>
</copy>
<mkdir dir="${build.dir}"/>
<zip basedir="." destfile="${destfile}"
excludes="${build.dir}/*,${test.dir}/*"/>
</target>
<target name="cleanup">
<delete dir="${test.dir}"/>
</target>
<target name="test" depends="xar">
<get src="https://bintray.com/existdb/releases/download_file?file_path=eXist-db-${project.processorversion}.tar.bz2" dest="${build.dir}/eXist-db-${project.processorversion}.tar.bz2" skipexisting="true" />
<untar src="${build.dir}/eXist-db-${project.processorversion}.tar.bz2" dest="${test.dir}" compression="bzip2" />
<get src="https://ci.de.dariah.eu/exist-repo/find.zip?abbrev=sade_assets&amp;processor=${project.processorversion}" dest="${test.dir}/eXist-db-${project.processorversion}/autodeploy/sade_assets-latest.xar" ignoreerrors="true"/>
<get src="https://ci.de.dariah.eu/exist-repo/find.zip?abbrev=cv&amp;processor=${project.processorversion}" dest="${test.dir}/eXist-db-${project.processorversion}/autodeploy/codeview-latest.xar" ignoreerrors="true"/>
<get src="https://ci.de.dariah.eu/exist-repo/find.zip?abbrev=fontane-lucene-exist-module&amp;processor=${project.processorversion}" dest="${test.dir}/eXist-db-${project.processorversion}/autodeploy/fontane-lucene-latest.xar" ignoreerrors="true"/>
<get src="http://exist-db.org/exist/apps/public-repo/find.zip?abbrev=markdown&amp;processor=${project.processorversion}" dest="${test.dir}/eXist-db-${project.processorversion}/autodeploy/markdown-latest.xar" ignoreerrors="true"/>
<get src="http://exist-db.org/exist/apps/public-repo/find.zip?abbrev=functx&amp;processor=${project.processorversion}" dest="${test.dir}/eXist-db-${project.processorversion}/autodeploy/functx-latest.xar" ignoreerrors="true"/>
<copy file="${destfile}" todir="${test.dir}/eXist-db-${project.processorversion}/autodeploy" />
</target>
<!-- bind environment variables to 'env'//-->
<property environment="env" />
<property file="build.${env.BRANCH}.properties" />
<!-- default values for building outside CI //-->
<property name="project.abbrev" value="interformat-local" />
<property name="project.name" value="http://bdn-edition.de/${project.abbrev}" />
<property name="project.version" value="1.2.0" />
<property name="project.title" value="BdN Intermediate Format (Local)" />
<property name="project.processorversion" value="5.2.0" />
<!-- generic properties //-->
<property name="build.dir" value=".build" />
<property name="test.dir" value="local" />
<xmlproperty file="expath-pkg.xml.tmpl" />
<property name="destfile" value="${build.dir}/${project.abbrev}-${project.version}.xar" />
<target name="xar">
<echo message="Creating expath-pkg.xml for ${project.abbrev}-${project.version}" />
<copy file="expath-pkg.xml.tmpl" tofile="expath-pkg.xml" filtering="true" overwrite="true">
<filterset>
<filter token="project.version" value="${project.version}" />
<filter token="project.title" value="${project.title}" />
<filter token="project.abbrev" value="${project.abbrev}" />
<filter token="project.name" value="${project.name}" />
<filter token="project.processorversion" value="${project.processorversion}" />
</filterset>
</copy>
<echo message="Creating ${project.abbrev}-${project.version}.xar" />
<zip basedir="." destfile="${destfile}" excludes="${build.dir}/**, ${test.dir}/**, .hooks/**, node_modules/**" />
</target>
<target name="cleanup">
<echo message="Deleting ${test.dir}" />
<delete dir="${test.dir}" />
</target>
<target name="test" depends="xar">
<mkdir dir="${build.dir}" />
<!-- this path may be and is subject to change! -->
<echo message="Downloading exist-db" />
<get src="https://bintray.com/existdb/releases/download_file?file_path=exist-distribution-${project.processorversion}-unix.tar.bz2" dest="${build.dir}/exist-db.tar.bz2" skipexisting="true" />
<untar src="${build.dir}/exist-db.tar.bz2" dest="${test.dir}" compression="bzip2" />
<path id="exist_zipped_dir_name">
<dirset dir="${test.dir}">
<include name="exist*" />
</dirset>
</path>
<property name="exist-dir" refid="exist_zipped_dir_name" />
<echo message="Renaming ${exist-dir} to exist-db" />
<move file="${exist-dir}" tofile="${test.dir}/exist-db" />
<echo message="Downloading applets" />
<get src="https://ci.de.dariah.eu/exist-repo/find.zip?abbrev=sade_assets&amp;processor=${project.processorversion}" dest="${test.dir}/eXist-db-${project.processorversion}/autodeploy/sade_assets-latest.xar" ignoreerrors="true" />
<get src="https://ci.de.dariah.eu/exist-repo/find.zip?abbrev=cv&amp;processor=${project.processorversion}" dest="${test.dir}/eXist-db-${project.processorversion}/autodeploy/codeview-latest.xar" ignoreerrors="true" />
<get src="https://ci.de.dariah.eu/exist-repo/find.zip?abbrev=fontane-lucene-exist-module&amp;processor=${project.processorversion}" dest="${test.dir}/eXist-db-${project.processorversion}/autodeploy/fontane-lucene-latest.xar" ignoreerrors="true" />
<get src="http://exist-db.org/exist/apps/public-repo/find.zip?abbrev=markdown&amp;processor=${project.processorversion}" dest="${test.dir}/eXist-db-${project.processorversion}/autodeploy/markdown-latest.xar" ignoreerrors="true" />
<get src="http://exist-db.org/exist/apps/public-repo/find.zip?abbrev=functx&amp;processor=${project.processorversion}" dest="${test.dir}/eXist-db-${project.processorversion}/autodeploy/functx-latest.xar" ignoreerrors="true" />
<echo message="Moving ${project.abbrev}-${project.version}.xar to autodeploy directory" />
<copy file="${destfile}" todir="${test.dir}/exist-db/autodeploy" />
<chmod
dir="${test.dir}/exist-db/bin"
perm="ugo+rx"
includes="**/*.sh"
/>
</target>
</project>
<?xml version="1.0" encoding="UTF-8"?>
<package xmlns="http://expath.org/ns/pkg"
name="http://bdn-edition.de/intermediate_format"
abbrev="interformat-develop"
version="1.0.0"
spec="1.0">
<title>BdN Intermediate Format</title>
<dependency processor="http://exist-db.org" semver-min="4.5.0"/>
<dependency package="http://exist-db.org/apps/shared"/>
<xquery>
<namespace>http://bdn-edition.de/intermediate_format</namespace>
<file>ifweb.xqm</file>
</xquery>
</package>
......@@ -8,7 +8,7 @@
<dependency processor="http://exist-db.org" semver-min="@project.processorversion@"/>
<dependency package="http://exist-db.org/apps/shared"/>
<xquery>
<namespace>http://bdn-edition.de/intermediate_format</namespace>
<file>ifweb.xqm</file>
<namespace>http://bdn-edition.de/intermediate_format/ifweb</namespace>
<file>ifweb.xql</file>
</xquery>
</package>
project.name=http://bdn-edition.de/intermediate_format
project.abbrev=interformat
\ No newline at end of file
xquery version "3.0";
(:
: Copyright (c) 2018 Uwe Sikora
: Copyright (c) 2018–2019 Michelle Weidling
: Copyright (c) 2020 Stefan Hynek
:
: This file is part of intermediate-format.
:
: intermediate-format is free software: you can redistribute it and/or modify
: it under the terms of the GNU General Public License as published by
: the Free Software Foundation, either version 3 of the License, or
: (at your option) any later version.
:
: intermediate-format is distributed in the hope that it will be useful,
: but WITHOUT ANY WARRANTY; without even the implied warranty of
: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
: GNU General Public License for more details.
:
: You should have received a copy of the GNU General Public License
: along with intermediate-format. If not, see <https://www.gnu.org/licenses/>.
:)
(:~
: PRESENTATION Module ("presentation", "http://bdn-edition.de/intermediate_format/presentation")
: *******************************************************************************************
......@@ -39,74 +61,74 @@ declare function analysis:tei-body
)
case element(tei:abbr) return ()
case element(tei:aligned) return (
element{"span"}{
attribute {"class"}{"aligned ble"},
analysis:tei-body($node/node())
}
)
case element(tei:app) return (
element{"span"}{
attribute {"class"}{"app"},
analysis:tei-body($node/node())
}
)
case element(tei:body) return (
element{"div"}{
attribute {"class"}{"body"},
analysis:tei-body($node/node())
}
)
case element(tei:byline) return (
element{"div"}{
attribute {"class"}{"byline"},
analysis:tei-body($node/node())
}
)
case element(tei:choice) return (
analysis:tei-body($node/node())
)
case element(tei:div) return (
element{"div"}{
attribute {"class"}{"div ble"},
analysis:tei-body($node/node())
}
)
case element(tei:docAuthor) return (
element{"div"}{
attribute {"class"}{"docAuthor ble"},
analysis:tei-body($node/node())
}
)
case element(tei:docDate) return (
element{"span"}{
attribute {"class"}{"docDate"},
analysis:tei-body($node/node())
}
)
case element(tei:docEdition) return (
element{"div"}{
attribute {"class"}{"docEdition ble"},
analysis:tei-body($node/node())
}
)
case element(tei:docImprint) return (
element{"div"}{
attribute {"class"}{"docImprint ble"},
analysis:tei-body($node/node())
}
)
case element(tei:expan) return (
element{"span"}{
attribute {"class"}{"expan"},
......@@ -114,7 +136,7 @@ declare function analysis:tei-body
analysis:tei-body($node/node())
}
)
case element(tei:head) return (
let $hierarchies := $node/ancestor::node()[name() = "div" or name() = "list" or name() = "table"]
let $count := count($hierarchies)+1
......@@ -124,55 +146,55 @@ declare function analysis:tei-body
analysis:tei-body($node/node())
}
)
case element(tei:hi) return (
element{"span"}{
attribute {"class"}{"hi"},
analysis:tei-body($node/node())
}
)
case element(tei:index) return ()
case element(tei:item) return (
element{"li"}{
attribute {"class"}{"item ble"},
analysis:tei-body($node/node())
}
)
case element(tei:l) return (
element{"span"}{
attribute {"class"}{"l"},
analysis:tei-body($node/node())
}
)
case element(tei:label) return (
element{"span"}{
attribute {"class"}{"label"},
analysis:tei-body($node/node())
}
)
case element(tei:lb) return (
element{"br"}{}
)
case element(tei:lem) return (
if ($node/parent::tei:app[@type = "structural-variance"]) then (
analysis:tei-body($node/node())
)
)
else( analysis:lem($node) )
)
case element(tei:list) return (
element{"ul"}{
attribute {"class"}{"list ble"},
analysis:tei-body($node/node())
}
)
case element(tei:milestone) return (
analysis:tei-body($node/node())
)
......@@ -183,67 +205,67 @@ declare function analysis:tei-body
analysis:tei-body($node/node())
}
)
case element(tei:p) return (
element{"span"}{
attribute {"class"}{"p ble"},
analysis:tei-body($node/node())
}
)
case element(tei:pb) return (
"|", <sup>{$node/string(@wit), $node/string(@n)}</sup>
)
case element(tei:persName) return (
element{"span"}{
attribute {"class"}{"persName"},
analysis:tei-body($node/node())
}
)
case element(tei:rdg) return (
if ($node/parent::tei:app[@type = "structural-variance"]) then (
analysis:tei-body($node/node())
)
)
else(analysis:rdg($node))
)
case element(tei:rdgMarker) return (
element {"span"}{
attribute {"class"}{"rdgMarker"},
analysis:rdgMarker($node)
}
)
case element(tei:seg) return (
element{"span"}{
attribute {"class"}{"seg"},
analysis:tei-body($node/node())
}
)
case element(tei:text) return (
element{"div"}{
attribute {"class"}{"text"},
analysis:tei-body($node/node())
}
)
case element(tei:TEI) return (
element{"div"}{
attribute {"class"}{"tei"},
analysis:tei-body($node/tei:text)
}
)
case element(tei:titlePage) return (
element{"div"}{
attribute {"class"}{"titlePage"},
analysis:tei-body($node/node())
}
)
case element(tei:titlePart) return (
element{"div"}{
attribute {"class"}{"titlePart ble"},
......@@ -277,98 +299,98 @@ declare function analysis:tei-body
:)
declare function analysis:rdgMarker
( $marker as node() ) as item()* {
let $wit := replace( $marker/string(@wit), " ", "" )
let $type := data($marker/@type)
let $mark := data($marker/@mark)
let $context := data($marker/@context)
return
if ( $marker[@type="pt" and @context="lem"] ) then (
if ($marker[@mark="open"]) then (
<span class="pt open">{$wit}</span>
)
)
else (
<span class="pt closeing">{$wit}</span>
)
)
else if ( $marker[@type="ptl" and @context="lem"] ) then (
if ($marker[@mark="open"]) then (
<span class="ptl open">{$wit}</span>
)
)
else (
<span class="ptl closeing">{$wit}</span>
)
)
else if ( $marker[@type="ptl" and @context="rdg"] ) then (
if ($marker[@mark="open"]) then (
<sup>{$wit}</sup>
)
)
else (
<sup>{$wit}</sup>
)
)
else if ( $marker[@type="pp" and @context="lem"] ) then (
if ($marker[@mark="open"]) then (
<span class="pp open">{$wit}</span>
)
)
else (
<span class="pp closeing">{$wit}</span>
)
)
else if ( $marker[@type="ppl" and @context="lem"] ) then (
(:
if ($marker[@mark="open"]) then (
<span class="ppl open">{concat("~/", $wit)}</span>
)
)
else (
<span class="ppl closeing">{concat($wit, "\~||", $wit)}</span>
) :)
if ($marker[@mark="open"]) then (
<span class="ppl open">{$wit}</span>
)
)
else (
<span class="ppl closeing">{$wit}</span>
)
)
)
else if ( $marker[@type="ppl" and @context="rdg"] ) then (
if ($marker[@mark="open"]) then (
<sup>{$wit}</sup>
)
)
else (
<sup>{$wit}</sup>
)
)
else if ( $marker[@type="v"] ) then (
if ($marker[@mark="open"]) then (
)
)
else (
<sup>{$wit}</sup>
)
)
else if ( $marker[@type="om"] ) then (
if ($marker[@mark="open"]) then (
<span class="om open">{$wit}</span>
)
)
else (
<span class="om closeing">{$wit}</span>
)
)
else (
element {"span"}{
attribute {"style"}{"background:orange"},
......@@ -415,7 +437,7 @@ declare function analysis:rdg
declare function analysis:check-rdg-markers
( $id as xs:string, $reading as node() ) as item()* {
let $open-marker := $reading//tei:rdgMarker[@mark = "open"][@ref = $id]
let $close-marker := $reading//tei:rdgMarker[@mark = "close"][@ref = $id]
let $error := (
......@@ -448,7 +470,7 @@ declare function analysis:lem
where not($open and $close)
return (console:log($lem//tei:rdgMarker[@mark = "open" and @context = "lem"]), $open, $close)
)
return (
element {"span"}{
attribute {"class"}{"reading lem"},
......@@ -459,7 +481,7 @@ declare function analysis:lem
if (data($lem/@type) != "om" or count($lem/node()) gt 0) then ( <span class="reading-content">{ analysis:tei-body( $lem/node() ) }</span> ) else (<div></div>)
}
)
};
......@@ -487,11 +509,11 @@ declare function analysis:tei-header
case text() return (
$node
)
case element(tei:teiHeader) return (
analysis:tei-header($node/node())
)
case element(tei:fileDesc) return (
analysis:tei-header($node/node())
)
......@@ -499,7 +521,7 @@ declare function analysis:tei-header
case element(tei:titleStmt) return (
analysis:tei-header($node/node())
)
case element(tei:title) return (
if ($node[@level]) then (
<div class="value">
......@@ -518,13 +540,13 @@ declare function analysis:tei-header
declare function analysis:marker-report
( $doc ) as item() {
let $markers := analysis:get-rdg-markers($doc)
let $dif := data($markers//open/@count) - data($markers//close/@count)
return
if ($dif = 0) then (
<okay count="{data($markers//open/@count)}" />
)
)
else (
<error dif="{$dif}">{analysis:check-marker($markers)}</error>
)
......@@ -533,7 +555,7 @@ declare function analysis:marker-report
declare function analysis:check-marker
( $markers ) as item()* {
let $open := $markers//open/node()
let $close := $markers//close/node()
let $dif := data($markers//open/@count) - data($markers//close/@count)
......@@ -558,7 +580,7 @@ declare function analysis:check-marker
declare function analysis:get-rdg-markers
( $doc ) as item()* {
let $open := $doc//tei:rdgMarker[@mark = "open"]
let $close := $doc//tei:rdgMarker[@mark = "close"]
return
......
xquery version "3.1";
(:
: Copyright (c) 2018 Uwe Sikora
: Copyright (c) 2018–2019 Michelle Weidling
: Copyright (c) 2020 Stefan Hynek
:
: This file is part of intermediate-format.
:
: intermediate-format is free software: you can redistribute it and/or modify
: it under the terms of the GNU General Public License as published by
: the Free Software Foundation, either version 3 of the License, or
: (at your option) any later version.
:
: intermediate-format is distributed in the hope that it will be useful,
: but WITHOUT ANY WARRANTY; without even the implied warranty of
: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
: GNU General Public License for more details.
:
: You should have received a copy of the GNU General Public License
: along with intermediate-format. If not, see <https://www.gnu.org/licenses/>.
:)
module namespace app="http://bdn-edition.de/intermediate_format/templates";
declare namespace tei = "http://www.tei-c.org/ns/1.0";
......@@ -13,10 +34,10 @@ import module namespace console="http://exist-db.org/xquery/console";
(:~
: This is a sample templating function. It will be called by the templating module if
: it encounters an HTML element with an attribute: data-template="app:test" or class="app:test" (deprecated).
: it encounters an HTML element with an attribute: data-template="app:test" or class="app:test" (deprecated).
: The function has to take 2 default parameters. Additional parameters are automatically mapped to
: any matching request or function parameter.
:
:
: @param $node the HTML node with the attribute which triggered this call
: @param $model a map containing arbitrary data - used to pass information between template calls
:)
......@@ -27,12 +48,12 @@ declare function app:test($node as node(), $model as map(*)) {
(:
declare
declare
%templates:wrap
%templates:default("doc", "/db/apps/interformat/data/samples/samples.xml")
function app:present($node as node(), $model as map(*), $doc) {
<div class="serialisation">
{
{
let $nodes := doc($doc)
let $preprocessed-data := pre:preprocessing($nodes/tei:TEI)
let $intermediate-format := ident:walk($preprocessed-data, ())
......@@ -44,15 +65,15 @@ function app:present($node as node(), $model as map(*), $doc) {
:)
declare
declare
%templates:wrap
%templates:default("doc", "/db/apps/interformat/data/samples/samples.xml")
function app:app-view($node as node(), $model as map(*), $doc) {
<div class="apps">
{
{
for $app at $nr in doc($doc)//tei:app[not(@type='structural-variance')]
let $readings := $app/node()
return
return
<div class="panel panel-info">
<div class="panel-heading">
<ul style="padding-left: 0px; list-style-type: none;">
......@@ -69,21 +90,21 @@ function app:app-view($node as node(), $model as map(*), $doc) {
};
declare
declare
%templates:wrap
%templates:default("doc", "/db/apps/interformat/data/samples/samples.xml")
function app:present($node as node(), $model as map(*), $doc) {
<div class="serialisation">
{
{
let $nodes := doc($doc)/tei:TEI
return
return
analysis:tei-body($nodes//tei:text)
}
</div>
};
declare
declare
%templates:wrap
%templates:default("doc", "/db/apps/interformat/data/samples/samples.xml")
function app:tei-metadata($node as node(), $model as map(*), $doc) {
......@@ -99,7 +120,7 @@ function app:tei-metadata($node as node(), $model as map(*), $doc) {
};
declare
declare
%templates:wrap
%templates:default("collection", "/db/apps/interformat/data/output")
function app:list-output-resources($node as node(), $model as map(*), $collection) {
......@@ -127,7 +148,7 @@ function app:list-output-resources($node as node(), $model as map(*), $collectio
if ($analyse-markers[self::okay]) then (
<span style="color: green">&#10004;</span>,
<span style="padding-left: 5px">{data($analyse-markers/@count)}</span>
)
)
else (
<span style="color: red">&#10007;</span>,
<span style="padding-left: 5px">error</span>,
......@@ -139,12 +160,12 @@ function app:list-output-resources($node as node(), $model as map(*), $collectio
let $wit := data($error/@wit)
let $ref := data($error/@ref)
let $context := data($error/@context)
return
return
<li>missing <strong>{$type}</strong> marker for wit "{$wit}" in reading "{$context}" (<i>{$ref}</i>)</li>
}
</ul>
)
}
</td>
<td>
......
xquery version "3.0";
(:
: Copyright (c) 2018 Uwe Sikora
: Copyright (c) 2018–2019 Michelle Weidling
: Copyright (c) 2020 Stefan Hynek
:
: This file is part of intermediate-format.
:
: intermediate-format is free software: you can redistribute it and/or modify
: it under the terms of the GNU General Public License as published by
: the Free Software Foundation, either version 3 of the License, or
: (at your option) any later version.
:
: intermediate-format is distributed in the hope that it will be useful,
: but WITHOUT ANY WARRANTY; without even the implied warranty of
: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
: GNU General Public License for more details.
:
: You should have received a copy of the GNU General Public License
: along with intermediate-format. If not, see <https://www.gnu.org/licenses/>.
:)
(:~
: A set of helper functions to access the application context from
: within a module.
......
xquery version "3.1";
(:~
(:
: Copyright (c) 2018 Uwe Sikora
: Copyright (c) 2018–2019 Michelle Weidling
: Copyright (c) 2020 Stefan Hynek
:
: This file is part of intermediate-format.
:
: intermediate-format is free software: you can redistribute it and/or modify
: it under the terms of the GNU General Public License as published by
: the Free Software Foundation, either version 3 of the License, or
: (at your option) any later version.
:
: intermediate-format is distributed in the hope that it will be useful,
: but WITHOUT ANY WARRANTY; without even the implied warranty of
: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
: GNU General Public License for more details.
:
: You should have received a copy of the GNU General Public License
: along with intermediate-format. If not, see <https://www.gnu.org/licenses/>.
:)
(:~
: INTERMEDIATEFORMAT Utils Module ("ifutils", "http://bdn.edition.de/intermediate_format/utils")
: *******************************************************************************************
: This modules defines helpfull functions used all over the app
:
:
: @version 1.0 (2018-02-23)
: @status developing
: @author Uwe Sikora
......@@ -16,91 +38,91 @@ import module namespace http = "http://expath.org/ns/http-client";
(:############################# Modules Functions #############################:)
(:~
(:~
: ifutils:exists()
: This function checks if a resource exists in a directory
:
: @param $uri the uri of a resource
: @return xs:boolean ('true' else 'false')
:
:
: @version 1.0 (2018-03-23)
: @status working
: @author Uwe Sikora
:)
declare function ifutils:exists
( $uri as xs:string ) {
let $files := (for $i in collection(replace($uri, '(.+)/.+$', '$1')) return base-uri($i))
return $uri = $files
};
(:~
(:~
: ifutils:get-resource()
: This function gets a resource from the database or from a online source
: This function gets a resource from the database or from a online source
:
: @param $uri the uri of a resource
: @return document-node
:
:
: @version 1.0 (2018-03-23)
: @status developing
: @author Uwe Sikora
:)
declare function ifutils:get-resource
( $uri as xs:string ) {
let $resource := (
if ( ifutils:exists($uri) ) then (
doc($uri)
)
else ()
else ()
)
return $resource
};
(:~
(:~
: ifutils:ls()
: This function lists all documents from a collection
:
: @param $collection the path of a collection
: @return all document-base-uris from the collection
:
:
: @version 1.0 (2018-03-23)
: @status developing
: @author Uwe Sikora
:)
declare function ifutils:ls
( $collection as xs:string ) {
for $doc in collection($collection)
return base-uri($doc)
};
(:~
(:~
: ifutils:request()
: This http wrapper function models a request
: This http wrapper function models a request
:
: @param $uri the uri of a resource
: @param $method the http method
: @param $username the username
: @param $password the password
: @return http-response
:
:
: @version 1.0 (2018-03-23)
: @status developing
: @author Uwe Sikora
:)
declare function ifutils:request
($url as xs:string, $method as xs:string, $username as xs:string?, $password as xs:string? ) {
let $req := <http:request href="{ $url }"
method="{ $method }"
username="{ $username }"
password="{ $password }"
auth-method="basic"
send-authorization="true"/>
return http:send-request($req)
send-authorization="true"/>
return http:send-request($req)
};
\ No newline at end of file
xquery version "3.0";
(:
: Copyright (c) 2018 Uwe Sikora
: Copyright (c) 2018–2019 Michelle Weidling
: Copyright (c) 2020 Stefan Hynek
:
: This file is part of intermediate-format.
:
: intermediate-format is free software: you can redistribute it and/or modify
: it under the terms of the GNU General Public License as published by
: the Free Software Foundation, either version 3 of the License, or
: (at your option) any later version.
:
: intermediate-format is distributed in the hope that it will be useful,
: but WITHOUT ANY WARRANTY; without even the implied warranty of
: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
: GNU General Public License for more details.
:
: You should have received a copy of the GNU General Public License
: along with intermediate-format. If not, see <https://www.gnu.org/licenses/>.
:)
(:~
: IDENTIFICATION Module ("ident", "http://bdn.edition.de/intermediate_format/identification")
: *******************************************************************************************
......
xquery version "3.1";
(:
: Copyright (c) 2018 Uwe Sikora
: Copyright (c) 2018–2019 Michelle Weidling
: Copyright (c) 2020 Stefan Hynek
:
: This file is part of intermediate-format.
:
: intermediate-format is free software: you can redistribute it and/or modify
: it under the terms of the GNU General Public License as published by
: the Free Software Foundation, either version 3 of the License, or
: (at your option) any later version.
:
: intermediate-format is distributed in the hope that it will be useful,
: but WITHOUT ANY WARRANTY; without even the implied warranty of
: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
: GNU General Public License for more details.
:
: You should have received a copy of the GNU General Public License
: along with intermediate-format. If not, see <https://www.gnu.org/licenses/>.
:)
(:~
: ifweb.xql offers a simple interface for creating the website specific BdN
: intermediate format of a given resource.
......@@ -6,16 +29,15 @@
: @version 1.0
:
:)
xquery version "3.1";
module namespace ifweb="http://bdn-edition.de/intermediate_format/ifweb";
declare namespace tei = "http://www.tei-c.org/ns/1.0";
import module namespace console="http://exist-db.org/xquery/console";
import module namespace pre="http://bdn-edition.de/intermediate_format/preprocessing" at "xmldb:exist:///db/apps/interformat/modules/intermediate_format/preprocessing.xqm";
import module namespace ident = "http://bdn-edition.de/intermediate_format/identification" at "xmldb:exist:///db/apps/interformat/modules/intermediate_format/identification.xqm";
import module namespace config = "http://bdn-edition.de/intermediate_format/config" at "xmldb:exist:///db/apps/interformat/modules/config.xqm";
import module namespace pre="http://bdn-edition.de/intermediate_format/preprocessing" at "preprocessing.xqm";
import module namespace ident = "http://bdn-edition.de/intermediate_format/identification" at "identification.xqm";
import module namespace config = "http://bdn-edition.de/intermediate_format/config" at "../config.xqm";
declare option exist:serialize "method=xml media-type=text/xml omit-xml-declaration=no indent=no";
......
xquery version "3.0";
(:
: Copyright (c) 2018 Uwe Sikora
: Copyright (c) 2018–2019 Michelle Weidling
: Copyright (c) 2020 Stefan Hynek
:
: This file is part of intermediate-format.
:
: intermediate-format is free software: you can redistribute it and/or modify
: it under the terms of the GNU General Public License as published by
: the Free Software Foundation, either version 3 of the License, or
: (at your option) any later version.
:
: intermediate-format is distributed in the hope that it will be useful,
: but WITHOUT ANY WARRANTY; without even the implied warranty of
: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
: GNU General Public License for more details.
:
: You should have received a copy of the GNU General Public License
: along with intermediate-format. If not, see <https://www.gnu.org/licenses/>.
:)
(:~
: MARKERSET Module ("markerset", "http://bdn.edition.de/intermediate_format/markerset")
: *******************************************************************************************
......