-
Notifications
You must be signed in to change notification settings - Fork 95
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Fuseki installation and configurations for locally-hosted example…
… data
- Loading branch information
Showing
8 changed files
with
230 additions
and
8 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
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
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,5 @@ | ||
|
||
- name: Add 'openjdk' repository | ||
apt_repository: | ||
repo: ppa:openjdk-r/ppa | ||
state: present |
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,5 @@ | ||
export FUSEKI_HOME=/opt/fuseki | ||
export FUSEKI_BASE=/etc/fuseki | ||
|
||
FUSEKI_USER=fuseki | ||
JAVA_OPTIONS="-Xmx2048M" |
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,58 @@ | ||
@prefix : <http://base/#> . | ||
@prefix tdb: <http://jena.hpl.hp.com/2008/tdb#> . | ||
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . | ||
@prefix ja: <http://jena.hpl.hp.com/2005/11/Assembler#> . | ||
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . | ||
@prefix fuseki: <http://jena.apache.org/fuseki#> . | ||
@prefix text: <http://jena.apache.org/text#> . | ||
@prefix skos: <http://www.w3.org/2004/02/skos/core#> . | ||
|
||
:service_tdb_all a fuseki:Service ; | ||
rdfs:label "TDB+text skosmos" ; | ||
fuseki:dataset :text_dataset ; | ||
fuseki:name "skosmos" ; | ||
fuseki:serviceQuery "query" , "sparql" ; | ||
fuseki:serviceReadGraphStore "get" ; | ||
fuseki:serviceReadWriteGraphStore | ||
"data" ; | ||
fuseki:serviceUpdate "update" ; | ||
fuseki:serviceUpload "upload" . | ||
|
||
:text_dataset a text:TextDataset ; | ||
text:dataset :tdb_dataset_readwrite ; | ||
# tdb:unionDefaultGraph true ; | ||
text:index :index_lucene . | ||
|
||
:tdb_dataset_readwrite | ||
a tdb:DatasetTDB ; | ||
tdb:location "/etc/fuseki/databases/skosmos" . | ||
|
||
:index_lucene a text:TextIndexLucene ; | ||
text:directory <file:/etc/fuseki/databases/skosmos/text> ; | ||
text:entityMap :entity_map ; | ||
text:storeValues true . | ||
|
||
# Text index configuration for Skosmos 1.4 and above (requires Fuseki 1.3.0+ or 2.3.0+) | ||
:entity_map a text:EntityMap ; | ||
text:entityField "uri" ; | ||
text:graphField "graph" ; | ||
text:defaultField "pref" ; | ||
text:uidField "uid" ; | ||
text:langField "lang" ; | ||
text:map ( | ||
# skos:prefLabel | ||
[ text:field "pref" ; | ||
text:predicate skos:prefLabel ; | ||
text:analyzer [ a text:LowerCaseKeywordAnalyzer ] | ||
] | ||
# skos:altLabel | ||
[ text:field "alt" ; | ||
text:predicate skos:altLabel ; | ||
text:analyzer [ a text:LowerCaseKeywordAnalyzer ] | ||
] | ||
# skos:hiddenLabel | ||
[ text:field "hidden" ; | ||
text:predicate skos:hiddenLabel ; | ||
text:analyzer [ a text:LowerCaseKeywordAnalyzer ] | ||
] | ||
) . |
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,145 @@ | ||
|
||
- name: Download Fuseki tarball | ||
get_url: | ||
url: https://archive.apache.org/dist/jena/binaries/apache-jena-fuseki-3.8.0.tar.gz | ||
dest: /home/vagrant/ | ||
mode: 755 | ||
|
||
- name: Extract Fuseki to opt/ | ||
command: chdir=/opt /bin/tar xzf /home/vagrant/apache-jena-fuseki-3.8.0.tar.gz | ||
args: | ||
warn: false | ||
|
||
- name: Create a symbolic link to /opt/fuseki | ||
file: | ||
src: /opt/apache-jena-fuseki-3.8.0 | ||
dest: /opt/fuseki | ||
state: link | ||
|
||
- name: Add a new user fuseki | ||
user: | ||
name: fuseki | ||
home: /opt/fuseki | ||
system: yes | ||
create_home: no | ||
|
||
- name: Create directories to /var/lib | ||
file: | ||
path: "/var/lib/fuseki/{{ item }}" | ||
state: directory | ||
owner: fuseki | ||
group: fuseki | ||
mode: 0775 | ||
with_items: | ||
- backups | ||
- databases | ||
- system | ||
- system_files | ||
|
||
- name: Create directories | ||
file: | ||
path: "{{ item }}" | ||
state: directory | ||
owner: fuseki | ||
group: fuseki | ||
mode: 0775 | ||
with_items: | ||
- /var/log/fuseki | ||
- /etc/fuseki | ||
|
||
- name: Link fuseki home | ||
file: | ||
src: "/var/lib/fuseki/{{ item }}" | ||
dest: /etc/fuseki/{{ item }} | ||
state: link | ||
with_items: | ||
- backups | ||
- databases | ||
- system | ||
- system_files | ||
|
||
- name: Link logs to /etc/fuseki/logs | ||
file: | ||
src: /var/log/fuseki | ||
dest: /etc/fuseki/logs | ||
state: link | ||
|
||
- name: Copy Fuseki config | ||
copy: | ||
src: files/fuseki | ||
dest: /etc/default/ | ||
|
||
- name: Setup autostart | ||
command: chdir=/etc/init.d ln -s /opt/fuseki/fuseki . | ||
args: | ||
warn: false | ||
ignore_errors: yes | ||
|
||
- name: Update services | ||
command: update-rc.d fuseki defaults | ||
|
||
- name: Start service Fuseki | ||
service: | ||
name: fuseki | ||
state: started | ||
|
||
- name: Create Skosmos database | ||
uri: | ||
url: http://localhost:3030/$/datasets/ | ||
method: POST | ||
body: dbName=skosmos&dbType=tdb | ||
body_format: raw | ||
|
||
- name: Shut down service Fuseki for configuration | ||
service: | ||
name: fuseki | ||
state: stopped | ||
|
||
- name: Create configuration directory for Skosmos datasets | ||
file: | ||
path: etc/fuseki/configuration | ||
state: directory | ||
|
||
- name: Create text index for Skosmos datasets | ||
copy: | ||
src: files/skosmos.ttl | ||
dest: etc/fuseki/configuration/skosmos.ttl | ||
|
||
- name: Allow management operations for non-localhost access | ||
lineinfile: | ||
path: /etc/fuseki/shiro.ini | ||
line: "/$/** = anon" | ||
|
||
- name: Start service Fuseki | ||
service: | ||
name: fuseki | ||
state: started | ||
|
||
- name: Install Ruby | ||
apt: | ||
name: ruby | ||
update_cache: yes | ||
state: present | ||
|
||
- name: Download example vocabulary data (STW Thesaurus) | ||
get_url: | ||
url: http://zbw.eu/stw/version/latest/download/stw.ttl.zip | ||
dest: /home/vagrant/ | ||
mode: 755 | ||
|
||
- name: Unzip STW Thesaurus data file | ||
command: unzip /home/vagrant/stw.ttl.zip -d /home/vagrant/ | ||
args: | ||
warn: false | ||
|
||
- name: Download example vocabulary data (UNESCO Thesaurus) | ||
get_url: | ||
url: http://skos.um.es/unescothes/unescothes.ttl | ||
dest: /home/vagrant/ | ||
mode: 755 | ||
|
||
- name: Load example vocabulary data (STW Thesaurus) | ||
command: /opt/fuseki/bin/s-put http://localhost:3030/skosmos/data http://zbw.eu/stw/ /home/vagrant/stw.ttl | ||
|
||
- name: Load example vocabulary data (UNESCO Thesaurus) | ||
command: /opt/fuseki/bin/s-put http://localhost:3030/skosmos/data http://skos.um.es/unescothes/ /home/vagrant/unescothes.ttl |
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,5 @@ | ||
- name: Update apt-cache and then install openjdk-8-jre | ||
apt: | ||
name: openjdk-8-jre | ||
update_cache: yes | ||
state: present |
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