[Mulgara-general] TQL and mulgara WAR

Paul Gearon gearon at ieee.org
Wed Sep 2 19:09:22 UTC 2009


On Wed, Sep 2, 2009 at 8:34 AM, Chuck Borromeo<cborromeo3 at yahoo.com> wrote:
> Hi Paul,
>  In previous posts to the user group it seems like TQL is being phased out in favor of HTTP.  Therefore, I should use HTTP instead of TQL.  Don't worry about fixing the TQL code.

Not exactly. RMI is being phased out in favor of HTTP. (both being
network protocols).

TQL is a command and query language, and while it isn't being phased
out, it is starting to take a back seat to SPARQL. However, SPARQL
does not (yet) do updates on data, so TQL is still needed. We also
have a REST interface that duplicates some of the TQL functionality,
and since this is a such a popular mechanism in general, I've been
encouraging its use.

>  Can you provide an example of using the POST to load an RDF file into a graph?  I tried using this command, but I get a 400 error:
>
> http://localhost:8899/sparql/?graph=http://www.ucdmc.ucdavis.edu/ctsc/UC_Davis_Biositemap_INF.rdf&default-graph-uri=http://sw.dbmi.pitt.edu/ctsa

The POST is expecting the graph to be provided as an uploaded file,
and the graph (or default-graph-uri) parameter to be provided in the
body of the request as well. This makes it compatible with HTML forms.
So an example POST would look like this:

=== Start of request ===

POST /sparql/ HTTP/1.1
Content-Length: 680
Content-Type: multipart/form-data;
boundary=lQzU3L2h97jLLaKzyVi-S5Rfsx4zoWbaKYGsP
Host: localhost:8080
Connection: Keep-Alive
User-Agent: Apache-HttpClient/4.0-beta2 (java 1.5)

--lQzU3L2h97jLLaKzyVi-S5Rfsx4zoWbaKYGsP
Content-Disposition: form-data; name="default-graph-uri"
Content-Type: text/plain; charset=MacRoman
Content-Transfer-Encoding: 8bit

sparql:data
--lQzU3L2h97jLLaKzyVi-S5Rfsx4zoWbaKYGsP
Content-Disposition: form-data; name="data"; filename="data.rdf"
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

<?xml version="1.0"?>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:testdb="test:">
<rdf:Description rdf:about = "test:s01" >
  <testdb:p01 rdf:resource="test:o01"/>
  <testdb:p01 rdf:resource="test:o04"/>
</rdf:Description>
</rdf:RDF>

--lQzU3L2h97jLLaKzyVi-S5Rfsx4zoWbaKYGsP--

=== End request ===


Note that this post used a plain content type, so the server uses the
filename extension to figure out that the file is RDF/XML. It's better
to provide the correct Content-Type if possible.

> I was able to use the POST command and load the RDF file into a graph called "http://www.ucdmc.ucdavis.edu/ctsc/UC_Davis_Biositemap_INF.rdf".  However, I want to call my graph "http://sw.dbmi.pitt.edu/ctsa".

You can see the graph name in my example is "sparql:data". Just
provide "http://sw.dbmi.pitt.edu/ctsa" instead.

> Also, can you provide an example of using the DELETE command to delete all the triples from a graph named http://sw.dbmi.pitt.edu/ctsa?

The easiest thing to do is just drop and re-create the graph:

delete <http://sw.dbmi.pitt.edu/ctsa>;
create <http://sw.dbmi.pitt.edu/ctsa>;

But you can also do the following:

delete select $s $p $o from <http://sw.dbmi.pitt.edu/ctsa> where $s $p
$o from <http://sw.dbmi.pitt.edu/ctsa>;


Regards,
Paul

> ----- Original Message ----
> From: Paul Gearon <gearon at ieee.org>
> To: Mulgara General <mulgara-general at mulgara.org>
> Sent: Tuesday, September 1, 2009 3:27:29 PM
> Subject: Re: [Mulgara-general] TQL and mulgara WAR
>
> On Tue, Sep 1, 2009 at 3:00 PM, Chuck Borromeo<cborromeo3 at yahoo.com> wrote:
>> Hello,
>>  I have been able to use TQL to load data into mulgara running on my local machine as a .jar file.  Using my code, I can load RDF/XML files using TQL into the .jar mulgara instance.  I am now attempting to move this process to a development server.  I have deployed the mulgara war file to another machine.  What is the rmi connection string used when mulgara is deployed as a .war?  If I am using the .jar file the rmi connection is: "rmi://localhost/server1".  The server1 corresponds to the directory structure on my machine: [installdir]\mulgara-2.1.2\dist\server1.  I cannot find a connection string that works for the .war deployed server.  There is a directory called /tmp/mulgara/server1/ and it appears to store the same information.
>
>
> When deploying as a WAR file, I always access Mulgara through HTTP,
> meaning that I use a POST command to
> http://localhost:8080/sparql/?graph=graphURI
>
> (http://mulgara.org/trac/wiki/RESTGraphs)
>
> Because I'm so focused on HTTP, I haven't been checking RMI when I'm
> using this configuration, so I could believe that it's broken. I'm
> still setting up my new office, but if you can give me a couple of
> days, and I ought to be able to fix it soon.
>
> Regards,
> Paul
> _______________________________________________
> Mulgara-general mailing list
> Mulgara-general at mulgara.org
> http://mulgara.org/mailman/listinfo/mulgara-general
>
>
>
>
> _______________________________________________
> Mulgara-general mailing list
> Mulgara-general at mulgara.org
> http://mulgara.org/mailman/listinfo/mulgara-general
>



More information about the Mulgara-general mailing list