Skip to content
Ethan Gruber edited this page Feb 26, 2015 · 1 revision

While not required as part of the functionality of xEAC, the application is capable of interacting with a SPARQL endpoint to facilitate the publication of linked data and various interfaces and visualizations built on SPARQL. Any SPARQL 1.1 compliant endpoint may be used, but Apache Fuseki has been chosen for ease of use, clarity of documentation, and active user base. Any Fuseki version after 1.1 requires Java 7 installed and set as the default JVM on the server.

1. Download and Unzip Fuseki

Fuseki's download links and documentation are available at http://jena.apache.org/documentation/serving_data/. Download and unzip Fuseki to the server (e.g., /usr/local/projects).

2. Set up config.ttl

Fuseki can be configured with a Turtle RDF file that contains information about the service names and TDB folder location. Navigate to the Fuseki directory and create or edit config.ttl insert the following service configuration (overwriting what is already there, if necessary).

@prefix :        <#> .
@prefix fuseki:  <http://jena.apache.org/fuseki#> .
@prefix rdf:     <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .

@prefix rdfs:    <http://www.w3.org/2000/01/rdf-schema#> .
@prefix tdb:     <http://jena.hpl.hp.com/2008/tdb#> .
@prefix ja:      <http://jena.hpl.hp.com/2005/11/Assembler#> .

[] rdf:type fuseki:Server ;
   fuseki:services (	    
     <#xeac>
   ) .

# TDB
[] ja:loadClass "com.hp.hpl.jena.tdb.TDB" .
tdb:DatasetTDB  rdfs:subClassOf  ja:RDFDataset .
tdb:GraphTDB    rdfs:subClassOf  ja:Model .

## ---------------------------------------------------------------

<#xeac> rdf:type fuseki:Service ;
    # URI of the dataset -- http://host:port/ds
    fuseki:name                        "xeac" ; 
    fuseki:serviceQuery                "sparql" ;
    fuseki:serviceQuery                "query" ;
    fuseki:serviceUpdate               "update" ;
    fuseki:serviceUpload               "upload" ;
    fuseki:serviceReadWriteGraphStore  "data" ;     
    fuseki:serviceReadGraphStore       "get" ;
    fuseki:dataset                     <#xeac_tbd> ;
    .

#TBD
<#xeac_tbd> rdf:type      tdb:DatasetTDB ;
    tdb:location "xeac" 
    .

After saving config.ttl, you may run Fuseki from the command line with sh fuseki-server --update --conf=config.ttl. If you do not specify --update, writing to the triplestore will not be active (readonly).

3. Edit fuseki startup script (Optional)

Fuseki may be run as a service. Edit the 'fuseki' shell script and add the following three lines after the commented header and the the first line, 'usage()', around line 75. Update $FUSEKI_HOME as needed.

FUSEKI_HOME=/usr/local/projects/jena-fuseki-1.1.1
FUSEKI_CONF=config.ttl
FUSEKI_ARGS="--localhost --config=$FUSEKI_CONF"

This will make the script load the configuration in config.ttl and allow access to the server by localhost, effectively blocking write traffic from the outside.

4. Establish fuseki as a startup service

First copy the fuseki shell script to /etc/init.d. Then execute sudo update-rc.d fuseki defaults. Fuseki may now be started with sudo service fuseki start and stopped with sudo service fuseki stop.