Managing Repositories via HTTP with curl

What’s in this document?

Using curl lets you script this call in an application. See also the Help ‣ REST API view of the GraphDB Workbench where you will find a complete reference of all REST APIs and be able to run API calls directly from the browser.

In addition to this, the RDF4J API is also available.


The command line utility storage-tool gives you several ways to work with GraphDB respositories from your operating system’s command line interface.

Repository Management

Most repository management queries can either take the following set of attributes as an argument or return them as a response.

  • externalUrl (string): The URL that the repository can be accessed at by an external service.

  • id (string): The repository id.

  • local (boolean): True if the repository is local (on the same machine as the Workbench).

  • location (string): If remote, the repository’s location.

  • title (string): The repository title.

  • type (string): Repository type - worker, master or system.

  • unsupported (boolean): True if the repository is unsupported.

  • writable (boolean): True if the repository is writable.

  • readable (boolean): True if the repository is readable.

  • uri (string): The GraphDB location URL.

Get all repositories in the current or another location

GET /rest/repositories


curl <base_url>/rest/repositories

Get repository configuration as Turtle

GET /rest/repositories/<repo_id>


curl <base_url>/rest/repositories/<repo_id>?location=<encoded_location_uri>

Get repository size

GET /rest/repositories/<repo_id>/size


curl <base_url>/rest/repositories/<repo_id>/size?location=<encoded_location_uri>

Create a repository in an attached GraphDB location (.ttl file)

POST /rest/repositories


curl -X POST <base_url>/rest/repositories?location=<encoded_location_uri> -H 'Content-Type: multipart/form-data' -F config=@<repo_ttl_config_filename>

Restart a repository

POST /rest/repositories/<repo_id>/restart


curl -X POST <base_url>/rest/repositories/<repo_id>/restart

Edit repository configuration

PUT /rest/repositories/<repo_id>


curl -X PUT <base_url>/rest/repositories/<repo_id> -H 'Accept: application/json' -H 'Content-Type: application/json' -d '
        "id": "<repo_id>",
        "location": "<location_uri>",
        "title": "<repo_title>",
        "type": "graphdb",
                "label":"Query timeout (seconds)",
                "label":"Cache select nodes",
                "label":"RDFS subClass reasoning",
                "label":"Enable the SHACL validation",
                "label":"FTS index for xsd:string literals",
                "label":"Named graphs for SHACL shapes",
                "label":"Run parallel validation",
                "label":"Enable consistency checks",
                "label":"Log the execution time per shape",
                "label":"Disable owl:sameAs",
                "label":"FTS index for full-text indexing of IRIs",
                "label":"Entity index size",
                "label":"DASH data shapes extensions",
                "label":"Limit query results",
                "label":"Throw exception on query timeout",
                "label":"FedX repo members",
                "label":"Storage folder",
                "label":"Validation results limit per constraint",
                "label":"Enable predicate list index",
                "label":"Transactional validation limit",
                "label":"FTS indexes to build (comma delimited)",
                "value":"default, iri, en"
                "label":"Log the executed validation plans",
                "label":"Imported RDF files('\'';'\'' delimited)",
                "label":"Enable SHACL validation",
                "label":"Cache literal language tags",
                "label":"Enable literal index",
                "label":"Enable full-text search (FTS) index",
                "label":"Default namespaces for imports('\'';'\'' delimited)",
                "label":"Enable context index",
                "label":"Base URL",
                "label":"Log validation violations",
                "label":"Log every execution step of the SHACL validation",
                "label":"Entity ID size",
                "label":"Repository type",
                "label":"RDF4J SHACL extensions",
                "label":"Validation results limit total",


Adjust parameters with new values except for <repo_id> in order to edit the current repository configuration.

Delete a repository in an attached GraphDB location

DELETE /rest/repositories/<repo_id>


curl -X DELETE <base_url>/rest/repositories/<repo_id>?location=<encoded_location_uri>


Common parameters:

<base_url>: The URL host and path leading to the deployed GDB Workbench web app;

<location_uri>: File system path of the physical location of the repo (could be local or remote);

<encoded_location_uri>: URL encoded file system path of the physical location of the repo (could be local or remote);

<repo_id>: The id string with which the current repository can be referred to;

<repo_title>: Human-readable name of the current repository;

<repo_type>: Type of the repository, could be se, worker, master.

Repository Monitoring

Get repository statistics

GET /rest/monitor/repository/{repositoryID}


curl -X GET --header 'Accept: application/json' '<base_url>/rest/monitor/repository/<repo_id>'