This repository has been archived by the owner on Aug 17, 2022. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
228 changed files
with
94 additions
and
53,924 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
xquery version "3.0"; | ||
declare namespace functx = "http://www.functx.com"; | ||
import module namespace xmldb="http://exist-db.org/xquery/xmldb"; | ||
import module namespace config="http://www.digital-archiv.at/ns/thun/config" at "../modules/config.xqm"; | ||
import module namespace app="http://www.digital-archiv.at/ns/thun/templates" at "../modules/app.xql"; | ||
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=json media-type=text/javascript"; | ||
|
||
(:transforms a CMFI document into a JSON which can be processed by visjs into a network graph:) | ||
|
||
let $CMFI:= request:get-parameter("CMFI", "") | ||
let $fallback := if ($CMFI eq "") then $config:app-root||'/data/indices/cmfi.xml' else $CMFI | ||
let $source := doc($fallback) | ||
let $result := | ||
<result> | ||
|
||
{ | ||
|
||
for $corresp in $source//tei:correspDesc[./tei:correspAction[@type='sent'] and ./tei:correspAction[@type='received']] | ||
for $person in $corresp//tei:persName[1] | ||
let $key := data($person/@ref) | ||
group by $key | ||
return | ||
<nodes> | ||
<id>{$key}</id> | ||
<title>{$person[1]/text()}</title> | ||
</nodes> | ||
|
||
} | ||
|
||
{ | ||
for $corresp in $source//tei:correspDesc[./tei:correspAction[@type='sent'] and ./tei:correspAction[@type='received']] | ||
let $sender := $corresp/tei:correspAction[@type='sent']//tei:persName[1] | ||
let $reciver := $corresp/tei:correspAction[@type='received']//tei:persName[1] | ||
let $id := data($corresp/@ref) | ||
return | ||
<edges> | ||
<from>{data($sender/@ref)}</from> | ||
<to>{data($reciver/@ref)}</to> | ||
</edges> | ||
} | ||
|
||
</result> | ||
|
||
return $result |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<div class="templates:surround?with=templates/page.html&at=content"> | ||
<script src="https://cdnjs.cloudflare.com/ajax/libs/handlebars.js/4.0.5/handlebars.min.js"/> | ||
<script src="https://cdnjs.cloudflare.com/ajax/libs/vis/4.21.0/vis.min.js"/> | ||
<link href="https://cdnjs.cloudflare.com/ajax/libs/vis/4.21.0/vis.css" rel="stylesheet" type="text/css"/> | ||
|
||
<style type="text/css"> | ||
#visualization { | ||
width: 100%; | ||
height: 600px; | ||
border: 1px solid lightgray; | ||
} | ||
</style> | ||
|
||
<div id="visualization"> | ||
|
||
</div> | ||
<ul class="menu"> | ||
<li>Click into the timeline hold<code>ctrl</code> to zoom</li> | ||
<li>Data fetched from<a href="../analyze/cmfi2netjson.xql">../analyze/cmfi2netjson.xql</a> | ||
</li> | ||
</ul> | ||
|
||
<script type="text/javascript"> | ||
var datasource = "../analyze/cmfi2netjson.xql" | ||
var container = document.getElementById('visualization'); | ||
$.getJSON( datasource, function( data ) { | ||
var container = document.getElementById('visualization'); | ||
var data = { | ||
nodes: data.nodes, | ||
edges: data.edges | ||
}; | ||
var options = { | ||
"edges": { | ||
"smooth": { | ||
"type": "horizontal", | ||
"roundness": 0 | ||
} | ||
} | ||
}; | ||
var network = new vis.Network(container, data, options); | ||
|
||
}); | ||
|
||
</script> | ||
</div> |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.