Client-Server

Note

This documents assumes you have already created a database. If not, check out Creating a Database for instructions.

We implement the typical client/server model, so in order to query a database, you need to have a server running and then send queries to it.

Running the Server

To run the server use the following command, replacing <db-directory> with the database directory:

mdb server <db-directory>

Executing a Query

The MillenniumDB SPARQL server supports all three query operations specified in the SPARQL Protocol:

  • query via GET

  • query via URL-encoded POST

  • query via POST directly

So you can make queries with an HTTP request.

We provide a script that queries using curl. You can use the script to make queries as follows:

bash scripts/query <query-file>

where <query-file> is the path to a file containing a query in SPARQL format.

Note

The script assumes you use the default server port (1234). Edit the script to use another port.