Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
grammateus
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Martin Voelkle
grammateus
Commits
5b926c10
Commit
5b926c10
authored
1 month ago
by
Martin Voelkle
Browse files
Options
Downloads
Patches
Plain Diff
run hgv:update on installation
parent
32c3468e
No related branches found
Branches containing commit
Tags
v0.0.6
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
app/database-update-HGV.xq
+12
-9
12 additions, 9 deletions
app/database-update-HGV.xq
app/post-install.xql
+11
-5
11 additions, 5 deletions
app/post-install.xql
with
23 additions
and
14 deletions
app/database-update-HGV.xq
+
12
−
9
View file @
5b926c10
...
...
@@ -5,18 +5,21 @@ import module namespace g="http://grammateus.ch/global" at "modules/global.xql";
import
module
namespace
console
=
"http://exist-db.org/xquery/console"
;
declare
namespace
tei
=
"http://www.tei-c.org/ns/1.0"
;
declare
namespace
hgv
=
"http://grammateus.ch/hgv"
;
for
$doc
in
collection
(
$g:papyri
)
//
tei:TEI
declare
function
hgv:update
()
{
for
$doc
in
collection
(
$g:papyri
)
//
tei:TEI
let
$log
:=
console:log
(
$doc
//
tei:idno
[
@type
eq
"hgv"
])
let
$log
:=
console:log
(
$doc
//
tei:idno
[
@type
eq
"hgv"
])
let
$hgv
:=
gramm:doc-expand-history
(
$doc
)
let
$hgv
:=
gramm:doc-expand-history
(
$doc
)
let
$history
:=
element
{
node-name
(
$hgv
)}
{
attribute
{
'corresp'
}
{
$doc
//
tei:history
/
@corresp
/
string
()}
,
$hgv
/
@
*,
$hgv
/
node
()
}
let
$history
:=
element
{
node-name
(
$hgv
)}
{
attribute
{
'corresp'
}
{
$doc
//
tei:history
/
@corresp
/
string
()}
,
$hgv
/
@
*,
$hgv
/
node
()
}
return
return
update
replace
$doc
//
tei:history
with
$history
};
update
replace
$doc
//
tei:history
with
$history
hgv:
update
()
This diff is collapsed.
Click to expand it.
app/post-install.xql
+
11
−
5
View file @
5b926c10
xquery version "3.0";
import module namespace xdb="http://exist-db.org/xquery/xmldb";
import module namespace hgv="http://grammateus.ch/hgv" at "database-update-HGV.xq";
(: The following external variables are set by the repo:deploy function :)
...
...
@@ -27,9 +28,14 @@ declare function local:mkcol($collection, $path) {
local:mkcol-recursive($collection, tokenize($path, "/"))
};
(: update HGV :)
hgv:update(),
(: store the collection configuration :)
declare variable $system-config := "/db/system/config";
declare variable $data-papyri := "/data/papyri";
local:mkcol($system-config || $target, $data-papyri),
xdb:store-files-from-pattern($system-config || $target || $data-papyri, $dir || $data-papyri, "*.xconf"),
xdb:reindex($target || $data-papyri) or fn:error()
let $system-config := "/db/system/config"
let $data-papyri := "/data/papyri"
return (
local:mkcol($system-config || $target, $data-papyri),
xdb:store-files-from-pattern($system-config || $target || $data-papyri, $dir || $data-papyri, "*.xconf"),
xdb:reindex($target || $data-papyri) or fn:error()
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment