I know how to query graphdb using url or ajax call, just call the server using: http://localhost:8080/repositories/repo_name?query=somequery and the result will be returned.

I'm wondering if I can use similar methods to import statements into graphdb? for example the query could be: insert {http://something :predicate :object . http://something :predicate2 :object2 .}

But if I use: http://localhost:8080/repositories/repo_name?query=insert {http://something :predicate :object . http://something :predicate2 :object2 .}

it does not work (the query is encoded in url format).

do you know how to do this?

asked 09 Oct '15, 21:29

al3xtouch's gravatar image

accept rate: 0%

GraphDB uses the Sesame 2.7 REST API (which is basically an extended version of the SPARQL protocol). You can find complete documentation of this REST API in the Sesame 2.7 system documentation.

To do SPARQL updates via this API, you need to use a different URI:


and also a different parameter: update instead of query. You can send a SPARQL update by doing a POST request. See the section on repository statements in the documentation for further details on which encoding and which parameters to supply.


answered 09 Oct '15, 23:27

Jeen%20Broekstra's gravatar image

Jeen Broekstra
accept rate: 66%

we have cURL examples for using the OpenRDF REST API with GraphDB, check out the documentation for the database-as-a-service at http://docs.s4.ontotext.com/display/S4docs/Fully+Managed+Database

in particular:

  • uploading statements from file: link text
  • uploading statements via SPARQL Update link text




answered 14 Oct '15, 23:23

Marin%20Dimitrov's gravatar image

Marin Dimitrov
accept rate: 0%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported



Asked: 09 Oct '15, 21:29

Seen: 983 times

Last updated: 18 Aug '16, 03:36

powered by BitNami OSQA