W3C home > Mailing lists > Public > public-linked-json@w3.org > November 2011

Re: HTTP POST and @subject IRI

From: Thomas Steiner <tomac@google.com>
Date: Thu, 3 Nov 2011 18:58:23 +0100
Message-ID: <CALgRrLnTksZ9eXP0Yi2AOvsi14-QO9GGhdWpDYz3UkGXXAnVDg@mail.gmail.com>
To: Werner Wilms <contact@blue-age.de>
Cc: public-linked-json@w3.org
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?


Thomas Steiner, Research Scientist, Google Inc.
http://blog.tomayac.com, http://twitter.com/tomayac
Received on Thursday, 3 November 2011 17:59:42 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 16:18:32 UTC