The standard way to talk to RDF databases (such as Fuseki) is with a language 
called SPARQL: "SPARQL Protocol And RDF Query Language". It is the SQL of RDF 
land.

There are many great resources for learning SPARQL, but you can hardly do 
better than the spec itself: https://www.w3.org/TR/sparql11-query/ (Be aware: 
SPARQL Query is for reading only; SPARQL Update is for modifying.)

If you don't want to learn SPARQL, there is also a Graph Store Protocol which 
lets you communicate more naturally via POST, GET, etc. but is less powerful.

You need to decide if you want to:

(1) make a SPARQL Update (which works without much configuration, but requires 
knowledge of SPARQL); or

(2) use the Graph Store Protocol (which I think requires some configuration on 
Fuseki, but lets you post the file directly).

You must also set the Content-Type header on your HTTP request to 
"application/sparql-update" for SPARQL updates; "application/sparql-query" for 
SPARQL queries; or the appropriate RDF type ("text/turtle", "application/trig", 
etc.) for the Graph Store Protocol. If you need a refresher on HTTP headers, 
see this MDN page: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers

Other useful links:

SPARQL 1.1 Protocol: https://www.w3.org/TR/sparql11-protocol/

Graph Store Protocol:
https://www.w3.org/TR/sparql11-http-rdf-update/

On Tue, Jun 21, 2022, at 21:00, Dương Hồ wrote:
> Hi all,
> I am trying send axios.post update from ReactJS to Fuseki.
> 
> axios.post('http://127.0.0.1:3030/myDataset/update', file)
> The file is a owl file save from protege. 
> but this have an error with status code : 415 Unsupported Media Type.
> Must be application/sparql-update or application/x-www-form-urlencoded (got
> application/json)
> 
> Can you help me how to update and query in Fuseki?
> 

Reply via email to