[Mulgara-general] CRUD Operations in Java

Alex Hall alexhall at revelytix.com
Fri Jul 17 13:13:57 UTC 2009


David Legg wrote:
> Alex Hall wrote:
>> All of these operations (load, delete, and drop) are supported by the
>> new REST interface to Mulgara.  More information is available on the
>> wiki at [http://mulgara.org/trac/wiki/RESTInterface].
>>   
> 
> Thanks for the link Alex.  I'm a little confused by what's stated on the 
> page though.
> 
> It states a SPARQL interface is available at localhost:8080/sparql/ and 
> reminds us that SPARQL is query only.  Later it states a read only 
> interface is also available at localhost:8081/sparql/.
> 
> The obvious question is if the 8080 port version can only do read only 
> what's the 8081 port for?

That's a good question, and I had to look up the answer myself.  While
the SPARQL *language* is read-only, you can also invoke CRUD operations
on the SPARQL servlet interface running on port 8080 by using the REST
operations.  In other words, the HTTP interface for SPARQL is a fully
compliant implementation of the SPARQL protocol, but is overloaded with
additional REST methods.  Those REST methods can be invoked by omitting
the "query" parameter and using an HTTP POST, PUT, or DELETE as
described on the wiki.  The public version disables the POST, PUT, and
DELETE methods, restricting clients to use HTTP GET requests (with or
without a "query" parameter) which by definition are read-only.

Note that there is no equivalent public read-only HTTP interface for
TQL.  Even restricting the TQL interface to only handle HTTP GET would
not be enough to guarantee read-only functionality, due to the fact that
TQL commands may specify CRUD operations.  You would have to examine
every incoming command to ensure that it doesn't try to modify the
database, and I suppose Paul didn't think it was worth it. :-)

Finally, let me point out that the REST methods on the SPARQL and TQL
interfaces are a non-standard protocol extension.  There has been talk
of adding support for graph modifications specified via REST methods to
the next version of SPARQL, as discussed at
[http://www.w3.org/TR/2009/WD-sparql-features-20090702/#protocol-update].
 If you find these methods useful and would like to see them
standardized, I would encourage you to speak up and make those wishes known.

Regards,
Alex



More information about the Mulgara-general mailing list