cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From thomas <tho...@stray.net>
Subject Re: how to access a database RESTfully
Date Tue, 23 May 2006 08:15:10 GMT
Hi,

the documentation of the Sesame HTTP communication interface [1] specifies 
methods to query and update the database server. E.g.:

GET /sesame/repositories/myRep?query=select%20foo%3Abar&queryLn=serql 
HTTP/1.1
Host: localhost
Accept: application/sparql-results+xml

PUT /sesame/repositories/myRep HTTP/1.1
Host: localhost
Content-Type: application/rdf+xml
[RDF/XML-encoded data]

POST /sesame/repositories/myRep HTTP/1.1
Host: localhost
[TRANSACTION DATA]

DELETE /sesame/repositories/myRep HTTP/1.1
Host: localhost


For a start I would like to set up a simple application with a form-based 
input page to send messages to the database server and some transformer 
that handles the messages that the database server sends back as a result 
(and some serializer of course). In general the procedure of how to get a 
Cocoon based application running is clear to me. I'm in trouble with 
sending and receiving the HTTP-requests.

I imagine a page with a form from which i can send those requests to the 
database server, something like a textarea in which I can type a query and 
a button to submit it. But I don't know if I need different 
textareas+buttons for GET, PUT, POST and DELETE. And i don't know how to 
suck in the results that the database sends back.


BTW, if anyone has already set up a transformer to access Sesame 2 via it's 
Java API - please don't hesitate to offer it to me :-) I was going for the 
HTTP-interface because my first guess was that this would be the easiest 
way to get going, but maybe I'm wrong.


Thanks again,
Thomas




[1] http://openrdf.org/doc/sesame2/system/ch08.html





--On Montag, 22. Mai 2006 17:40 Uhr -0400 ian.d.stewart@jpmchase.com wrote:

> Hi Thomas,
>
> In order to RESTfully interact with a resource, you will need two pieces
> of information:
>
> 1) The address of the resource, in the form of a URI (Uniform/Universal
> Resource Identifier)
> 2) The operation to be performed on the resource, in the form of an HTTP
> method (GET, POST, PUT, DELETE, etc)
>
> If by 'access' you mean to retrieve a representation of the resource, you
> should be able to do this with a standard Cocoon generator or reader.  I
> don't believe that Cocoon supports non-GET requests, so if you need to do
> anything other than GET, you will probably have to pursue a different
> approach.
>
> Perhaps if you could provide more information on how you are try to access
> the resource, what you are expecting from a successful operation, and how
> you intend on incorporating this within your current Cocoon-based app,
> people can provide more specific assistance.
>
>
> HTH,
> Ian
>
> It's better to be hated for who you are
> than loved for who you are not
>
> Ian D. Stewart
> Appl Dev Analyst-Advisory, DCS Automation
> JPMorganChase Global Technology Infrastructure
> Phone: (614) 244-2564
> Pager: (888) 260-0078
>
>
>
>               thomas
>               <thomas@stray.net
>               >
> To                                         users@cocoon.apache.org
>               05/22/2006 05:14
> cc               PM
>
> Subject                                         how to access a database
> RESTfully                Please respond to
>               users@cocoon.apac
>                    he.org
>
>
>
>
>
>
>
>
> Hi,
>
> I want to access a RDF data store named Sesame 2, which provides a RESTful
> API, with GET, POST, PUT and DELETE. Initially I assumed this should be
> rather easy even for a beginner like me but I couldn't find any tutorial
> or
>
> example how this can be done without writing some Java code which I can't.
>
> Thanks for any help,
> Thomas
>
> .
> mailto:thomas@stray.net
> http://stray.net
>
> ..
> early optimization is the root of many evil
> donald e. knuth
>
> ...
> Ab 1948 lehrte Turing an der Universität in Manchester. 1952 schrieb er
> ein Schachprogramm. Ohne über einen Computer mit genügend Leistung zu
> verfügen, um es auszuführen, übernahm Turing dessen Funktion und
> berechnete jeden Zug selbst, was ihn um die 90 Minuten pro Zug kostete.
> Das einzige
> mitgeschriebene Spiel verlor er gegen einen Kollegen.
> http://de.wikipedia.org/wiki/Turing
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message