SPARQL 1.1 Graph Store spec rather misleading

http://www.w3.org/TR/2013/REC-sparql11-http-rdf-update-20130321/#http-post

In this section it states:

[[
The following two operations are considered to have the same effect

    POST /rdf-graph-store?graph=..graph_uri.. HTTP/1.1
    Host: example.com
    Content-Type: text/turtle

    ... RDF payload ...

    INSERT DATA { GRAPH <graph_uri> { .. RDF payload .. }
]]

The problem is, taken literally the INSERT operation won't work. For
example:

INSERT DATA { GRAPH <http://schema.org/terms/>
{

@PREFIX schema: <http://schema.org/> .
...
schema:Thing ...
}}

The RDF payload has to be tweaked to make it compatible with the SPARQL
syntax, something like:

PREFIX schema: <http://schema.org/>

INSERT DATA { GRAPH <http://schema.org/terms/>
{
schema:Thing ...
}}

I just got caught out by this, building the SPARQL via a templating engine.
Ok, it took all of a minute to realise what was happening. But still,
anyone coming to the docs for the first time might not be so lucky (as it
is, I'll have to rethink my approach with the templates).

Cheers,
Danny.

Received on Thursday, 17 September 2015 00:11:27 UTC