-
Notifications
You must be signed in to change notification settings - Fork 29
CORESE server
Erwan Demairy edited this page Mar 29, 2018
·
27 revisions
Table of Contents generated with DocToc
- What is the Corese server?
- How to launch corese as a server from source code:
- Examples of Usage
- REST API
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.
-
launch the server:
java -jar ./kgserver/target/corese-server-*-jar-with-dependencies.jar -lh
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 |
switch | meaning |
---|---|
-l,--load filename[;filename] | load in the triple store the data contained by the files or the directories listed. |
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) |
switch | meaning |
---|---|
-e,--entailments | enable RDFS entailments |
-o,--owlrl | enable OWL RL entailments |
Parameters for the server can be obtained with the -h
parameter:
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.
By default, the server provides a HTML interface that can be accessed at http://localhost:8080
In this scenario, two processes are launched:
- 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. - 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___/
- 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 - 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'
- Then you can enter the following request:
select * where {
service <http://___hostname___:___port_number___/sparql> {
?x ?p ?y
}
}
- launch a corese server:
java -jar target/corese-server-3.2.1-SNAPSHOT-jar-with-dependencies.jar
- 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'
- launch a Jena Fuseki server with data:
./fuseki-server --file=${CORESE_ROOT}/kgserver/src/main/resources/webapp/data/tutorial/human.rdf /dataset
- launch a Corese gui
java -jar kggui/target/corese-3.2.1-SNAPSHOT-jar-with-dependencies.jar
- 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:
- http://localhost:3030/dataset is the endpoint of the Jena Fuseki server;
- http://localhost:8080/sparql is the endpoint of the Corese server;
- http://dbpedia.org/sparql is the endpoint for dbpedia.org.
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 .
Paramètres :
- remote_path: URL of the server used to store the data;
- source: filename of the data to upload.