Re: Linked Data Platform ISSUE-20: What is the base URI of a POSTed document?

On 10/10/12 18:05, Henry Story wrote:
>
> On 10 Oct 2012, at 17:03, Andy Seaborne <andy.seaborne@epimorphics.com> wrote:
>
>> This does have a real consequence to implementation:
>>
>> A design that
>>
>> 1/ receive POST -- some general receipt handling
>> 2/ content-type: parse body as RDF
>> 3/ Decide it's a container
>> 4/ dispatch request to container
>> 5/ Create new BPR
>>
>> trying to create an abstraction of "incoming RDF", does not work because the parsing happens before the operation is known to be a container with specific action of creating the new BPR.
>
> There are a few answers to that:
>
>   A. you simply don't parse the RDF and just serialise it to disk into
>    the file name created around 3 in your design. Doing that everything will
>    work just right, because the relative URLs will automatically turn into
>    the right URLs when fetched in the next round.
>     (I imagine that this is exactly what MUST happen in WebDAV or Atom)

Aside: I think this is pushing it a bit too far - RDF is a data model, 
Turtle a transfer syntax.  The Turtle bytes aren't the data - the RDF 
triples (absolute URIs) are.

>
>   B. You parse the incoming stream into a graph that accepts relative URLs,
>     and then in 3/ either
>       a- place it into a store that accepts relative URLs
>       b- resolve the URLs against the full store url
>
>    C. You delay the parsing until around 3 or 4 when you know the full
>     URL.

No dispute it can be implemented but if the particular implementation 
choice is forced I think we are in (a minor) "willful violation" of RFC 
3986. Implementation choices should be invisible.

> The fact that A works, is very good reason to believe that my proposal -
> which Steve Battle named A) is the correct design.
>
> B seems to make a good case for having at least parsers that can parse
> documents with relative URLs without needing to resolve them.

That would be a change - the output would not be strict RDF.  The data 
would have to be modified later to "correct" the URIs.

> C. Should be quite possible to do, since downloading documents should
> be done asynchronously, and takes time, whereas finding out from the
> path that a resource needs to be created can be done extremely quickly.

In the SPARQL GSP, POST to a graph means "add triples" - this is inline 
with RFC 2616 where it says POST can be "Extending a database through an 
append operation".   The base URI is the target graph, there being only 
one URI to consider.

We could phrase is as "the base URI is the target of the request" and 
then make the target the newly create resource.

Base URIs matter a lot more in RDF syntax - we're just pushing the 
boundaries of specs not designed with the current (new) usage in mind.

	Andy

Received on Thursday, 11 October 2012 09:07:04 UTC