[Mulgara-general] Mulgara API's
Life is hard, and then you die
ronald at innovation.ch
Sat Feb 23 00:48:15 UTC 2008
On Fri, Feb 22, 2008 at 02:12:03PM -0600, Paul Gearon wrote:
> On Fri, Feb 22, 2008 at 10:35 AM, Alex Hall <alexhall at revelytix.com> wrote:
[snip]
> > This seems to imply that graph URL's and URI's have been disambiguated.
> > Back when I was last working with this software, every graph URI was
> > also a URL using the rmi:// protocol (for graphs stored on a Mulgara
> > server, that is), and the URI was overloaded to be both a label and a
> > locator. Is this no longer the case?
>
> Not exactly, but we ARE getting there. The client side stuff has been
> updated to allow you to use any URI you like for a model name.
> ItqlInterpreterBean will still try to use the protocol and authority
> to find a server, but that is for backward compatibility. If you use
> the API, then the following nearly works:
>
> // get a connection
> ConnectionFactory factory = new ConnectionFactory();
> Connection conn = factory.newConnection("rmi://localhost/server1");
>
> // set up the commands
> URI model = URI.create("foo:bar:baz");
> Command create = new CreateGraph(model, MODEL_TYPE);
> Command load = new Load(dataFile.toURI(), model, false);
> Command query = new TqlInterpreter().parseCommand("select $s $p $o
> from <" + model + "> where $s $p $o;");
>
> // execute the commands
> create.execute(conn);
> load.execute(conn);
> Answer a = (Answer)query.execute(conn);
>
>
> From a client perspective, this all works perfectly. However, at the
> server end, the CreateModelOperation class checks if the model has a
> fragment, and fails at this point. This appears to be a bug, as
> opaque URIs are handled elsewhere in the class. I want to test that
> it works properly with resolvers, but I ought to be able to fix this
> very soon, and the above code will work.
Oh, that is good news. Because we'll be switching from soap (all
models are "local:...") to rmi, I've just been thinking that we'll
have to dump all our models individually before the upgrade and then
restore each individually. Not a huge problem, but much nicer if we
don't have to do that. :-)
Cheers,
Ronald
More information about the Mulgara-general
mailing list