Compare commits

..

18 commits

Author SHA1 Message Date
defe7c4497 [add] docbook 2025-03-13 22:10:59 +00:00
828c1f6a64 [add] play.dtd 2025-03-13 21:37:44 +00:00
862e090526 [ADD] samples 2022-09-19 20:18:26 +01:00
c4699b2e50 [add] pom 2022-06-30 12:25:36 +01:00
73396089a4 [add] examples 2022-04-19 22:08:00 +01:00
88598795e8 [mod] notebooks 2022-04-19 15:49:03 +01:00
46fa8347b5 [mod] extensions 2022-04-19 15:39:02 +01:00
9cc1bb47c0 [mod] sparql 2022-04-19 10:42:22 +01:00
f17f6f14e7 [add] sparql notebook 2022-04-19 10:39:49 +01:00
2edb33718a [add] rdf 2022-04-18 12:53:53 +01:00
48174d70fa basex image
All checks were successful
continuous-integration/drone/push Build is passing
2021-05-26 23:03:15 +01:00
5de9e0f057 [mod]
All checks were successful
continuous-integration/drone/push Build is passing
2021-05-26 22:10:47 +01:00
48fb368ab9 [mod]
All checks were successful
continuous-integration/drone/push Build is passing
2021-05-26 21:35:03 +01:00
29e099117e [add] drone 2021-05-26 21:31:31 +01:00
87d24bec72 [add] example docker-compose 2021-05-20 15:29:24 +01:00
303a168bc7 [mod] structure 2021-05-19 22:33:08 +01:00
9aeabc6ea1 [add] html files 2021-05-19 22:06:59 +01:00
9ce2758e97 [add] vsix sample 2021-05-19 17:08:02 +01:00
39 changed files with 41373 additions and 32038 deletions

16
.drone.yml Normal file
View file

@ -0,0 +1,16 @@
# fixme
kind: pipeline
type: docker
name: default
platform:
os: linux
arch: arm
steps:
- name: greeting
image: quodatum/basexhttp:latest
commands:
- echo hello
- echo world
- ls -la /drone/src/

22
.vscode/settings.json vendored Normal file
View file

@ -0,0 +1,22 @@
{
"workbench.colorCustomizations": {
"activityBar.activeBackground": "#65c89b",
"activityBar.activeBorder": "#945bc4",
"activityBar.background": "#65c89b",
"activityBar.foreground": "#15202b",
"activityBar.inactiveForeground": "#15202b99",
"activityBarBadge.background": "#945bc4",
"activityBarBadge.foreground": "#e7e7e7",
"sash.hoverBorder": "#65c89b",
"statusBar.background": "#42b883",
"statusBar.foreground": "#15202b",
"statusBarItem.hoverBackground": "#359268",
"statusBarItem.remoteBackground": "#42b883",
"statusBarItem.remoteForeground": "#15202b",
"titleBar.activeBackground": "#42b883",
"titleBar.activeForeground": "#15202b",
"titleBar.inactiveBackground": "#42b88399",
"titleBar.inactiveForeground": "#15202b99"
},
"peacock.remoteColor": "#42b883"
}

33
.vscode/tasks.json vendored Normal file
View file

@ -0,0 +1,33 @@
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"label": "basex server",
"type": "shell",
"command": "basexserver",
"isBackground": true,
"group": "test",
"presentation": {
"reveal": "always",
"panel": "new"
},
"runOptions": {"runOn": "folderOpen"}
},
{
"type": "xslt",
"label": "xslt: Saxon Transform (New)",
"saxonJar": "${config:XSLT.tasks.saxonJar}",
"xsltFile": "${file}",
"xmlSource": "${file}",
"resultPath": "${workspaceFolder}/xslt-out/result1.xml",
"group": {
"kind": "build"
},
"problemMatcher": [
"$saxon-xslt"
]
}
]
}

0
README.md Normal file → Executable file
View file

View file

@ -1,70 +0,0 @@
(:~
: generate dotml from xqdoc source
: apb Jan 2013
:)
declare namespace doc="http://www.xqdoc.org/1.0";
declare namespace dotml="http://www.martin-loetzsch.de/DOTML";
declare variable $ns-ignore:=("http://www.w3.org/2005/xpath-functions",
"http://www.w3.org/2010/xslt-xquery-serialization",
"http://www.w3.org/2001/XMLSchema",
"http://www.w3.org/2005/xpath-functions/math" );
declare function local:sid($s as xs:string){
"A" || xs:hexBinary(hash:md5($s))
};
declare function local:fid($uri as xs:string ,$name as xs:string,$arity as xs:string){
let $a:=fn:trace(($uri || "*" || $name || "*" || $arity),"fid: ")
return "A" || xs:hexBinary(hash:md5($uri || $name ||$arity))
};
declare function local:foo($dml){
let $moduri:=$dml/doc:xqdoc/doc:module/doc:uri/fn:string()
return
<dotml:graph file-name="graphs/bgcolor" rankdir="LR" label="a test" >
{for $import in $dml//doc:import
let $ns:=$import/doc:uri/fn:string()
where some $call in $dml//doc:invoked satisfies $call/doc:uri=$import/doc:uri
return <dotml:cluster id="{local:sid($ns)}"
label="{$ns}"
bgcolor="#FF8080" >
{for $call in $dml//doc:invoked[doc:uri=$import/doc:uri]
return <dotml:node
id="{local:fid($call/doc:name/@uri,$call/doc:name/@localname,$call/@arity)}"
label="{$call/doc:name/fn:string()}"
fillcolor="lightblue" style="filled"/>
}
</dotml:cluster>
}
<dotml:cluster id="main" rankdir="LR"
label="main"
bgcolor="seashell"
>
{for $f in $dml//doc:function
return <dotml:node id="{local:fid($moduri,$f/doc:name,$f/@arity)}" label="{$f/doc:name}" fillcolor="yellow" style="filled"/>,
for $v in $dml//doc:variable
return <dotml:node id="{generate-id($v)}" label="{$v/doc:name}" fillcolor="green" style="filled"/>
}
</dotml:cluster>
{for $call in $dml//doc:invoked
let $f:=$call/..
where not($call/doc:name/@uri/fn:string()=$ns-ignore)
return <dotml:edge
from="{local:fid($moduri,$f/doc:name,$f/@arity)}"
to="{local:fid($call/doc:name/@uri,$call/doc:name/@localname,$call/@arity)}"/> }
</dotml:graph>
};
let $a:=local:foo(/)
(:
let $req:=<http:request method="POST" >
<http:body media-type="application/x-www-form-urlencoded">data={fn:encode-for-uri(fn:serialize($a))}</http:body>
</http:request>
let $ws:= http:send-request($req,"http://localhost:8984/restxq/graphxq/api/dotml")
return file:write("aa.svg",$ws[2])
:)
return $a

View file

@ -1,120 +0,0 @@
(:~
: graphviz module
: based on http://www.zorba-xquery.com/html/modules/zorba/image/graphviz
:)
module namespace gr="apb.graphviz";
declare default function namespace 'apb.graphviz';
import module namespace proc="http://basex.org/modules/proc";
import module namespace file="http://expath.org/ns/file";
import module namespace xslt="http://basex.org/modules/xslt";
import module namespace random="http://basex.org/modules/random";
declare namespace svg= "http://www.w3.org/2000/svg";
declare namespace xlink="http://www.w3.org/1999/xlink";
declare %private variable $gr:dotpath:=if(fn:environment-variable("DOTPATH"))
then fn:environment-variable("DOTPATH")
else "dot";
(:~
: folder for temp files \=windows
:)
declare %private variable $gr:tmpdir:=if(file:dir-separator()="\")
then fn:environment-variable("TEMP") || "\"
else "/tmp/";
declare %private variable $gr:empty:=
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 300 20" version="1.1"
width="100%" height="100%" preserveAspectRatio="xMidYMid meet">
<text x="150" y="10" text-anchor="middle">Empty.</text>
</svg>;
(:~
:Layout one or more graphs given in the DOT language and render them as SVG.
:)
declare function dot( $dot as xs:string*, $params as xs:string*) as node()*{
let $params:=("-Tsvg")
for $d in $dot
return if(fn:not($d))
then $gr:empty
else let $r:=dot-execute($d,$params)
return dot-svg($r)
};
(:~ run dot command :)
declare %private function dot-execute( $dot as xs:string, $params as xs:string*) as element(result){
let $fname:=$gr:tmpdir || random:uuid()
let $junk:=file:write-text($fname,$dot)
let $r:=proc:execute($gr:dotpath , ($params,$fname))
let $junk:=file:delete($fname)
return if($r/code!="0")
then fn:error(xs:QName('gr:dot1'),$r/error)
else $r
};
(:~ run dot command returning binary :)
declare function dot-executeb( $dot as xs:string, $params as xs:string*) as xs:base64Binary{
let $fname:=$gr:tmpdir || random:uuid()
let $oname:=$fname || ".o"
let $junk:=file:write-text($fname,$dot)
let $r:=proc:execute($gr:dotpath , ($params,"-o"|| $oname,$fname))
let $junk:=file:delete($fname)
return if($r/code!="0")
then fn:error(xs:QName('gr:dot1'),$r/error)
else let $d:=file:read-binary($oname)
(: let $junk:=file:delete($oname) :)
return $d
};
(:~ cleanup dot svg result :)
declare %private function dot-svg( $r as element(result)) as element(svg:svg){
let $s:=fn:parse-xml($r/output) (: o/p has comment nodes :)
let $ver:=$s/comment()[1]/fn:normalize-space()
let $title:=$s/comment()[2]/fn:normalize-space()
let $svg:=$s/*
return <svg xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink" >
{$svg/@* ,
<metadata>
<rdf:RDF
xmlns:rdf = "http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:rdfs = "http://www.w3.org/2000/01/rdf-schema#"
xmlns:dc = "http://purl.org/dc/elements/1.1/" >
<rdf:Description about="https://github.com/apb2006/graphxq"
dc:title="{$title}"
dc:description="A graph visualization"
dc:date="{fn:current-dateTime()}"
dc:format="image/svg+xml">
<dc:creator>
<rdf:Bag>
<rdf:li>{$ver}</rdf:li>
<rdf:li resource="https://github.com/apb2006/graphxq"/>
</rdf:Bag>
</dc:creator>
</rdf:Description>
</rdf:RDF>
</metadata>,
$svg/*}
</svg>
};
(:~
: set svg to autosize 100%
:)
declare function autosize($svg as node()) as node(){
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
width="100%" height="100%" preserveAspectRatio="xMidYMid meet">
{$svg/@* except ($svg/@width,$svg/@height,$svg/@preserveAspectRatio),
$svg/*}
</svg>
};
(:~
: set svg to autosize 100%
:)
declare function autosize-old($svg as node()) as node(){
xslt:transform($svg , fn:resolve-uri("dotml/dotpatch.xsl"))
};

23
docker/docker-compose.yml Normal file
View file

@ -0,0 +1,23 @@
---
version: "2.1"
services:
code-server:
image: ghcr.io/linuxserver/code-server:version-v3.10.0
container_name: code-server
environment:
- PUID=1000
- PGID=1000
- TZ=Europe/London
- SUDO_PASSWORD=password #optional
- SUDO_PASSWORD_HASH= #optional
volumes:
- ./config:/config
- /var/run/docker.sock:/var/run/docker.sock:ro
ports:
- 8443:8443
restart: unless-stopped
networks:
default:
external:
name: swag_default

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
extensions/xslt-xpath-0.2.8.vsix Executable file

Binary file not shown.

211
html/app.css Executable file
View file

@ -0,0 +1,211 @@
/* app.css */
/* page scroll bar off */
html {
overflow-y: auto
}
pre {
white-space: pre-wrap;
/* css-3 */
white-space: -moz-pre-wrap;
/* Mozilla, since 1999 */
white-space: -pre-wrap;
/* Opera 4-6 */
white-space: -o-pre-wrap;
/* Opera 7 */
word-wrap: break-word;
/* Internet Explorer 5.5+ */
}
/* http://tobiasahlin.com/spinkit/ */
.spinner {
margin: 100px auto;
width: 100px;
height: 80px;
text-align: center;
font-size: 16px;
}
.spinner > div {
background-color: #0000a0;
height: 100%;
width: 16px;
display: inline-block;
-webkit-animation: sk-stretchdelay 1.2s infinite ease-in-out;
animation: sk-stretchdelay 1.2s infinite ease-in-out;
}
.spinner .rect2 {
-webkit-animation-delay: -1.1s;
animation-delay: -1.1s;
}
.spinner .rect3 {
-webkit-animation-delay: -1.0s;
animation-delay: -1.0s;
}
.spinner .rect4 {
-webkit-animation-delay: -0.9s;
animation-delay: -0.9s;
}
.spinner .rect5 {
-webkit-animation-delay: -0.8s;
animation-delay: -0.8s;
}
@-webkit-keyframes sk-stretchdelay {
0%,
40%,
100% {
-webkit-transform: scaleY(0.4)
}
20% {
-webkit-transform: scaleY(1.0)
}
}
@keyframes sk-stretchdelay {
0%,
40%,
100% {
transform: scaleY(0.4);
-webkit-transform: scaleY(0.4);
}
20% {
transform: scaleY(1.0);
-webkit-transform: scaleY(1.0);
}
}
.fade-enter-active,
.fade-leave-active {
transition-property: opacity;
transition-duration: .25s;
}
.fade-enter-active {
transition-delay: .25s;
}
.fade-enter,
.fade-leave-active {
opacity: 0
}
.child-view {
position: absolute;
transition: all .5s cubic-bezier(.55, 0, .1, 1);
}
.slide-left-enter,
.slide-right-leave-active {
opacity: 0;
-webkit-transform: translate(30px, 0);
transform: translate(30px, 0);
}
.slide-left-leave-active,
.slide-right-enter {
opacity: 0;
-webkit-transform: translate(-30px, 0);
transform: translate(-30px, 0);
}
td.vtop {
vertical-align: top;
}
/*
.ace_editor { height: 200px; }
*/
.acewrap {
top: 0px;
left: 0px;
bottom: 0px;
right: 0px;
height: 100%;
}
.ace_gutter-cell.ace_breakpoint {
border-radius: 20px 0px 0px 20px;
box-shadow: 0px 0px 1px 1px red inset;
}
.ace_editor_wrapper {
height: 100%
}
.ace_editor {
height: 100%;
}
.multiline-ellipsis {
display: block;
display: -webkit-box;
max-height: 110px;
margin: 0 auto;
line-height: 1.4;
-webkit-line-clamp: 3;
-webkit-box-orient: vertical;
overflow: hidden;
text-overflow: ellipsis;
}
.qd-active {
background-color: green;
}
.selcard {
background-color: green;
border: thick double #32a1ce;
}
.contain {
object-fit: contain;
}
.canvas {
overflow: hidden;
}
.canvas .wrapper.outer > .background {
fill: #000000;
}
.canvas .wrapper.inner > .background {
fill: #CCCCCC;
cursor: move;
}
.canvas .background {
fill: #F6F6F6;
stroke: #333333;
cursor: move;
}
.canvas .panCanvas {
cursor: move;
}
.canvas .minimap .frame {
pointer-events: all;
}
.canvas .minimap .frame .background {
stroke: #111111;
stroke-width: 4px;
fill-opacity: 0.1;
fill: #000000;
fill: url(#minimapGradient_qwpyza);
filter: url(#minimapDropShadow_qwpyza);
cursor: move;
}

86
html/app.html Executable file
View file

@ -0,0 +1,86 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="description" content="Vue poc" />
<meta name="author" content="andy bunce." />
<title>Vue Router Test</title>
<link rel="shortcut icon" href="/vue-poc/ui/icon.png" />
<link rel="stylesheet" href="//fonts.googleapis.com/css?family=Roboto:300,400,500,700,400italic" />
<link rel="stylesheet" href="//fonts.googleapis.com/icon?family=Material+Icons" />
<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/@mdi/font@4.x/css/materialdesignicons.min.css">
<link rel="stylesheet" href="//unpkg.com/vuetify@2.4.11/dist/vuetify.min.css" type="text/css" />
<link rel="stylesheet" href="//unpkg.com/@riophae/vue-treeselect@0.0.29/dist/vue-treeselect.min.css" />
<link rel="stylesheet" href="/vue-poc/ui/prism/prism.css" type="text/css" />
<link rel="stylesheet" href="//unpkg.com/leaflet@1.6.0/dist/leaflet.css" />
<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/@koumoul/vjsf@1.14.0/dist/main.css">
<link href="/vue-poc/ui/app.css" rel="stylesheet" type="text/css" />
<link href="/vue-poc/ui/svg/d3-svg.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/vis/4.20.1/vis-timeline-graph2d.min.css" />
</head>
<body>
<div id="app">
<h1>vue-poc</h1>
<div class="spinner">
<div class="rect1"></div>
<div class="rect2"></div>
<div class="rect3"></div>
<div class="rect4"></div>
<div class="rect5"></div>
<span>Loading, please wait...</span>
</div>
</div>
<script src="//cdnjs.cloudflare.com/ajax/libs/vue/2.6.11/vue.js" crossorigin="anonymous"></script>
<script src="//unpkg.com/vue-router@3.4.9/dist/vue-router.js" crossorigin="anonymous"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/axios/0.21.1/axios.js" crossorigin="anonymous"></script>
<script src="//unpkg.com/vuex@3.6.0/dist/vuex.js" crossorigin="anonymous"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/qs/6.4.0/qs.js" crossorigin="anonymous"></script>
<script src="//unpkg.com/vuetify@2.4.11/dist/vuetify.min.js" crossorigin="anonymous"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/ace/1.4.12/ace.js" crossorigin="anonymous"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/ace/1.4.12/ext-language_tools.js" crossorigin="anonymous"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/ace/1.4.12/ext-linking.js" crossorigin="anonymous"
charset="utf-8"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/js-beautify/1.9.0/beautify.js" crossorigin="anonymous"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/js-beautify/1.9.0/beautify-css.js" crossorigin="anonymous"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/js-beautify/1.9.0/beautify-html.js" crossorigin="anonymous"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/localforage/1.7.1/localforage.js" crossorigin="anonymous"></script>
<script src="//cdn.jsdelivr.net/npm/luxon@1.25.0/build/global/luxon.min.js" crossorigin="anonymous"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/moment.js/2.24.0/moment.js" crossorigin="anonymous"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/vis/4.20.1/vis-timeline-graph2d.min.js"
crossorigin="anonymous"></script>
<script src="//unpkg.com/vue-clip@1.0.0/dist/vue-clip.js" crossorigin="anonymous"></script>
<script src="//unpkg.com/@riophae/vue-treeselect@0.0.29/dist/vue-treeselect.min.js"
crossorigin="anonymous"></script>
<script src="/vue-poc/ui/prism/prism.js" crossorigin="anonymous"></script>
<script src="//unpkg.com/vue-prism-component@1.1.1/dist/vue-prism-component.min.js"
crossorigin="anonymous"></script>
<script src="//cdn.jsdelivr.net/npm/vue-markdown@2.2.4/dist/vue-markdown.js" crossorigin="anonymous"></script>
<script src="//unpkg.com/leaflet@1.6.0/dist/leaflet.js" crossorigin="anonymous"></script>
<script src="//unpkg.com/vue2-leaflet@2.5.2/dist/vue2-leaflet.min.js" crossorigin="anonymous"></script>
<script src="//cdn.jsdelivr.net/npm/@koumoul/vjsf@1.16.0/dist/main.js" crossorigin="anonymous"></script>
<script src="//unpkg.com/vue-native-websocket@2.0.8/dist/build.js" crossorigin="anonymous"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/d3/5.16.0/d3.min.js" crossorigin="anonymous"></script>
<script src="/vue-poc/ui/svg/d3-svg.js"></script>
<script src="/vue-poc/ui/state.js"></script>
<script src="/vue-poc/ui/app-gen.js" type="module"></script>
<script>
if ('serviceWorker' in navigator && false) {
navigator.serviceWorker
.register('/vue-poc/ui/serviceworker.js')
.then(function () { console.log("Service Worker Registered"); });
}
</script>
</body>
</html>

64
html/state.js Executable file
View file

@ -0,0 +1,64 @@
//
const store = new Vuex.Store({
state: {
count: 92,
edit: {
currentId: "?",
query: "todo edit/query"
},
"features": {
"serviceworker": false
},
"images": {
thumbtask: `<thumbnail>
<size width="200" height="200"/>
<filters>
<colorize color="green" alpha=".5"/>
<caption position="CENTER">Some Text here</caption>
<rotate angle="15"/>
<canvas height="300" width="300" position="TOP_LEFT" color="yellow"/>
</filters>
<output format="gif"/>
</thumbnail>
`
},
"settings": {
"ace": {
theme: "github",
themeDark: "chaos",
keybinding: "ace",
fontsize: 16,
enableSnippets: true,
enableBasicAutocompletion: true,
enableLiveAutocompletion: true
},
"dark": false
},
"markdown": {
"toc": true
}
},
mutations: {
increment(state) {
state.count++
},
initialiseStore(state) {
// Check if the ID exists
var s = localStorage.getItem('store')
if (s) {
// Replace the state object with the stored item
this.replaceState(
Object.assign(state, JSON.parse(s))
);
}
//console.log("initialiseStore: ",s)
}
}
})
store.subscribe((mutation, state) => {
// Store the state object as a JSON string
localStorage.setItem('store', JSON.stringify(state));
//console.log("store subscribe")
});

2
localhosts.txt Normal file
View file

@ -0,0 +1,2 @@
192.168.1.1
omv.local

14
markdown/mermaid.md Normal file
View file

@ -0,0 +1,14 @@
# mermaid
```mermaid
flowchart TB
_ -- ./ --> util
_ --> json_hal
_ --> api_problem
_ --> cors
_ -- data/ --> types
_ -- data/ --> data_changes
data_changes -- ../--> util
```

BIN
media/icon.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 904 B

BIN
media/quodatum.gif Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4 KiB

61
media/vue-poc.svg Executable file
View file

@ -0,0 +1,61 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!--Created with Inkscape (http://www.inkscape.org/)-->
<svg xmlns="http://www.w3.org/2000/svg" xmlns:cc="http://creativecommons.org/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" xmlns:osb="http://www.openswatchbook.org/uri/2009/osb" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:svg="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" id="svg8" width="1000px" height="700px" version="1.1" viewBox="0 0 214.95504 163.40485" inkscape:version="0.92.2 (5c3e80d, 2017-08-06)" sodipodi:docname="vue-poc.svg">
<defs id="defs2">
<linearGradient id="linearGradient6340" inkscape:collect="always">
<stop id="stop6336" offset="0" style="stop-color:#aae418;stop-opacity:1"/>
<stop id="stop6338" offset="1" style="stop-color:#aae418;stop-opacity:0"/>
</linearGradient>
<linearGradient id="linearGradient6306" osb:paint="solid">
<stop id="stop6304" offset="0" style="stop-color:#aae418;stop-opacity:1"/>
</linearGradient>
<style id="style4792">
.cls-1{fill:#1697f6;}.cls-2{fill:#7bc6ff;}.cls-3{fill:#1867c0;}.cls-4{fill:#aeddff;}
</style>
<linearGradient id="linearGradient6342" x1="-1.6441965" x2="213.31087" y1="90.247025" y2="90.247025" gradientTransform="matrix(1.0000254,0,0,0.959177,-0.00268836,0.20964985)" gradientUnits="userSpaceOnUse" inkscape:collect="always" xlink:href="#linearGradient6340"/>
</defs>
<sodipodi:namedview id="base" bordercolor="#666666" borderopacity="1.0" fit-margin-bottom="0" fit-margin-left="0" fit-margin-right="0" fit-margin-top="0" pagecolor="#ffffff" showgrid="false" inkscape:current-layer="layer1" inkscape:cx="256.09065" inkscape:cy="432.63847" inkscape:document-units="mm" inkscape:pageopacity="0.0" inkscape:pageshadow="2" inkscape:window-height="715" inkscape:window-maximized="1" inkscape:window-width="1366" inkscape:window-x="-8" inkscape:window-y="-8" inkscape:zoom="0.49497475"/>
<metadata id="metadata5">
<rdf:RDF>
<cc:Work rdf:about="">
<dc:format>
image/svg+xml
</dc:format>
<dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage"/>
<dc:title/>
</cc:Work>
</rdf:RDF>
</metadata>
<g id="layer1" style="display:inline" transform="translate(1.6441965,-5.0700892)" inkscape:groupmode="layer" inkscape:label="Layer 1">
<g id="g10" transform="matrix(0.34330717,-0.00308857,-0.00306839,-0.34556479,4.721666,171.7052)">
<g id="g12" transform="translate(178.0626,235.0086)">
<path id="path14" d="M 0,0 -22.669,-39.264 -45.338,0 h -75.491 L -22.669,-170.017 75.491,0 Z" style="fill:#4dba87;fill-opacity:1;fill-rule:nonzero;stroke:none" inkscape:connector-curvature="0"/>
</g>
<g id="g16" transform="translate(178.0626,235.0086)">
<path id="path18" d="M 0,0 -22.669,-39.264 -45.338,0 H -81.565 L -22.669,-102.01 36.227,0 Z" style="fill:#435466;fill-opacity:1;fill-rule:nonzero;stroke:none" inkscape:connector-curvature="0"/>
</g>
</g>
<rect id="rect4844" width="214.69592" height="163.14572" x="-1.5146316" y="5.1996541" rx="2.4568441" ry="2.4568441" style="opacity:1;fill:url(#linearGradient6342);fill-opacity:1;fill-rule:nonzero;stroke:#004a00;stroke-width:0.25912979;stroke-opacity:1"/>
<g id="g4816" transform="matrix(0.26458333,0,0,0.26458333,5.5302908,20.580775)">
<polyline id="polyline4798" points="131.67 3 71.55 3 131.67 145.1" class="cls-1" style="fill:#1697f6"/>
<polyline id="polyline4800" points="131.67 186.81 131.67 297.1 3 45.89 70.4 45.89" class="cls-2" style="fill:#7bc6ff"/>
<polyline id="polyline4802" points="131.67 3 191.79 3 131.67 145.1" class="cls-3" style="fill:#1867c0"/>
<polyline id="polyline4804" points="131.67 186.81 131.67 297.1 260.34 45.89 192.94 45.89" class="cls-4" style="fill:#aeddff"/>
</g>
<g id="g10-9" transform="matrix(1.9498076,0,0,-2.4535824,77.384423,332.0942)">
<g id="g12-4" transform="scale(0.1)">
<path id="path14-9" d="m 493.23291,1111.6167 c 3.47269,-0.9434 8.24049,-2.2912 12.31024,-4.7334 0,0 61.05511,66.7922 74.71754,80.5117 9.59708,9.6366 20.31366,18.0527 32.04878,25.0463 8.9078,5.3123 18.18878,9.4303 28.91852,9.1185 7.12976,-0.2106 20.70878,-0.1755 27.84731,-0.1844 5.58879,-0.01 13.06098,7.5338 13.06537,13.162 0.0176,16.1517 0.0132,32.3034 0,48.4595 -0.005,5.7337 -7.19122,12.9469 -12.9161,12.9513 H 418.50089 c -5.70732,0 -13.48112,-7.2615 -13.49473,-12.7317 -0.0413,-16.4459 -0.0294,-32.8961 0,-49.342 -0.0207,-6.8576 3.6079,-12.4156 11.59112,-12.4507 l 44.10482,-0.04 c 13.16985,0.07 13.92497,-10.8351 9.06058,-16.279 l -95.97553,-98.7581 -77.37804,94.6664 c -8.29843,11.1117 -2.19511,20.3707 4.93903,20.5771 l 39.32384,-0.08 c 9.07683,0 13.69361,6.3614 13.72785,13.2717 0.009,15.9585 0.007,31.9169 0.002,47.8755 -0.004,6.1376 -7.07926,13.2936 -13.17424,13.2849 -13.01794,-0.014 -26.03765,-0.08 -39.05779,-0.075 -80.17857,0.017 -166.10703,0.3599 -246.287348,0.3863 -6.124037,0 -14.37462,-7.1605 -14.378045,-13.263 -0.0069,-15.5678 0.133771,-31.456 0,-47.0238 0,-8.7234 5.60959,-14.2551 13.856704,-14.2595 8.61414,0 22.976554,-0.3951 31.591089,-0.4434 11.260094,-0.061 21.92707,-2.5859 32.50975,-6.5371 14.83945,-5.5405 22.95789,-14.9005 31.92716,-25.2966 10.53658,-12.2136 85.00081,-105.019 90.98251,-112.4666 l 5.82234,14.3144 c 0,0 -89.29534,111.898 -99.007,120.5073 -9.01185,7.9903 -20.59945,12.6395 -32.17915,16.3318 -11.93752,3.8062 -24.315807,4.7678 -36.764779,4.9697 -4.30595,0.07 -14.364171,0.2985 -18.672097,0.3205 -4.539467,0.017 -7.197627,2.6956 -7.202765,7.2746 -0.0137,12.2356 -0.01198,24.4757 0,36.7113 0.0034,4.7765 2.639283,7.4326 7.394838,7.4238 8.015442,-0.014 21.77973,-0.4127 29.793679,-0.4127 75.578904,-0.01 151.158244,0 226.737164,-0.014 5.87018,0 11.7439,-0.2854 17.60706,-0.1186 4.19664,0.1186 6.68503,-2.8756 6.71224,-6.0585 0.11503,-12.9205 0.0878,-25.8453 0.0224,-38.7659 -0.0189,-3.477 -1.79737,-6.6555 -6.41371,-6.6555 l -35.90252,-0.022 c -14.54093,0 -26.40995,-19.1371 -15.78249,-34.6215 11.09941,-13.917 88.59202,-110.793 88.59202,-110.793 18.58654,19.5757 104.14578,105.5116 107.49992,113.0452 6.65122,8.2712 5.15414,29.9811 -13.82048,32.5757 l -43.18638,-0.1801 c -4.03859,0.049 -6.85975,2.7659 -6.87512,6.7566 -0.0448,12.6308 -0.0396,25.2571 -0.002,37.8879 0.0101,3.9248 2.86902,6.7126 6.82024,6.7653 0,0 166.88103,0.061 239.22345,0 5.42195,0 7.61707,-2.1425 7.61707,-7.5337 0.005,-12.0424 0.009,-24.0848 0,-36.1273 -0.005,-4.8029 -2.58586,-7.3581 -7.33171,-7.4282 -6.54585,-0.1011 -19.55414,0.07 -26.05609,-0.5181 -5.01804,-0.461 -10.08878,-1.4664 -14.87853,-3.0204 -9.16244,-2.9811 -17.3239,-8.0299 -25.16926,-13.5747 -19.06683,-13.4737 -35.04731,-30.2883 -50.86974,-47.239 -13.47805,-14.4378 -50.42633,-54.4298 -52.86731,-57.1549" style="fill:#4f4c4c;fill-opacity:1;fill-rule:nonzero;stroke:none" inkscape:connector-curvature="0"/>
<path id="path16" d="M 197.92543,904.7538 102.12902,805.18442 C 93.926295,795.97369 84.6642,791.83369 73.870349,791.1273 l -13.133147,-0.062 c -6.271506,-0.45614 -7.423944,-4.68878 -7.425656,-9.64492 -0.0086,-12.13477 -0.0086,-22.55303 0.0017,-34.69135 0.0034,-4.78124 2.608418,-7.42399 7.341627,-7.42913 82.601937,-0.12173 234.101297,-0.0566 239.858227,0.0926 4.21507,0 6.58537,2.59471 6.58537,6.70372 0.0396,12.62708 0.0413,25.2525 0.002,37.88279 0.0443,4.15361 -2.32903,6.7759 -6.58712,6.8018 l -43.41555,0.003 c -20.96825,0 -31.59438,23.0198 -19.94444,39.92575 0,0 76.5992,89.34143 82.80393,96.0348 1.47161,-4.3301 4.284,-12.2378 4.284,-12.2378 L 249.5694,827.15258 c -11.40936,-13.45873 -0.10317,-24.96599 9.77181,-24.96599 l 46.66828,0.0619 c 6.6354,0.14049 12.85858,-5.63707 12.85858,-12.67507 0.0536,-16.64034 0.0979,-32.85667 -0.0891,-49.49674 0,-6.54931 -5.93165,-12.48474 -12.39891,-12.48474 0,0 -241.394685,-0.0172 -251.574561,-0.0274 -7.362217,0 -13.117562,4.94418 -13.117562,13.36107 -0.01198,16.05353 -0.123454,32.0435 -0.114893,48.09906 0.0034,5.94395 4.702345,12.2839 13.042094,13.13122 10.269041,0.0927 -2.188272,-0.14093 8.077389,0.0927 19.591545,-0.91756 24.557787,3.78834 36.785491,16.80453 l 83.114322,85.70061 h 15.33336" style="fill:#4f4c4c;fill-opacity:1;fill-rule:nonzero;stroke:none" inkscape:connector-curvature="0"/>
<path id="path18-1" d="m 371.78607,904.7538 h 13.52721 l 67.4776,-80.35329 c 9.65327,-12.3976 5.40219,-34.0055 -17.4442,-33.91814 l -47.87252,0.15762 c -3.33877,-0.13171 -5.87721,-1.43518 -5.88907,-6.77064 0.079,1.23498 0.11503,-38.19494 0.11503,-38.19494 0.0101,-4.35077 1.93258,-6.99694 6.32809,-7.0055 l 275.62514,0.21095 c 4.3244,-0.0138 6.69513,2.15394 6.69951,6.94892 0.009,12.1435 -0.0395,25.1873 -0.0483,37.32584 0,5.59405 -1.47073,7.65175 -6.18145,7.72726 -14.14976,0.0259 -29.73512,-0.0755 -35.03415,1.25035 -14.27706,3.75409 -18.72438,7.98629 -27.92633,19.47116 0,0 -87.83998,105.84963 -88.5029,106.71715 4.10926,2.05112 6.82244,4.2515 10.22927,7.31765 3.06438,-3.76594 88.09899,-107.89328 88.09899,-107.89328 8.98683,-10.28986 18.00878,-15.23722 32.9356,-15.51864 h 25.41512 c 9.87366,-0.009 12.74488,-5.45707 12.75804,-15.59414 0.0439,-16.54212 0.079,-30.85498 -0.0526,-47.39728 0.005,-7.35023 -4.61853,-12.06975 -11.66926,-12.0646 0,0 -278.86383,0.0617 -286.69427,0.0652 -9.30863,0 -14.3214,4.59261 -14.3214,14.14653 -0.0118,16.15131 -0.0136,34.08097 0,50.23223 0,6.28683 5.02507,10.67707 12.16229,10.61209 l 46.91939,0.0342 c 16.91253,0.26737 17.4442,9.47502 10.00493,20.0116 l -66.65969,82.48169" style="fill:#4f4c4c;fill-opacity:1;fill-rule:nonzero;stroke:none" inkscape:connector-curvature="0"/>
<g id="g20" transform="matrix(4.3902427,0,0,4.3902427,23.248656,727.17025)">
<g id="text22" style="font-variant:normal;font-weight:600;font-size:70.24369812px;font-family:'Metric Semibold';-inkscape-font-specification:Metric-Semibold;writing-mode:lr-tb;fill:#aa1818;fill-opacity:1;fill-rule:nonzero;stroke:none" transform="matrix(1,0,0,-1,0,42.7367)">
<path id="path3029" d="m 29.501973,-22.266966 c 1.619943,-0.582407 2.963334,-1.665316 4.030179,-3.24873 1.066778,-1.583363 1.61994,-3.544305 1.659488,-5.882833 -0.04394,-3.869173 -1.343428,-6.7901 -3.898476,-8.762789 -2.555111,-1.97261 -6.102368,-2.961861 -10.641783,-2.967757 H 4.1443248 V 0 H 22.056237 c 4.536488,-0.01317042 8.072038,-1.0580311 10.606662,-3.1345852 2.534559,-2.0765478 3.822342,-5.1057651 3.863354,-9.0876608 -0.03808,-2.394095 -0.699538,-4.48967 -1.98436,-6.286731 -1.284891,-1.797024 -2.964863,-3.049686 -5.03992,-3.757989 z m -16.717785,-3.160925 v -10.114963 h 7.305251 c 2.146772,-0.0073 3.771134,0.393688 4.873092,1.202909 1.101909,0.809289 1.655071,2.070731 1.659488,3.78433 -0.0044,1.719514 -0.557579,3.00437 -1.659487,3.854572 -1.101957,0.850256 -2.72632,1.27464 -4.873093,1.273152 z m 0,7.024279 h 8.499379 c 2.113113,0.01465 3.716988,0.494643 4.81163,1.439976 1.094589,0.945367 1.644824,2.268272 1.650707,3.968719 -0.0059,1.669741 -0.556116,2.983866 -1.650707,3.9423764 -1.094643,0.958529 -2.698518,1.4473014 -4.81163,1.4663189 h -8.499379 z" inkscape:connector-curvature="0"/>
<path id="path3031" d="M 55.112494,-43.129075 38.605438,0 h 8.991077 l 3.793111,-10.395933 H 67.545469 L 71.408823,0 h 9.131563 L 64.033329,-43.129075 Z m 4.355054,10.81739 5.268209,14.32953 H 54.199338 Z" inkscape:connector-curvature="0"/>
<path id="path3033" d="m 84.087721,-2.9501973 c 1.57168,1.0126685 3.556037,1.8672879 5.953078,2.56386089 2.397024,0.69657371 5.048686,1.0594948 7.954996,1.08876435 4.676975,-0.001463 8.546175,-1.06973824 11.607625,-3.20482804 3.06138,-2.1350847 4.64769,-5.3282017 4.75895,-9.5793609 0.0131,-3.175544 -0.83856,-5.797939 -2.55509,-7.867192 -1.71658,-2.069214 -4.37703,-3.70821 -7.98133,-4.916996 l -6.743312,-2.318012 c -1.520479,-0.459478 -2.694118,-1.033127 -3.52092,-1.72095 -0.826827,-0.687764 -1.245357,-1.682869 -1.25559,-2.985317 0.04243,-1.469214 0.695101,-2.552123 1.958019,-3.248732 1.262892,-0.696538 2.881401,-1.041897 4.855532,-1.036079 2.481891,0.01613 4.770631,0.422956 6.866231,1.220468 2.09555,0.797583 4.0682,1.889272 5.91796,3.275071 v -8.780349 c -1.75171,-1.062382 -3.70973,-1.887735 -5.87406,-2.476061 -2.16437,-0.58824 -4.56141,-0.886771 -7.191102,-0.895593 -4.325797,0.01468 -7.931591,1.074172 -10.81739,3.178486 -2.885813,2.104395 -4.384325,5.165807 -4.495539,9.184245 0.04244,3.526801 1.0112,6.25456 2.906295,8.183285 1.895085,1.928771 4.461872,3.392162 7.700367,4.390175 l 6.321849,2.107284 c 1.62435,0.557567 2.87115,1.198531 3.74043,1.922895 0.86923,0.724394 1.30825,1.769255 1.31705,3.134586 -0.0468,1.671203 -0.77854,2.8770362 -2.19508,3.6175033 -1.41659,0.7404833 -3.23705,1.1034044 -5.461381,1.0887643 -2.514122,-0.019017 -4.949203,-0.455107 -7.305251,-1.3082725 -2.356066,-0.8531489 -4.510176,-2.0092271 -6.462337,-3.4682371 z" inkscape:connector-curvature="0"/>
<path id="path3035" d="M 120.78993,-43.129075 V 0 h 29.29125 V -7.9374357 H 129.64052 V -18.192884 h 18.5441 v -7.656464 h -18.5441 v -9.412534 h 20.44066 v -7.867193 z" inkscape:connector-curvature="0"/>
</g>
</g>
</g>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 13 KiB

View file

@ -0,0 +1 @@
[{"kind":1,"language":"markdown","value":"# XPath Notebook\nDate: 2022-04-19     Time: 15:41:29"},{"kind":2,"language":"xpath","value":"2+3"}]

View file

@ -0,0 +1 @@
[{"kind":1,"language":"markdown","value":"Simple test to http://dbtune.org/bbc/peel/sparql"},{"kind":2,"language":"sparql","value":"PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>\nPREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>\nSELECT * WHERE {\n ?sub ?pred ?obj .\n} \nLIMIT 10"},{"kind":1,"language":"markdown","value":""}]

0
process.gv Normal file → Executable file
View file

7
semantic/sparql.rq Normal file
View file

@ -0,0 +1,7 @@
@prefix card: <http://www.w3.org/People/Berners-Lee/card#> .
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
card:i foaf:name "Timothy Berners-Lee" .
<http://bblfish.net/people/henry/card#me> foaf:name "Henry Story" .
<http://www.cambridgesemantics.com/people/about/lee> foaf:name "Lee Feigenbaum" .
card:amy foaf:name "Amy van der Hiel" .

14
test.txt Normal file
View file

@ -0,0 +1,14 @@
The government is considering using its new Brexit regulatory freedom to allow pesticides banned in the EU on food imported to the UK.
Brussels announced it was banning 10 pesticides on imported fruit and veg in February last year and the UK was at the time widely expected in to follow suit. But over a year later the Department for Environment, Food, and Rural Affairs (Defra) says no decision has yet been made on whether Britain will follow the EU or continue to permit the chemicals on food.
All the pesticides have not been allowed for use by domestic farmers in either the UK or EU for some years, but were still allowed for imports from outside the bloc subject to “maximum residue levels” checked by border staff.
But last year Brussels regulation 2021/155 cut the maximum residue levels (MRLs) for all the chemicals to the lowest possible level allowed under EU law effectively banning their use on food destined for the continent.
The change was announced by the European Commission in February 2021 and took effect in September last year, but the UK has not yet decided whether to follow suit for most of the chemicals.
&lt;foo @aa="14"&gt;&lt;/foo&gt;

569
xml/basex.pom Normal file
View file

@ -0,0 +1,569 @@
<?xml version="1.0"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<!-- Artifact information -->
<groupId>org.basex</groupId>
<artifactId>basex-parent</artifactId>
<version>9.7.3-SNAPSHOT</version>
<packaging>pom</packaging>
<distributionManagement>
<snapshotRepository>
<id>ossrh</id>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
</snapshotRepository>
<repository>
<id>ossrh</id>
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
</repository>
</distributionManagement>
<modules>
<module>basex-core</module>
<module>basex-api</module>
</modules>
<properties>
<compileSource>1.8</compileSource>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<project.lib.directory>lib</project.lib.directory>
<jettyVersion>9.4.46.v20220331</jettyVersion>
<junit.version>5.8.2</junit.version>
</properties>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<version>${junit.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.platform</groupId>
<artifactId>junit-platform-commons</artifactId>
<version>1.8.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>jp.sourceforge.igo</groupId>
<artifactId>igo</artifactId>
<version>0.4.3</version>
<scope>runtime</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.apache</groupId>
<artifactId>lucene-stemmers</artifactId>
<version>3.4.0</version>
<scope>runtime</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.ccil.cowan.tagsoup</groupId>
<artifactId>tagsoup</artifactId>
<version>1.2.1</version>
<scope>runtime</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>xml-resolver</groupId>
<artifactId>xml-resolver</artifactId>
<version>1.2</version>
<scope>runtime</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>jline</groupId>
<artifactId>jline</artifactId>
<version>2.14.6</version>
<scope>runtime</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.relaxng</groupId>
<artifactId>jing</artifactId>
<version>20181222</version>
<scope>runtime</scope>
<optional>true</optional>
<exclusions>
<exclusion>
<groupId>*</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>net.xqj</groupId>
<artifactId>basex-xqj</artifactId>
<version>9.0</version>
</dependency>
<dependency>
<groupId>org.xmldb</groupId>
<artifactId>xmldb-api</artifactId>
<version>1.0</version>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-server</artifactId>
<version>${jettyVersion}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-servlet</artifactId>
<version>${jettyVersion}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-servlets</artifactId>
<version>${jettyVersion}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-webapp</artifactId>
<version>${jettyVersion}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.eclipse.jetty.websocket</groupId>
<artifactId>websocket-server</artifactId>
<version>${jettyVersion}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.ettrema</groupId>
<artifactId>milton-api</artifactId>
<version>1.8.1.4</version>
<exclusions>
<exclusion>
<artifactId>commons-logging</artifactId>
<groupId>commons-logging</groupId>
</exclusion>
<exclusion>
<artifactId>commons-beanutils</artifactId>
<groupId>commons-beanutils</groupId>
</exclusion>
<exclusion>
<artifactId>slf4j-log4j12</artifactId>
<groupId>org.slf4j</groupId>
</exclusion>
<exclusion>
<artifactId>log4j</artifactId>
<groupId>log4j</groupId>
</exclusion>
<exclusion>
<artifactId>slf4j-api</artifactId>
<groupId>org.slf4j</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>commons-fileupload</groupId>
<artifactId>commons-fileupload</artifactId>
<version>1.4</version>
</dependency>
<dependency>
<groupId>com.vividsolutions</groupId>
<artifactId>jts</artifactId>
<version>1.13</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>1.7.36</version>
</dependency>
</dependencies>
</dependencyManagement>
<!-- Project Information -->
<name>BaseX</name>
<description>BaseX XML database and XPath/XQuery processor</description>
<url>https://basex.org</url>
<inceptionYear>2005</inceptionYear>
<licenses>
<license>
<name>BSD License</name>
<url>https://www.opensource.org/licenses/bsd-license.php</url>
</license>
</licenses>
<organization>
<name>BaseX Team</name>
<url>https://basex.org</url>
</organization>
<!-- Environment Settings -->
<issueManagement>
<system>GitHub Tracker</system>
<url>https://github.com/BaseXdb/basex/issues</url>
</issueManagement>
<mailingLists>
<mailingList>
<name>BaseX Talk</name>
<post>basex-talk@mailman.uni-konstanz.de</post>
<archive>https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk</archive>
</mailingList>
</mailingLists>
<developers>
<developer>
<name>Christian Grün</name>
<email>cg@basex.org</email>
<organization>BaseX Team</organization>
<organizationUrl>https://basex.org</organizationUrl>
</developer>
</developers>
<scm>
<connection>scm:git:git://github.com/BaseXdb/basex.git</connection>
<developerConnection>scm:git:git@github.com:BaseXdb/basex.git</developerConnection>
<url>https://github.com/BaseXdb/basex</url>
<tag>HEAD</tag>
</scm>
<repositories>
<repository>
<id>basex</id>
<name>BaseX Maven Repository</name>
<url>https://files.basex.org/maven</url>
</repository>
<repository>
<id>central</id>
<name>Central Maven Repository</name>
<url>https://repo1.maven.org/maven2/</url>
</repository>
</repositories>
<profiles>
<profile>
<id>only-eclipse</id>
<activation>
<property>
<name>m2e.version</name>
</property>
</activation>
<build>
<pluginManagement>
<plugins>
<!-- Eclipse m2e plugin does not "support plugin execution" -->
<!-- we need to tell it to ignore the goals -->
<plugin>
<groupId>org.eclipse.m2e</groupId>
<artifactId>lifecycle-mapping</artifactId>
<version>1.0.0</version>
<inherited>true</inherited>
<configuration>
<lifecycleMappingMetadata>
<pluginExecutions>
<pluginExecution>
<pluginExecutionFilter>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<versionRange>[2.0,)</versionRange>
<goals>
<goal>copy-dependencies</goal>
</goals>
</pluginExecutionFilter>
<action>
<ignore />
</action>
</pluginExecution>
<pluginExecution>
<pluginExecutionFilter>
<groupId>org.codehaus.mojo</groupId>
<artifactId>javacc-maven-plugin</artifactId>
<versionRange>[2.6,)</versionRange>
<goals>
<goal>javacc</goal>
</goals>
</pluginExecutionFilter>
<action>
<ignore />
</action>
</pluginExecution>
</pluginExecutions>
</lifecycleMappingMetadata>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
</profile>
<profile>
<id>ossrh</id>
<build>
<plugins>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<version>3.3.0</version>
<inherited>true</inherited>
<executions>
<execution>
<id>create-executable-jar</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
<configuration>
<descriptorRefs>
<descriptorRef>src</descriptorRef>
</descriptorRefs>
<appendAssemblyId>false</appendAssemblyId>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>3.0.1</version>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
<configuration>
<!-- This is necessary for gpg to not try to use the pinentry programs -->
<gpgArguments>
<arg>--pinentry-mode</arg>
<arg>loopback</arg>
</gpgArguments>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.3.2</version>
<inherited>true</inherited>
<configuration>
<doclint>none</doclint>
</configuration>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
<!-- Build Settings -->
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>javacc-maven-plugin</artifactId>
<version>2.6</version>
<inherited>true</inherited>
<executions>
<execution>
<id>generate-all-parsers</id>
<phase>generate-sources</phase>
<goals>
<goal>javacc</goal>
</goals>
</execution>
</executions>
<configuration>
<outputDirectory>src/main/java</outputDirectory>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.10.1</version>
<inherited>true</inherited>
<configuration>
<source>${compileSource}</source>
<target>${compileSource}</target>
<!-- https://jira.codehaus.org/browse/MCOMPILER-205 -->
<useIncrementalCompilation>false</useIncrementalCompilation>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>buildnumber-maven-plugin</artifactId>
<version>1.4</version>
<executions>
<execution>
<phase>validate</phase>
<goals>
<goal>create</goal>
</goals>
</execution>
</executions>
<configuration>
<doCheck>false</doCheck>
<doUpdate>false</doUpdate>
<shortRevisionLength>7</shortRevisionLength>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.2.2</version>
<inherited>true</inherited>
<configuration>
<archive>
<manifest>
<addDefaultImplementationEntries>true</addDefaultImplementationEntries>
</manifest>
<manifestEntries>
<Implementation-Build>${buildNumber}</Implementation-Build>
</manifestEntries>
</archive>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.22.2</version>
<inherited>true</inherited>
<configuration>
<!-- <skipTests>true</skipTests> -->
<!--<forkMode>always</forkMode>-->
<forkCount>1</forkCount>
<reuseForks>false</reuseForks>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>3.2.1</version>
<inherited>true</inherited>
<configuration>
<outputDirectory>target</outputDirectory>
</configuration>
<executions>
<execution>
<id>attach-sources</id>
<phase>package</phase>
<goals>
<goal>jar-no-fork</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<version>2.5.3</version>
<configuration>
<tagNameFormat>@{project.version}</tagNameFormat>
<releaseProfiles>ossrh</releaseProfiles>
<scmCommentPrefix>Release: </scmCommentPrefix>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>3.3.0</version>
<inherited>true</inherited>
<configuration>
<outputDirectory>${project.lib.directory}</outputDirectory>
<includeScope>runtime</includeScope>
</configuration>
<executions>
<execution>
<id>copy-libs</id>
<phase>package</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>3.0.0</version>
<inherited>true</inherited>
<executions>
<execution>
<goals>
<goal>java</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<version>2.8.2</version>
<inherited>true</inherited>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>3.1.2</version>
<inherited>true</inherited>
<executions>
<execution>
<phase>test</phase>
<goals>
<goal>check</goal>
</goals>
</execution>
</executions>
<configuration>
<configLocation>.settings/checkstyle.xml</configLocation>
<failsOnError>true</failsOnError>
<includeTestSourceDirectory>true</includeTestSourceDirectory>
<linkXRef>false</linkXRef>
<consoleOutput>true</consoleOutput>
<violationSeverity>warning</violationSeverity>
</configuration>
</plugin>
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<version>1.6.12</version>
<extensions>true</extensions>
<configuration>
<serverId>ossrh</serverId>
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
<autoReleaseAfterClose>true</autoReleaseAfterClose>
</configuration>
</plugin>
</plugins>
</pluginManagement>
<extensions>
<extension>
<groupId>org.apache.maven.wagon</groupId>
<artifactId>wagon-ssh</artifactId>
<version>3.5.1</version>
</extension>
</extensions>
</build>
</project>

978
xml/docbook/stdf_manual.xml Normal file
View file

@ -0,0 +1,978 @@
<?xml version="1.0" encoding="UTF-8"?>
<article version="5.1" xml:lang="en" xmlns="http://docbook.org/ns/docbook"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:xila="http://www.w3.org/2001/XInclude/local-attributes"
xmlns:xi="http://www.w3.org/2001/XInclude"
xmlns:trans="http://docbook.org/ns/transclusion"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns:m="http://www.w3.org/1998/Math/MathML"
xmlns:html="http://www.w3.org/1999/xhtml"
xmlns:db="http://docbook.org/ns/docbook">
<!-- This work is licensed under a Creative
Commons Attribution-NonCommercial-ShareAlike 4.0 International
License https://creativecommons.org/licenses/by-nc-sa/4.0/ -->
<!-- Copyright (c) 2018-2022 Eduard Tibet-->
<info>
<title>Segmented Telemetry Data Filter</title>
<subtitle>Administrator's manual</subtitle>
<author>
<personname><firstname>Eduard</firstname><surname>Tibet</surname></personname>
</author>
<pubdate>28.03.2022</pubdate>
</info>
<section xml:id="intro">
<title xml:id="intro_title">Introduction</title>
<section>
<title>Scope of this document</title>
<para xml:id="testpara">This is a complete administrator's manual of the
Segmented Telemetry Data Filter (STDF) software. It describes in a brief
what STDF is proposed for, its overall design, what each component is
indented for. Also this manual includes a full information about an
installation process and usage of STDF. The theory and principles of
data filtering, explanation of the Erlang language syntax (used for data
filtering) are completely out of scope of this manual.</para>
</section>
<section>
<title>Document structure</title>
<para>This document includes a following parts:</para>
<itemizedlist>
<listitem>
<para><xref endterm="intro_title" linkend="intro"/> - current
section.</para>
</listitem>
<listitem>
<para><xref endterm="description_title" linkend="description"/> - a
description of the software's overall design, features and
functionality.</para>
</listitem>
<listitem>
<para><xref endterm="installation_title" linkend="installation"/> -
the information about system requirements and installation of the
software.</para>
</listitem>
<listitem>
<para><xref endterm="auth_rules_title" linkend="auth_rules"/> -
current section describes, how to create and mastering filtering
rules required to be deployed into the one of the software
component.</para>
</listitem>
<listitem>
<para><xref endterm="using_data_title" linkend="using_data"/> -
section about customizing and fine tuning final data.</para>
</listitem>
<listitem>
<para><xref endterm="trouble_title" linkend="trouble"/> - list of
possible issues and ways to resolve them.</para>
</listitem>
</itemizedlist>
</section>
</section>
<section xml:id="description">
<title xml:id="description_title">Description of the STDF</title>
<section>
<title>Brief description of the STDF</title>
<para>STDF is a data handling software designed to help in capturing
high speed telemetry data. The purpose of the STDF is to automatically
and linearly scale processing capacity for such data. The STDF segments
data into smaller chunks and sends them through a load balancer to
several servers that filter received data. That way it is possible
to:</para>
<itemizedlist>
<listitem>
<para>avoid using a single high-powered processing unit working with
data;</para>
</listitem>
<listitem>
<para>reduce power of any unit, used for processing;</para>
</listitem>
<listitem>
<para>deploy the system with a great flexibility and scalability,
based on various initial requirements and/or conditions.</para>
</listitem>
</itemizedlist>
</section>
<section>
<title>Overall design of STDF</title>
<para>The system contains of several parts:</para>
<itemizedlist>
<listitem>
<para>coordinator component (node) - is used for smart management of
the whole system;</para>
</listitem>
<listitem>
<para>loadbalancer component (node) - is used for receiving raw data
from external sources (i.e. sensors) and transfer it further based
on coordinator's directives;</para>
</listitem>
<listitem>
<para>filter component(s)/node(s) - are used to process data
received from the loadbalancer. Processing is based on the current
workload. If it exceeds the maximum, defined by a coordinator, data
chunks automatically migrate to other filter nodes, which free
resources are enough to manipulate the data. The number of filter
components within installation varies and based on current
performance needs.</para>
</listitem>
</itemizedlist>
<para>In the heart of the STDF is a proprietary protocol that was
developed by Teliota company. This protocol can be used between
components to coordinate data manipulation, calculation on individual
filters, running on each server, and data migration between
filters.</para>
<para>The typical workflow includes the following steps:</para>
<procedure>
<step>
<para>loadbalancer component receives all-raw data from external
sources (i.e. sensors) and transmit it further to filters based on
coordinator's current workload rules and internal logic;</para>
</step>
<step>
<para>filter component receives an independent dataset from the
loadbalancer and asks a cluster's coordinator to supply a filtering
rules;</para>
</step>
<step>
<para>coordinator provides a rules to the filter and then rules are
applied on-the-fly onto the incoming data, received from the
loadbalancer;</para>
</step>
</procedure>
<para>Each filtering component can talk to a coordinator component about
the data it is processing or wishes to process. The coordinator
component steers the loadbalancer component what data a loadbalancer
should provide to which filter node.</para>
<figure>
<title>Overall design of STDF</title>
<mediaobject>
<imageobject>
<imagedata contentdepth="100%" fileref="img/stdf_manual.svg"
scalefit="1" width="100%"/>
</imageobject>
</mediaobject>
</figure>
<para>If a filter component gets overloaded by the data, its tasks can
be offloaded to another filter node. Due to the nature of the workflow,
the algorithm assumes that:</para>
<itemizedlist>
<listitem>
<para>a sufficient number of such redundant servers (filter modes)
exists in the pool as during an overload situation;</para>
</listitem>
<listitem>
<para>the offloaded data is similar to the original data and can be
filtered with same rules.</para>
</listitem>
</itemizedlist>
<para>An offloaded filter node is, therefore, not "independent". It have
to process the same data and instructions as its peer until the moment
an overload situation is resolved.</para>
<para>New processing (filter) nodes can be added into the processing
cluster on the fly by:</para>
<procedure>
<step>
<para>adding new server hardware;</para>
</step>
<step>
<para>installing the filter component software onto it;</para>
</step>
<step>
<para>configuring the coordinator server address.</para>
</step>
</procedure>
<para>The filter node will register itself to the coordinator and the
coordinator will instruct the loadbalancer to forward traffic to this
new node.</para>
<para>Telemetry data and filter operations are defined with a definition
file that in turn is written in a proprietary filter rule language. The
language defines in details:</para>
<itemizedlist>
<listitem>
<para>what the incoming data is stands for;</para>
</listitem>
<listitem>
<para>how the data may be aggregated and filtered out in case of
outliers or unwanted values are found.</para>
</listitem>
</itemizedlist>
<para>The coordinator reads the filter language files and runs them on
its own logic processing engine. This engine is connected to all the
filtering nodes, which receives processing instructions in the form of a
proprietary, compressed command protocol. The protocol is
bidirectional:</para>
<itemizedlist>
<listitem>
<para>filter nodes and the loadbalancer inform the coordinator about
data they receive and their status.</para>
</listitem>
<listitem>
<para>coordinator instructs:</para>
<itemizedlist>
<listitem>
<para>loadbalancer - where to deploy initial raw-based
data;</para>
</listitem>
<listitem>
<para>filters - what data is and how that data should be
manipulated over.</para>
</listitem>
</itemizedlist>
</listitem>
</itemizedlist>
</section>
</section>
<section xml:id="installation">
<title xml:id="installation_title">Installation of the software</title>
<section>
<title>System requirements</title>
<para>To successfully install and run STDF, your base hardware/software
installation have to be complied with the following requirements:</para>
<itemizedlist>
<listitem>
<para>Two (2) dedicated hardware servers for a coordinator and a
loadbalancer components;</para>
</listitem>
<listitem>
<para>no other application software (i.e. MTA, DB, etc.), except of
an operating system and system utilities should be installed on the
above servers;</para>
</listitem>
<listitem>
<para>required amount of servers that will be used as hosts for a
filtering components (nodes);</para>
</listitem>
<listitem>
<para>network connectivity with all sensors that gather information
for your application - your firewall rules should allow sensors to
access the STDF cluster (loadbalancer component);</para>
</listitem>
<listitem>
<para>network connectivity within all components of the STDF
installation and data receivers beyond the STDF deployment (DB or
third-party application servers);</para>
</listitem>
<listitem>
<para>any recent Linux distribution with a kernel 2.6.32 or
later;</para>
</listitem>
<listitem>
<para>standard (base) Linux utilities, including:</para>
<itemizedlist>
<listitem>
<para><parameter>tar</parameter> - utility to work with
<filename>.tar</filename> files;</para>
</listitem>
<listitem>
<para><parameter>wget</parameter> - utility to get packages from
the distribution server;</para>
</listitem>
<listitem>
<para>any console text editors to edit configuration files -
i.e. <parameter>vim</parameter>, <parameter>nano</parameter>,
etc.</para>
</listitem>
</itemizedlist>
</listitem>
</itemizedlist>
</section>
<section>
<title>User qualification</title>
<para>To install and maintain STDF system administrator have to
have:</para>
<itemizedlist>
<listitem>
<para>skills equals to those, that are enough to successfully pass
the LPIC-2 exam;</para>
</listitem>
<listitem>
<para>some knowledge of Erlang language syntax to write filtering
rules.</para>
</listitem>
<listitem>
<para>read throughly a "STDF filtering rules language reference"
manual (supplied by Teliota separately).</para>
</listitem>
</itemizedlist>
</section>
<section>
<title>Installation process of components</title>
<section>
<title>Getting packages of components</title>
<para>All packages are to be downloaded from a Teliota distribution
web server: <link
xlink:href="https://download.teliota.com">https://download.teliota.com</link>
.</para>
</section>
<section>
<title>Installation of a coordinator component</title>
<para>To install a coordinator component:</para>
<procedure>
<step>
<para>Go the the top level installation directory.</para>
</step>
<step>
<para>Make a directory for coordinator's files:</para>
<screen>$ mkdir stdf_coordinator</screen>
</step>
<step>
<para>Change a directory to the recently created one:</para>
<screen>$ cd stdf_coordinator</screen>
</step>
<step>
<para>Download the package with a coordinator component:</para>
<screen>$ wget https://download.teliota.com/bin/stdf_coordinator.tar.bz2</screen>
</step>
<step>
<para>Untar coordinator component files:</para>
<screen>$ tar -xjf stdf_coordinator.tar.bz2</screen>
</step>
<step>
<para>Open configuration file <filename>config.ini</filename> in
any text editor and set up the IP and port that coordinator
component should listen on:</para>
<screen>COORDINATOR_SERVER_LISTEN_IP=192.168.2.53
COORDINATOR_SERVER_LISTEN_PORT=8860
</screen>
</step>
<step>
<para>Change directory the <filename>bin/</filename>
folder:</para>
<screen>$ cd bin/</screen>
</step>
<step>
<para>Check if the file <parameter>stdf_coordinator.sh</parameter>
have an execution bit turned on.</para>
</step>
<step>
<para>Run the coordinator:</para>
<screen>$ ./stdf_coordinator.sh</screen>
</step>
</procedure>
<para>The coordinator is needed to be fed by filtering rules. The
coordinator includes a separate language parsing and debugging tool
which validates a filter rule.<note>
<para>It is assumed that you have filtering rules already written.
If you haven't any rule written yet, first check the section <xref
endterm="auth_rules_title" linkend="auth_rules"/>.</para>
</note></para>
<para>To deploy a filtering rule:</para>
<procedure>
<step>
<para>Check the filtering rule:</para>
<screen>$ ./stdf_parser.sh -i [rulefile1]</screen>
</step>
<step>
<para>If there are any output messages - read them carefully.
These messages also saved within a log file for the future
analysis.</para>
</step>
<step>
<para>Copy the rule file to a <filename>filter_rules</filename>
directory within the coordinator installation:</para>
<screen>$ cp [rulefile1] ../<filename>filter_rules</filename></screen>
</step>
<step>
<para>Open configuration file <filename>config.ini</filename> in
any text editor and add recently copied file into the
coordinator's configuration file:</para>
<screen>COORDINATOR_RULES_FILES=rulefile1,rulefile2</screen>
</step>
<step>
<para>Restart the coordinator component:</para>
<screen>$ ./stdf_coordinator.sh restart</screen>
</step>
</procedure>
</section>
<section>
<title>Installation of a loadbalancer component</title>
<para>To install a loadbalancer component:</para>
<procedure>
<step>
<para>Change a current directory to the top level installation
one.</para>
</step>
<step>
<para>Make a directory for the loadbalancer component
files:</para>
<screen>$ mkdir stdf_loadbalancer</screen>
</step>
<step>
<para>Change a directory to the recently created one:</para>
<screen>$ cd stdf_loadbalancer</screen>
</step>
<step>
<para>Download the package with a loadbalancer component:</para>
<screen>$ wget https://download.teliota.com/bin/stdf_loadbalancer.tar.bz2</screen>
</step>
<step>
<para>Untar the loadbalancer component files:</para>
<screen>$ tar -xjf stdf_loadbalancer.tar.bz2</screen>
</step>
<step>
<para>Open configuration file <filename>config.ini</filename> in
any text editor and point the loadbalancer to the coordinator's IP
address and port number:</para>
<screen>COORDINATOR_SERVER_IP=192.168.2.53
COORDINATOR_SERVER_PORT=8860
</screen>
</step>
<step>
<para>Change directory to the <filename>bin/</filename>
folder:</para>
<screen>$ cd ./bin</screen>
</step>
<step>
<para>Check if the file
<parameter>stdf_loadbalancer.sh</parameter> have an execution bit
turned on.</para>
</step>
<step>
<para>Run the loadbalancer component:</para>
<screen>$ ./stdf_loadbalancer.sh</screen>
</step>
</procedure>
</section>
<section>
<title>Installation of a filtering component</title>
<para>To install a filtering component:</para>
<procedure>
<step>
<para>Change a current directory to the top level installation
one.</para>
</step>
<step>
<para>Make a directory for filtering component files:</para>
<screen>$ mkdir stdf_node</screen>
</step>
<step>
<para>Change a directory to the recently created one:</para>
<screen>$ cd stdf_node</screen>
</step>
<step>
<para>Download the package with a filtering component:</para>
<screen>$ wget https://download.teliota.com/bin/stdf_node.tar.bz2</screen>
</step>
<step>
<para>Untar the filtering component files:</para>
<screen>$ tar -xjf stdf_node.tar.bz2</screen>
</step>
<step>
<para>Open configuration file <filename>config.ini</filename> in
any text editor and point the filtering component to the
coordinator's IP address and port number:</para>
<screen>COORDINATOR_SERVER_IP=192.168.2.53
COORDINATOR_SERVER_PORT=8860
</screen>
</step>
<step>
<para>Change directory to the <filename>bin/</filename>
folder:</para>
<screen>$ cd ./bin</screen>
</step>
<step>
<para>Check if the file <parameter>stdf_node.sh</parameter> have
an execution bit turned on.</para>
</step>
<step>
<para>Run the filtering component:</para>
<screen>$ ./stdf_node.sh</screen>
</step>
<step>
<para>Repeat above steps for all filter components are to be
installed.</para>
</step>
<step>
<para>Start feeding data into the data interface of the
loadbalancer component.</para>
</step>
</procedure>
</section>
</section>
</section>
<section xml:id="auth_rules">
<title xml:id="auth_rules_title">Authoring filtering rules</title>
<note>
<para>This section only briefly describes filtering rules structure. For
a detailed information take a look into the "STDF filtering rules
language reference" manual (supplied separately).</para>
</note>
<para>Filtering rules are defined utilizing a filtering language that uses
Erlang language syntax as a basis.</para>
<para>Each filtering rule includes three elements (so called
"definitions"):</para>
<itemizedlist>
<listitem>
<para>data definition - describes nature of data to be filtered,
including the pattern how the incoming data can be recognized (e.g.
port, input url, data header); the data definition assigns an
identifier to the dataset so that the data correlation and filter
rules can refer to it;</para>
</listitem>
<listitem>
<para>correlation definition - describes how that data depends on
itself or some other identified dataset;</para>
</listitem>
<listitem>
<para>filter definition - describes what actions are to be taken for
the data, when it arrives.</para>
</listitem>
</itemizedlist>
</section>
<section xml:id="using_data">
<title xml:id="using_data_title">Using and verifying filtered data</title>
<para>The filtering cluster appoints one of its nodes automatically as a
forwarder, based on the load of the servers. The forwarder collects the
data from each filtering node, combines it into one stream, and sends it
to whatever server is designated as the final receiver
(destination).</para>
<para><important>
<para>The filtering components (nodes) don't store any data - they
only perform filtering. You have to define and configure the storage
server beyond the STDF deployment that will perform any and all
database processing. A connection to a designated DB server is
configured within a coordinator component configuration file
<filename>config.ini</filename>.</para>
</important></para>
<para>The forwarder can optionally inject additional data headers and
trailers into the initial data block for easier recognition of its nature
- source transmitter/generator. The trailer may contain a CRC for checking
data integrity. The algorithm for the CRC is shown below:</para>
<screen language="c">def crc16(self, buff, crc = 0, poly = 0xa001):
l = len(buff)
i = 0
while i &amp;lt; l:
ch = buff[i]
uc = 0
while uc &amp;lt; 8:
if (crc &amp;amp; 1) ^ (ch &amp;amp; 1):
crc = (crc &amp;gt;&amp;gt; 1) ^ poly
else:
crc &amp;gt;&amp;gt;= 1
ch &amp;gt;&amp;gt;= 1
uc += 1
i += 1
return crc
crc_byte_high = (crc &amp;gt;&amp;gt; 8)
crc_byte_low = (crc &amp;amp; 0xFF)</screen>
</section>
<section xml:id="trouble">
<title xml:id="trouble_title">Troubleshooting</title>
<section>
<title>Problem: no connection from a filter node to a
coordinator</title>
<informaltable>
<tgroup cols="2">
<thead>
<row>
<entry align="center">Possible reasons</entry>
<entry align="center">How to solve a problem</entry>
</row>
</thead>
<tbody>
<row>
<entry>Any of coordinator's node IP settings of a filter node
are not correct or were not set.</entry>
<entry>Check for a correct IP and port numbers of
filters.</entry>
</row>
<row>
<entry>Firewall rules don't allow filter packets to reach a
coordinator</entry>
<entry>Check if coordinator firewall settings (open ports and IP
rules) are correct.</entry>
</row>
<row>
<entry>Coordinator node is not running</entry>
<entry>Check if coordinator is really running.</entry>
</row>
</tbody>
</tgroup>
</informaltable>
</section>
<section>
<title>Problem: filtering node doesn't receive filtering rules</title>
<informaltable>
<tgroup cols="2">
<thead>
<row>
<entry align="center">Possible reason</entry>
<entry align="center">How to solve a problem</entry>
</row>
</thead>
<tbody>
<row>
<entry>Any of coordinator's node IP settings of a filter node
are not correct or were not set.</entry>
<entry>Check for a correct IP and port numbers (see above
problem's first solution).</entry>
</row>
<row>
<entry>Errors in filtering language</entry>
<entry>Check coordinator's log file for errors</entry>
</row>
<row>
<entry>Issues with network connectivity or software used</entry>
<entry>Check coordinator's log file for errors; check node
firewall settings</entry>
</row>
</tbody>
</tgroup>
</informaltable>
</section>
<section>
<title>Problem: filtering node doesn't receive data</title>
<informaltable>
<tgroup cols="2">
<thead>
<row>
<entry align="center">Possible reason</entry>
<entry align="center">How to solve a problem</entry>
</row>
</thead>
<tbody>
<row>
<entry>Loadbalancer is not running</entry>
<entry>Check for errors in loadbalancer log files</entry>
</row>
<row>
<entry>Ports are close or filtered by firewall</entry>
<entry>Check node firewall settings</entry>
</row>
<row>
<entry>There are no actual data received</entry>
<entry>Check loadbalancer log file of transmitted data</entry>
</row>
</tbody>
</tgroup>
</informaltable>
</section>
<section>
<title>Problem: loadbalancer doesn't receive any data</title>
<informaltable>
<tgroup cols="2">
<thead>
<row>
<entry align="center">Possible reason</entry>
<entry align="center">How to solve a problem</entry>
</row>
</thead>
<tbody>
<row>
<entry>Loadbalancer is not running</entry>
<entry>Check if loadbalancer is running and check for errors in
loadbalancer's log files.</entry>
</row>
<row>
<entry>Ports are close or filtered by firewall</entry>
<entry>Check loadbalancer firewall settings</entry>
</row>
</tbody>
</tgroup>
</informaltable>
</section>
<section>
<title>Problem: Filter produces incorrect results</title>
<informaltable>
<tgroup cols="2">
<thead>
<row>
<entry align="center">Possible reason</entry>
<entry align="center">How to solve a problem</entry>
</row>
</thead>
<tbody>
<row>
<entry>Incorrect filter initial setup</entry>
<entry>Run node with higher level of verbosity: start them with
.<filename>/stdf_node.sh -vvv</filename> and then check log
files for possible issues</entry>
</row>
<row>
<entry>Incorrect filter rules</entry>
<entry>Run filter language parser and validate it's actual
syntax: run <filename>./stdf_parser.sh --validate
[rulefile1]</filename></entry>
</row>
</tbody>
</tgroup>
</informaltable>
</section>
</section>
<appendix>
<title>Technology stack behind this sample document</title>
<para>The source files of this document:</para>
<itemizedlist>
<listitem>
<para>were completely written in <link
xlink:href="https://docbook.org/xml/5.1/">DocBook/XML 5.1</link>
format which is <link
xlink:href="https://www.oasis-open.org/committees/tc_home.php?wg_abbrev=docbook">OASIS
Standard</link>;</para>
</listitem>
<listitem>
<para>were WYSYWYM-authored by using of <link
xlink:href="http://www.xmlmind.com/xmleditor/">XMLmind XML
Editor</link> version 7.3 by <link
xlink:href="http://www.xmlmind.com">XMLmind Software</link> installed
on author's desktop running <link
xlink:href="https://www.debian.org/">Debian GNU/Linux 10.11
(buster)</link>. Also author used <link
xlink:href="http://dia-installer.de/">Dia Diagram Editor</link> for
diagrams.</para>
</listitem>
<listitem>
<para>are freely available at Github as a <link
xlink:href="https://github.com/eduardtibet/docbook-samples">docbook-samples
project</link>;</para>
</listitem>
<listitem>
<para>are distributed under Creative Commons License - for details see
<xref endterm="license_title" linkend="license"/>.</para>
</listitem>
</itemizedlist>
<para>To produce <filename>.fo</filename> file of this document the
following software were used:</para>
<itemizedlist>
<listitem>
<para>The local copy of <link
xlink:href="http://docbook.sourceforge.net/release/xsl/">DocBook XSL
Stylesheets v. 1.79.1</link> was used.</para>
</listitem>
<listitem>
<para>Author's customization layer of the above stylesheets that is
now a <link
xlink:href="https://github.com/eduardtibet/docbook-pretty-playout">docbook
pretty playout</link> project, freely available at Github.</para>
</listitem>
<listitem>
<para><filename>xsltproc</filename> as an engine to produce
<filename>.fo</filename> file from the DocBook source
<filename>.xml</filename> file (<filename>xsltproc</filename> compiled
against <filename>libxml</filename> 20904,
<filename>libxslt</filename> 10129 and <filename>libexslt</filename>
817).</para>
</listitem>
</itemizedlist>
<para>To get the result <filename>.pdf</filename> file from a
<filename>.fo</filename> file author used <link
xlink:href="http://xmlgraphics.apache.org/fop/">Apache FOP 2.3</link>
engine with a <link
xlink:href="https://github.com/eduardtibet/foponts">foponts
project</link>, created and maintained by the author of this
document.</para>
</appendix>
<appendix xml:id="license">
<title xml:id="license_title">License</title>
<para>This work is licensed under a <link
xlink:href="https://creativecommons.org/licenses/by-nc-sa/4.0/">Creative
Commons Attribution-NonCommercial-ShareAlike 4.0 International
License</link>.</para>
</appendix>
</article>

0
xml/dotpatch.xsl Normal file → Executable file
View file

64787
xml/full_mets.xml Normal file → Executable file

File diff suppressed because it is too large Load diff

7
xml/rng-validate.xml Normal file
View file

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<?xml-model
href="https://vault.tei-c.org/P5/current/xml/tei/custom/schema/relaxng/tei_all.rng"
schematypens="http://relaxng.org/ns/structure/1.0"
type="application/xml"?>
<TEI xmlns="http://www.tei-c.org/ns/1.0" />

6014
xml/shakespear/allswell.xml Normal file

File diff suppressed because it is too large Load diff

27
xml/shakespear/play.dtd Normal file
View file

@ -0,0 +1,27 @@
<!-- DTD for Shakespeare J. Bosak 1994.03.01, 1997.01.02 -->
<!-- Revised for case sensitivity 1997.09.10 -->
<!-- Revised for XML 1.0 conformity 1998.01.27 (thanks to Eve Maler) -->
<!ENTITY amp "&#38;">
<!ELEMENT PLAY (TITLE, FM, PERSONAE, SCNDESCR, PLAYSUBT, INDUCT?,
PROLOGUE?, ACT+, EPILOGUE?)>
<!ELEMENT TITLE (#PCDATA)>
<!ELEMENT FM (P+)>
<!ELEMENT P (#PCDATA)>
<!ELEMENT PERSONAE (TITLE, (PERSONA | PGROUP)+)>
<!ELEMENT PGROUP (PERSONA+, GRPDESCR)>
<!ELEMENT PERSONA (#PCDATA)>
<!ELEMENT GRPDESCR (#PCDATA)>
<!ELEMENT SCNDESCR (#PCDATA)>
<!ELEMENT PLAYSUBT (#PCDATA)>
<!ELEMENT INDUCT (TITLE, SUBTITLE*, (SCENE+|(SPEECH|STAGEDIR|SUBHEAD)+))>
<!ELEMENT ACT (TITLE, SUBTITLE*, PROLOGUE?, SCENE+, EPILOGUE?)>
<!ELEMENT SCENE (TITLE, SUBTITLE*, (SPEECH | STAGEDIR | SUBHEAD)+)>
<!ELEMENT PROLOGUE (TITLE, SUBTITLE*, (STAGEDIR | SPEECH)+)>
<!ELEMENT EPILOGUE (TITLE, SUBTITLE*, (STAGEDIR | SPEECH)+)>
<!ELEMENT SPEECH (SPEAKER+, (LINE | STAGEDIR | SUBHEAD)+)>
<!ELEMENT SPEAKER (#PCDATA)>
<!ELEMENT LINE (#PCDATA | STAGEDIR)*>
<!ELEMENT STAGEDIR (#PCDATA)>
<!ELEMENT SUBTITLE (#PCDATA)>
<!ELEMENT SUBHEAD (#PCDATA)>

85
xquery/diag-xqdoc.xq Executable file
View file

@ -0,0 +1,85 @@
(:~
: generate dotml from xqdoc source
: apb Jan 2013
:)
declare namespace doc = "http://www.xqdoc.org/1.0";
declare namespace dotml = "http://www.martin-loetzsch.de/DOTML";
declare namespace hash = "http://basex.org/modules/hash";
declare variable $ns-ignore := ("http://www.w3.org/2005/xpath-functions",
"http://www.w3.org/2010/xslt-xquery-serialization",
"http://www.w3.org/2001/XMLSchema",
"http://www.w3.org/2005/xpath-functions/math");
declare function local:sid($s as xs:string)
as xs:string { "A" || xs:hexBinary(hash:md5($s)) };
declare function local:fid($uri as xs:string, $name as xs:string,
$arity as xs:string) { let $a :=
fn:trace(($uri || "*" || $name || "*" || $arity), "fid: ")
return "A" || xs:hexBinary(hash:md5($uri || $name || $arity)) };
declare function local:foo($dml) {
let $moduri :=
$dml/doc:xqdoc/doc:module/doc:uri/fn:string()
return
<dotml:graph file-name="graphs/bgcolor" rankdir="LR" label="a test" >
{ for $import in $dml//doc:import
let $ns := $import/doc:uri/fn:string()
where some $call in $dml//doc:invoked satisfies $call/doc:uri =
$import/doc:uri
return
<dotml:cluster id="{ local:sid($ns)}"
label="{ $ns}"
bgcolor="#FF8080" >
{ for $call in $dml//doc:invoked[doc:uri = $import/doc:uri]
return
<dotml:node
id="{ local:fid($call/doc:name/@uri,
$call/doc:name/@localname, $call/@arity)}"
label="{ $call/doc:name/fn:string()}"
fillcolor="lightblue" style="filled"/>
}
</dotml:cluster>
}
<dotml:cluster id="main" rankdir="LR"
label="main"
bgcolor="seashell"
>
{ for $f in $dml//doc:function
return
<dotml:node id="{ local:fid($moduri, $f/doc:name, $f/@arity)}" label="{
$f/doc:name}" fillcolor="yellow" style="filled"/>,
for $v in $dml//doc:variable
return
<dotml:node id="{ generate-id($v)}" label="{ $v/doc:name}"
fillcolor="green" style="filled"/>
}
</dotml:cluster>
{ for $call in $dml//doc:invoked
let $f := $call/..
where not($call/doc:name/@uri/fn:string() = $ns-ignore)
return
<dotml:edge
from="{ local:fid($moduri, $f/doc:name, $f/@arity)}"
to="{ local:fid($call/doc:name/@uri, $call/doc:name/@localname,
$call/@arity)}"/> }
</dotml:graph> };
let $a := local:foo(/)
(:
: let $req:=<http:request method="POST" >
: <http:body
: media-type="application/x-www-form-urlencoded">data={fn:encode-for-uri(fn:serialize($a))}</http:body>
: </http:request>
: let $ws:=
: http:send-request($req,"http://localhost:8984/restxq/graphxq/api/dotml")
: return file:write("aa.svg",$ws[2])
:) return $a

136
xquery/graphviz.xqm Executable file
View file

@ -0,0 +1,136 @@
(:~
: graphviz module
: based on http://www.zorba-xquery.com/html/modules/zorba/image/graphviz
:)
module namespace gr="apb.graphviz";
declare default function namespace 'apb.graphviz';
import module namespace proc = "http://basex.org/modules/proc";
import module namespace file = "http://expath.org/ns/file";
import module namespace xslt = "http://basex.org/modules/xslt";
import module namespace random = "http://basex.org/modules/random";
declare namespace svg = "http://www.w3.org/2000/svg";
declare namespace xlink = "http://www.w3.org/1999/xlink";
declare %private variable $gr:dotpath := if (fn:environment-variable("DOTPATH"))
then
fn:environment-variable("DOTPATH")
else
"dot";
(:~
: folder for temp files \=windows
:)
declare %private variable $gr:tmpdir := if (file:dir-separator() = "\") then
fn:environment-variable("TEMP") || "\"
else
"/tmp/";
declare %private variable $gr:empty := <svg xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 300 20" version="1.1"
width="100%" height="100%" preserveAspectRatio="xMidYMid meet">
<text x="150" y="10" text-anchor="middle">Empty.</text>
</svg>;
(:~
: Layout one or more graphs given in the DOT language and render them as SVG.
:)
declare function dot($dot as xs:string*, $params as xs:string*)
as node()* { let $params := ("-Tsvg")
for $d in $dot
return
if (fn:not($d)) then
$gr:empty
else
let $r := dot-execute($d, $params)
return dot-svg($r)
};
(:~ run dot command :)
declare %private function dot-execute($dot as xs:string, $params as xs:string*)
as element(result) { let $fname := $gr:tmpdir || random:uuid()
let $junk := file:write-text($fname, $dot)
let $r := proc:execute($gr:dotpath, ($params, $fname))
let $junk := file:delete($fname)
return
if ($r/code != "0") then
fn:error(xs:QName('gr:dot1'), $r/error)
else
$r
};
(:~ run dot command returning binary :)
declare function dot-executeb($dot as xs:string, $params as xs:string*)
as xs:base64Binary { let $fname := $gr:tmpdir || random:uuid()
let $oname := $fname || ".o"
let $junk := file:write-text($fname, $dot)
let $r := proc:execute($gr:dotpath, ($params, "-o" || $oname, $fname))
let $junk := file:delete($fname)
return
if ($r/code != "0") then
fn:error(xs:QName('gr:dot1'), $r/error)
else
let $d := file:read-binary($oname)
(: let $junk:=file:delete($oname) :) return $d
};
(:~ cleanup dot svg result :)
declare %private function dot-svg($r as element(result))
as element(svg:svg) { let $s := fn:parse-xml($r/output)
(: o/p has comment nodes :) let $ver := $s/comment()[1]/fn:normalize-space()
let $title := $s/comment()[2]/fn:normalize-space()
let $svg := $s/*
return
<svg xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink" >
{ $svg/@*,
<metadata>
<rdf:RDF
xmlns:rdf = "http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:rdfs = "http://www.w3.org/2000/01/rdf-schema#"
xmlns:dc = "http://purl.org/dc/elements/1.1/" >
<rdf:Description about="https://github.com/apb2006/graphxq"
dc:title="{ $title}"
dc:description="A graph visualization"
dc:date="{ fn:current-dateTime()}"
dc:format="image/svg+xml">
<dc:creator>
<rdf:Bag>
<rdf:li>{ $ver}</rdf:li>
<rdf:li resource="https://github.com/apb2006/graphxq"/>
</rdf:Bag>
</dc:creator>
</rdf:Description>
</rdf:RDF>
</metadata>,
$svg/*}
</svg> };
(:~
: set svg to autosize 100%
:)
declare function autosize($svg as node())
as node() { <svg xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
width="100%" height="100%" preserveAspectRatio="xMidYMid meet">
{ $svg/@* except ($svg/@width, $svg/@height, $svg/@preserveAspectRatio),
$svg/*}
</svg> };
(:~
: set svg to autosize 100%
:)
declare function autosize-old($svg as node())
as node() { xslt:transform($svg, fn:resolve-uri("dotml/dotpatch.xsl")) };

13
xquery/run.xq Normal file
View file

@ -0,0 +1,13 @@
declare variable $inp := "Merry Christmas, and a happy new year! (2014)";
declare variable $m :=
"
¡,#$%⅋,)(*+'-˙/0ƖᄅƐㄣϛ9ㄥ86:;>=<¿@∀qƆpƎℲפHIſʞ˥WNOԀQɹS┴∩ΛMX⅄Z]\[^‾,ɐqɔpǝɟƃɥᴉɾʞlɯuodbɹsʇnʌʍxʎz}|{~";
declare variable $M := ((1 to 31), string-to-codepoints($m));
for $s in util:chars($inp)
return
codepoints-to-string(reverse(for $c in string-to-codepoints($s)
return $M[$c]))

2
xquery/simple.xq Normal file
View file

@ -0,0 +1,2 @@
2+6

Binary file not shown.