[Mulgara-dev] Graph Partitions

Paul Gearon gearon at ieee.org
Tue Jun 9 13:36:40 UTC 2009


On Tue, Jun 9, 2009 at 5:19 AM, Agustina Martinez<amgcia at gmail.com> wrote:
> Hi Paul,
>
> How are you? I have one quick doubt. I am trying to use the export command
> with local download. When I try it from the WebUI I get this error:
>
> Error executing command. Reason: LOCAL modifier is not valid for EXPORT
> command when not using a client-server connection.

This is because the command interpreter has no way to talk directly to
your computer.

However, it might be nice to pick up things like this and have it
download a file. I'll give some thought as to the best interface for
this.

(Maybe a "Download" button next to the graph field? The page already
feels cluttered, and I don't want to make it worse).

> So is there another interface through which I can use the export command and
> download the files into my computer?

Use the SPARQL endpoint. The next release will just let you GET a
graph, but for the moment, you need to CONSTRUCT it. The query you
want is:

CONSTRUCT {?s ?p ?o} FROM <your:graph> WHERE {?s ?p ?o}

Of course, you should adjust the name of the graph as appropriate. To
do this you access the following URL:

http://localhost:8080/sparql/?query=CONSTRUCT+%7B%3Fs+%3Fp+%3Fo%7D+FROM+%3Cyour%3Agraph%3E+WHERE+%7B%3Fs+%3Fp+%3Fo%7D

You can type this into a browser, or use a utility like curl or wget.
The response will be an RDF/XML file. To get an N3 file you either
specify this in the header fields of the request (not possible with a
browser) or you add the following parameter to the end of the URL:
format=n3

So the URL would become:

http://localhost:8080/sparql/?query=CONSTRUCT+%7B%3Fs+%3Fp+%3Fo%7D+FROM+%3Cyour%3Agraph%3E+WHERE+%7B%3Fs+%3Fp+%3Fo%7D&format=n3

Regards,
Paul



More information about the Mulgara-dev mailing list