Re: HTTP POST and @subject IRI

Hi Werner,

> I'm not sure if this was discussed before, because I subscribed only
> recently to this list. A (admittingly only short) research in the
> archive didn't answer my question:
>
> I'm trying to do a HTTP POST for a newly to create subject with a
> json-ld message from the client to the server.
>
> Unfortunately I have no idea what the identifier of the subject will be,
> because the server will define it. So I can't give a full IRI yet. What
> can I do to cope with that? Right now I have my own tool parsing the
> json, but I want to use one of your API implementations soon, and I
> guess they won't let me pass without a subject, right? Because you can't
> build triples without a subject, correct?

I guess the question is more an underlying REST design principle. This
article http://www.infoq.com/articles/webber-rest-workflow describes
the idea quite well.

Short: you do a POST to a generic resource /things. The server
responds with a 201 Created response telling you the Location where it
has generated the actual thing, like /things/123. Then you can use
this Location as the subject.

Does this help?

Best,
Tom

-- 
Thomas Steiner, Research Scientist, Google Inc.
http://blog.tomayac.com, http://twitter.com/tomayac

Received on Thursday, 3 November 2011 17:59:42 UTC