Skip to content
This repository has been archived by the owner on Feb 22, 2022. It is now read-only.

Commit

Permalink
missing index views added, minor adaptions
Browse files Browse the repository at this point in the history
  • Loading branch information
csae8092 committed Feb 24, 2018
1 parent 1dec88b commit 4955198
Show file tree
Hide file tree
Showing 10 changed files with 279 additions and 48 deletions.
5 changes: 3 additions & 2 deletions analyze/beacon.xql
Expand Up @@ -8,7 +8,7 @@ declare namespace tei = "http://www.tei-c.org/ns/1.0";
declare namespace gefx = "http://gexf.net/data/hello-world.gexf";
declare namespace util = "http://exist-db.org/xquery/util";

declare option exist:serialize "method=text media-type=text";
declare option exist:serialize "method=text media-type=text encoding=utf-8";

let $root := "https://rundbriefe-app.acdh.oeaw.ac.at/"

Expand All @@ -21,7 +21,8 @@ let $items :=
for $x in doc($app:personIndex)//tei:person[starts-with(./tei:idno/text(), 'http://d-nb')]
let $ownId := data($x/@xml:id)
let $url := $root||'pages/hits.html?searchkey='||$ownId
let $entry :=$x/tei:idno/text()||'|'||$url
let $idno := $x/tei:idno[1]/text()
let $entry :=$x/tei:idno[1]/text()||'|'||$url
return $entry
let $beacon := string-join(($prefix, $items), '
')
return $beacon
59 changes: 56 additions & 3 deletions analyze/persDocNetJson.xql
Expand Up @@ -14,7 +14,8 @@ let $result :=
return
<nodes>
<id>{$pos}</id>
<label>{$title}</label>
<title>{$title}</title>
<color>red</color>
</nodes>
}
{
Expand All @@ -28,7 +29,8 @@ let $result :=
return
<nodes>
<id>{$key}</id>
<label>{$person[1]/text()}</label>
<title>{$person[1]/text()}</title>
<color>blue</color>
</nodes>
}
{
Expand All @@ -40,7 +42,58 @@ let $result :=
<from>{$pos}</from>
<to>{$key}</to>
</edges>
}
}

{

for $doc at $pos in collection($app:editions)//tei:TEI
let $title := $doc//tei:titleStmt/tei:title[@type='sub']
let $docID := $pos
for $person in $doc//tei:body//tei:rs[@type="org"]
let $key := data($person/@ref)
group by $key
return
<nodes>
<id>{$key}</id>
<title>{$person[1]/text()}</title>
<color>green</color>
</nodes>
}
{
for $doc at $pos in collection($app:editions)//tei:TEI
for $person in $doc//tei:body//tei:rs[@type="org"]
let $key := data($person/@ref)
return
<edges>
<from>{$pos}</from>
<to>{$key}</to>
</edges>
}
{

for $doc at $pos in collection($app:editions)//tei:TEI
let $title := $doc//tei:titleStmt/tei:title[@type='sub']
let $docID := $pos
for $person in $doc//tei:body//tei:rs[@type="work"]
let $key := data($person/@ref)
group by $key
return
<nodes>
<id>{$key}</id>
<title>{$person[1]/text()}</title>
<color>grey</color>
</nodes>
}
{
for $doc at $pos in collection($app:editions)//tei:TEI
for $person in $doc//tei:body//tei:rs[@type="work"]
let $key := data($person/@ref)
return
<edges>
<from>{$pos}</from>
<to>{$key}</to>
</edges>
}
</result>
return
$result
103 changes: 66 additions & 37 deletions data/editions/Rundbrief_002.xml

Large diffs are not rendered by default.

17 changes: 12 additions & 5 deletions data/indices/listperson.xml
Expand Up @@ -165,8 +165,8 @@
<persName>
<surname>Raimund</surname>
<forename>Ferdinand</forename>
<roleName>Volksdramatiker</roleName>
<roleName>Volksdarsteller</roleName>
<roleName>Dramatiker</roleName>
<roleName>Schauspieler</roleName>
</persName>
<idno type="URL">http://d-nb.info/gnd/118597914</idno>
</person>
Expand All @@ -176,6 +176,14 @@
<forename>Georg Edmund Alfred</forename>
<roleName type="degree" full="abb">Prof.</roleName>
</persName>
<birth when="1872-05-17">
<date>17. Mai 1872</date>
<rs type="place" ref="#gera">Gera</rs>
</birth>
<death when="1945-02-14">
<date>14. Februar 1945</date>
<rs type="place" ref="#dresden">Dresden</rs>
</death>
</person>
<person xml:id="meyer_ruth">
<persName>
Expand Down Expand Up @@ -574,6 +582,7 @@
<person xml:id="lutz_">
<persName>
<surname>Lutz</surname>
<surname type="alt">Lutze</surname>
<forename/>
<roleName type="degree" full="yes">Dozent</roleName>
</persName>
Expand Down Expand Up @@ -794,9 +803,7 @@
<person xml:id="strauß_richard">
<persName>
<surname>Strauß</surname>
<surname>
<alt/>Strauss<alt/>
</surname>
<surname type="alt">Strauss</surname>
<forename>Richard</forename>
<roleName>Komponist</roleName>
<roleName>Dirigent</roleName>
Expand Down
7 changes: 7 additions & 0 deletions data/indices/listplace.xml
Expand Up @@ -223,6 +223,13 @@
</location>
<idno type="URL">https://d-nb.info/gnd/4066009-6</idno>
</place>
<place xml:id="gera" type="city">
<placeName>Gera</placeName>
<location>
<geo decls="LatLng">50.885071 12.080720</geo>
</location>
<idno type="URL">http://d-nb.info/gnd/4020295-1</idno>
</place>
</listPlace>
</body>
</text>
Expand Down
6 changes: 6 additions & 0 deletions data/indices/listwork.xml
Expand Up @@ -273,6 +273,12 @@
</author>
<idno type="URL">https://d-nb.info/02158866X</idno>
</bibl>
<bibl xml:id="nationaltheater_deutsche_klassik">
<title>Das Nationaltheater der deutschen Klassik</title>
<author>
<rs type="person" ref="#kindermann_heinz">Heinz Kindermann</rs>
</author>
</bibl>
</listBibl>
</p>
</body>
Expand Down
54 changes: 54 additions & 0 deletions modules/app.xql
Expand Up @@ -178,6 +178,60 @@ for $title in ($entities, $terms)
</tr>
};

(:~
: creates a basic work-index derived from the '/data/indices/listbibl.xml'
:)
declare function app:listBibl($node as node(), $model as map(*)) {
let $hitHtml := "hits.html?searchkey="
for $item in doc($app:workIndex)//tei:listBibl/tei:bibl
let $author := normalize-space(string-join($item/tei:author//text(), ' '))
let $gnd := $item//tei:idno/text()
let $gnd_link := if ($gnd)
then
<a href="{$gnd}">{$gnd}</a>
else
'no normdata provided'
return
<tr>
<td>
<a href="{concat($hitHtml,data($item/@xml:id))}">{$item//tei:title[1]/text()}</a>
</td>
<td>
{$author}
</td>
<td>
{$gnd_link}
</td>
</tr>
};

(:~
: creates a basic organisation-index derived from the '/data/indices/listorg.xml'
:)
declare function app:listOrg($node as node(), $model as map(*)) {
let $hitHtml := "hits.html?searchkey="
for $item in doc($app:orgIndex)//tei:listOrg/tei:org
let $altnames := normalize-space(string-join($item//tei:orgName[@type='alt'], ' '))
let $gnd := $item//tei:idno/text()
let $gnd_link := if ($gnd)
then
<a href="{$gnd}">{$gnd}</a>
else
'no normdata provided'
return
<tr>
<td>
<a href="{concat($hitHtml,data($item/@xml:id))}">{$item//tei:orgName[1]/text()}</a>
</td>
<td>
{$altnames}
</td>
<td>
{$gnd_link}
</td>
</tr>
};

(:~
: creates a basic person-index derived from the '/data/indices/listperson.xml'
:)
Expand Down
34 changes: 34 additions & 0 deletions pages/bibl.html
@@ -0,0 +1,34 @@
<?xml version="1.0" encoding="UTF-8"?>
<div data-template="templates:surround" data-template-with="templates/datatable.html" data-template-at="datatable">
<div class="panel panel-default">
<div class="panel-heading" style="text-align:center;">
<h1>Works</h1>
</div>
<div class="panel-body">
<table id="myTable" class="table table-striped table-condensed table-hover">
<thead>
<tr>
<th>Title</th>
<th>Author</th>
<th>Normdata</th>
</tr>
</thead>
<tbody id="myTableBody" style="display:none">
<tr data-template="app:listBibl"/>
</tbody>
</table>
</div>
</div>
<script>var table = $('#myTable').DataTable({
keepConditions: true,
dom: 'Bfrtip',
buttons: [
'copy', 'excel', 'pdf'
]
});

$(document).ready(function() {
$("#myTableBody").show({
});
});</script>
</div>
34 changes: 34 additions & 0 deletions pages/orgs.html
@@ -0,0 +1,34 @@
<?xml version="1.0" encoding="UTF-8"?>
<div data-template="templates:surround" data-template-with="templates/datatable.html" data-template-at="datatable">
<div class="panel panel-default">
<div class="panel-heading" style="text-align:center;">
<h1>Organisations</h1>
</div>
<div class="panel-body">
<table id="myTable" class="table table-striped table-condensed table-hover">
<thead>
<tr>
<th>Name</th>
<th>Alternative Name(s)</th>
<th>Normdata</th>
</tr>
</thead>
<tbody id="myTableBody" style="display:none">
<tr data-template="app:listOrg"/>
</tbody>
</table>
</div>
</div>
<script>var table = $('#myTable').DataTable({
keepConditions: true,
dom: 'Bfrtip',
buttons: [
'copy', 'excel', 'pdf'
]
});

$(document).ready(function() {
$("#myTableBody").show({
});
});</script>
</div>
8 changes: 7 additions & 1 deletion templates/page.html
Expand Up @@ -73,6 +73,12 @@
<li>
<a href="places.html">Places</a>
</li>
<li>
<a href="orgs.html">Organizations</a>
</li>
<li>
<a href="bibl.html">Works</a>
</li>
</ul>
</li>
<li class="dropdown">
Expand All @@ -82,7 +88,7 @@
<a href="timeline.html">Timeline</a>
</li>
<li>
<a href="netvis.html">CMFI-Net</a>
<a href="netvis.html">Network</a>
</li>
</ul>
</li>
Expand Down

0 comments on commit 4955198

Please sign in to comment.