home » dokk/dokk.org.git
Author zPlus <zplus@peers.community> 2023-11-19 09:17:40
Committer zPlus <zplus@peers.community> 2023-11-19 09:17:40
Commit cf9a33a (patch)
Tree c3b261f
Parent(s)

Add basic configuration for Fuseki.


commits diff: f8930ea..cf9a33a
3 files changed, 104 insertions, 3 deletionsdownload


Diffstat
-rw-r--r-- README 29
-rw-r--r-- fuseki.service 39
-rw-r--r-- fuseki_base/configuration/dokk.ttl 39

Diff options
View
Side
Whitespace
Context lines
Inter-hunk lines
+26/-3 M   README
index cb3accc..0f4b030
old size: 311B - new size: 1K
@@ -1,10 +1,33 @@
1 - Run website:
1 + # Extract plaintext from library PDF files. These texts are used in the library pages.
2 +
3 + cp -R pdf pdf_to_text
4 + cd pdf_to_text
5 + for file in *.pdf; do pdftotext -layout "$file"; done
6 + rm -f *.pdf
7 +
8 + # Database
9 +
10 + The tools used here are available for download at
11 + <https://jena.apache.org/download/#apache-jena-binary-distributions>. Just download
12 + "apache-jena-<version>.tar.gz" and "apache-jena-fuseki-<version>.tar.gz"
13 +
14 + Databases can be created with:
15 +
16 + tdb2.tdbloader --loc=database_name *.ttl
17 +
18 + Place all the databases into the folder "fuseki_base/databases/".
19 + Now to start the server, just run the systemd service file "fuseki.service" available
20 + in this repository. Don't forget to edit both "fuseki.service" and "fuseki_base/configuration/dokk.ttl"
21 + for configuring paths or other custom settings.
22 +
23 + # Run website:
2 24
3 25 python3 -m venv venv
4 26 source venv/bin/activate
5 - gunicorn --reload --worker-connections=4 --threads=4 --bind localhost:8080 app:application
27 + pip install -r requirements.txt
28 + gunicorn --reload --worker-connections=4 --threads=4 --bind 0.0.0.0:8080 app:application
6 29
7 - Crawl website to static HTML pages:
30 + # Crawl website for static HTML pages:
8 31
9 32 wget2 --mirror --max-threads=16 --page-requisites --adjust-extension --execute robots=off localhost:8080
10 33

+39/-0 A   fuseki.service
index 0000000..75019e0
old size: 0B - new size: 1K
new file mode: -rw-r--r--
@@ -0,0 +1,39 @@
1 + # This is an example service file for systemd. If using the Fuseki server, this
2 + # service can be configured to automatically start the server.
3 + #
4 + # How to use this file:
5 + # - copy this file to /etc/systemd/system
6 + # - edit the variables below accordingly
7 + # - systemctl enable fuseki.service
8 + # - systemctl start fuseki.service
9 +
10 + [Unit]
11 + Description=Fuseki server for DOKK
12 + After=network.target
13 +
14 + [Service]
15 + # Edit the line below to adjust the amount of memory allocated to Fuseki
16 + Environment=JVM_ARGS=-Xmx2G
17 +
18 + # Folder of the Fuseki installation files
19 + Environment=FUSEKI_HOME=/home/fuseki/fuseki_server
20 +
21 + # Fuseki runtime folder (will contain configuration files and other runtime files).
22 + Environment=FUSEKI_BASE=/home/fuseki/fuseki_base
23 +
24 + # Command for launching the Fuseki server
25 + # Arguments must be passed via command line because the server is started before
26 + # the configuration file is read.
27 + ExecStart=/home/fuseki/fuseki_server/fuseki-server --port=7000 --localhost
28 +
29 + User=fuseki
30 + Group=fuseki
31 + WorkingDirectory=/home/fuseki/fuseki_server
32 + Restart=always
33 +
34 + # Java processes exit with status 143 when terminated by SIGTERM, this
35 + # should be considered a successful shutdown
36 + SuccessExitStatus=143
37 +
38 + [Install]
39 + WantedBy=multi-user.target

+39/-0 A   fuseki_base/configuration/dokk.ttl
index 0000000..e4e476f
old size: 0B - new size: 1K
new file mode: -rw-r--r--
@@ -0,0 +1,39 @@
1 + PREFIX : <dokk:configuration:>
2 + PREFIX fuseki: <http://jena.apache.org/fuseki#>
3 + PREFIX ja: <http://jena.hpl.hp.com/2005/11/Assembler#>
4 + PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
5 + PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
6 + PREFIX tdb1: <http://jena.hpl.hp.com/2008/tdb#>
7 + PREFIX tdb2: <http://jena.apache.org/2016/tdb#>
8 +
9 + :g1
10 + ja:graphName :graph:graph ;
11 + ja:graph [
12 + a tdb2:GraphTDB2 ;
13 + tdb2:location "/home/fuseki/fuseki_base/databases/graph"
14 + # tdb2:graphName ... None, use default unnamed
15 + ] .
16 +
17 + :g2
18 + ja:graphName :graph:manpages ;
19 + ja:graph [
20 + a tdb2:GraphTDB2 ;
21 + tdb2:location "/home/fuseki/fuseki_base/databases/manpages"
22 + ] .
23 +
24 + :dataset
25 + a ja:RDFDataset ;
26 + # ja:defaultGraph ...
27 + ja:namedGraph :g1 , :g2 .
28 +
29 + :endpoint
30 + # Without a name: /endpoint?query=
31 + # With a name: /endpoint/name/?query=
32 + # fuseki:name "query" ;
33 + fuseki:operation fuseki:query .
34 +
35 + :service
36 + a fuseki:Service ;
37 + fuseki:name "dokk" ;
38 + fuseki:dataset :dataset ;
39 + fuseki:endpoint :endpoint .