4

I'm a newbie to Sparql, but I am unable even to make a simple insert data query, or so it seems.

I'm using Apache Fuseki as working server; I'm in a graph, and I'm trying to make this query work:

PREFIX oa: <http://www.w3.org/ns/oa#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>

INSERT DATA{             
  [ a 
    oa:Annotation ;                    
    rdfs:label "Title";                    
  ] .                    
}

But it doesn't matter what I do, I keep getting this error:

Error 400: SPARQL Query: No 'query=' parameter

This is even a semplified code, I tried many queries even more complex, but the result doesn't change...

tenik
  • 250
  • 1
  • 4
  • 20

2 Answers2

7

In SPARQL, query and update are different operations. In Fuseki, they reside on different endpoints (so query can be be more widely accessible than update).

You are calling the query endpoint (.../query or .../sparql usually) ; you need to call the update (.../update).

AndyS
  • 16,345
  • 17
  • 21
0

There is a syntax error with your turtle in the SPARQL update

instead of

  [ a 
    oa:Annotation ;                    
    rdfs:label "Title";                    
  ] .     

use

  [ a 
    oa:Annotation ;                    
    rdfs:label "Title"                    
  ] . 
William Greenly
  • 3,914
  • 20
  • 18
  • The first form is legal syntax though better (?) not written that way. It's legal in Turtle as well. http://www.sparql.org/update-validator.html – AndyS Sep 01 '15 at 08:49
  • Going by the example here http://www.w3.org/TR/turtle/#BNodes , but you are right – William Greenly Sep 01 '15 at 10:57