Skip to content
Erwan Demairy edited this page Mar 29, 2018 · 27 revisions

Table of Contents generated with DocToc

What is the Corese server?

The Corese server provides several functionalities available through a REST API:

  • a SPARQL endpoint ;
  • a STTL endpoint ;
  • a SPIN endpoint ;
  • a distributed query processor (DQP);
  • a Linked Data Platform 1.0 server.

How to launch corese as a server from source code:

  • install and compile the code.

  • launch the server:

    java -jar ./kgserver/target/corese-server-*-jar-with-dependencies.jar -lh

Launch options

General Purpose Switches

switch meaning
-h Display all the switches
-p, --port Use the port numport instead of 8080
-v,--version Print the version information and exit.
-lp,--profile load profile data
-pp,--profile local profile

Triple Store Management

switch meaning
-l,--load filename[;filename] load in the triple store the data contained by the files or the directories listed.

SSL Access Management

switch meaning
-ssl enable ssl connection
-pssl,--pssl port of ssl connection
-jks,--keystore java key store name (../keystore/xxx)
-pwd,--password java key store password (key, store, trust store)

Entailments Activation

switch meaning
-e,--entailments enable RDFS entailments
-o,--owlrl enable OWL RL entailments

Parameters for the server can be obtained with the -h parameter:

Load datasets at startup

The -l parameter allows to load datasets in the server at startup.

java -jar target/corese-server-3.1.4-SNAPSHOT-jar-with-dependencies.jar  -l file1_path\;file2_path

Be careful to escape the ";" between several datasets.

HTML interface

By default, the server provides a HTML interface that can be accessed at http://localhost:8080

Examples of Usage

Connect to corese-server using the gui

In this scenario, two processes are launched:

  1. the corese-server instance can be launched: * either using the command bash java -jar kgserver/target/corese-server-3.2.1-SNAPSHOT-jar-with-dependencies.jar from the corese project root; * or from netbeans, running the corese-server module and using the class fr.inria.edelweiss.kgramserver.webservice.EmbeddedJettyServer as main class.
  2. whatever the way the corese-server is launched, a line similar to the one below should appear: bash Corese/KGRAM endpoint started on http://___hostname___:__port_number___/
  3. launch corese-gui: * either launching it from command line, java -jar kggui/target/corese-3.2.1-SNAPSHOT-jar-with-dependencies.jar * or from netbeans
  4. upload data to the server using the REST API: wget http://localhost:8080/sparql/load --post-data='remote_path=file:///Users/edemairy/Developpement/Corese-master/kgserver/src/main/resources/ng-persons-1.ttl'
  5. Then you can enter the following request:
select * where {
  service <http://___hostname___:___port_number___/sparql> {
    ?x ?p ?y
  }
}

Requesting with the Corese GUI to a Corese Server, a Jena Server and DBPedia

  1. launch a corese server:
java -jar target/corese-server-3.2.1-SNAPSHOT-jar-with-dependencies.jar
  1. load data in the corese server:
wget http://localhost:8080/sparql/load --post-data='remote_path=file://${CORESE_ROOT}/kgserver/src/main/resources/ng-persons-1.ttl'
  1. launch a Jena Fuseki server with data:
./fuseki-server --file=${CORESE_ROOT}/kgserver/src/main/resources/webapp/data/tutorial/human.rdf /dataset
  1. launch a Corese gui
java -jar kggui/target/corese-3.2.1-SNAPSHOT-jar-with-dependencies.jar
  1. Launch a query on three endpoints:
select * where {
   { select ?x ?p ?y where { service  { ?x ?p ?y } } limit 100} 
  UNION      { select ?x ?p ?y where { service  { ?x ?p ?y } } limit 100} 
  UNION { select ?x ?p ?y where { service  { ?x ?p ?y } } limit 100 } 
}

In that example:

REST API

A documentation listing all the REST methods can be generated with enunciate, and can be found at kgserver/src/main/webapp/docs/apidocs/index.html .

SPARQL endpoint

/sparql

Example of SPARQL request

/sparql/update

/sparql/d3

/sparql/draw

/sparql/debug

/sparql/reset [POST]

/sparql/load [POST]

Paramètres :

  • remote_path: URL of the server used to store the data;
  • source: filename of the data to upload.