I am trying to do a simple insert query in the web interface of Fuseki server. I have set the endpoint to /update
(instead of the default /sparql
).
I h
The document you're referencing is the 2008 SPARQL Update submission, not the actual 2013 SPARQL 1.1 recommendation. The recommendation is the actual standard, the submission is not.
An update (insert or delete) isn't a query (select, ask, construct), and the syntax for the two kinds of query aren't necessarily the same. You note (correctly) that WHERE is optional in a select query, but that doesn't mean that it's optional in an insert. There are two forms of insert. There's INSERT DATA which has the syntax:
INSERT DATA QuadData
and there's DELETE/INSERT which has the syntax:
( WITH IRIref )?
( ( DeleteClause InsertClause? ) | InsertClause )
( USING ( NAMED )? IRIref )*
WHERE GroupGraphPattern
DeleteClause ::= DELETE QuadPattern
InsertClause ::= INSERT QuadPattern
So if you're using INSERT { … }, then that's the InsertClause of a DELETE/INSERT form, and you need to follow it with WHERE …. Since you're using static data, you should probably just use the INSERT DATA form:
PREFIX dc: <http://purl.org/dc/elements/1.1/>
INSERT DATA { <http://example/egbook3> dc:title "This is an example title" }