Wednesday 9 October 2013

Jena Fuseki server configurations

Download and unzip the jena fuseki server

to start the server with the dataset to be loaded in the memory

fuseki-server --update --mem /ds

to start the server with the dataset to be loaded into a user specified directory

fuseki-server --update --loc=your_path_to_directory /ds


if you don't specify --mem then by default the data set uploaded will be stored to the DB directory that is present in the unzipped folder 


You can specify a custom assembler using

fuseki-server --update /inf --desc=assembler.ttl

assembler.ttl

@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#> .
@prefix sdb: <http://jena.hpl.hp.com/2007/sdb#> .

[] rdf:type fuseki:Server ;

 fuseki:services (
 <#tdb>
 ) .

<#tdb>  rdf:type fuseki:Service ;
 fuseki:name              "tdb" ;             # http://host/inf
 fuseki:serviceQuery      "sparql" ;          # SPARQL query service
 fuseki:serviceUpdate     "update" ;
 fuseki:dataset           <#dataset2> ;       #select which set to
 .                                            #use

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

<#dataset2> rdf:type ja:RDFDataset ;
 ja:defaultGraph <#model2>;
 .        

<#model2> a ja:OntModel;
 ja:baseModel <#tdbGraph>;
 ja:ontModelSpec ja:OWL_MEM ;
 ja:content [ja:externalContent <file:////home/wn20full/wnfull.rdfs>]
 .


<#tdbGraph> rdf:type tdb:GraphTDB;
 tdb:location "DB";
 .

<#interpretationSchema> a ja:MemoryModel ;
    ja:content [
        ja:externalContent <file:////home/wn20full/wnfull.rdfs> ;

    ] .