Re: Reinventing Web applications

Hey Markus,

>> We do limit ourselves to simple container/item models and CRUD
>> operations. That is why HTTP and REST have been successful.
>
> Really? That's new to me. REST is definitely not about CRUD.

As much as I remember from Fielding's thesis, one of the keys to REST
(and the scalability of current Web architecture) is uniform
interface:
http://www.ics.uci.edu/~fielding/pubs/dissertation/rest_arch_style.htm#sec_5_1_5

In HTTP world, those are uniform methods, and they can be treated as
CRUD operations (what Fielding calls "manipulation of resources
through representations").

>> And how exactly is creating a resource different from ordering a
>> product? Don't our actions on Web services eventually translate to
>> state changes?
>
> Wouldn't you like to know whether your credit card gets charged if you create an order resource?

The server can send you an RDF response describing the charge, using
an appropriate vocabulary. The question is, will the client be able to
comprehend it?

>> The implementation is currently ahead of the specification. That's why
>> I wanted to bounce some ideas and then develop the spec further.
>
> Fair enough. So, what is the implementation doing?
>

In case of pagination on containers, lets assume the request matched a
resource class via URI template. Then the processor:

- retrieves DESCRIBE or CONSTRUCT query attached to the resource class
- checks if accessed resource has type ldp:Container
- if yes:
-- it retrieves the first (considered main) sub-SELECT from the query
(which is mandatory for container queries)
-- it sets query solution modifiers on that SELECT: OFFSET using
&offset= query param values, LIMIT using &limit= etc. ORDER BY and
DESC are also supported to some extent.
- if no: the query is not modified

Then the processing continues as normal: the query is sent to the
triplestore, RDF response comes back and is returned or rendered. The
main logic is here:
https://github.com/Graphity/graphity-browser/blob/master/src/main/java/org/graphity/processor/model/ResourceBase.java


Martynas
graphityhq.com

Received on Tuesday, 24 June 2014 10:55:57 UTC