The following Update script:

with <urn:testing:uuidTest> 

insert {<urn:test:s1> <urn:test:p1> ?o} where {   
  BIND (URI( CONCAT("http://example.org/";, STRUUID() )) as ?o) 
}

works fine when run from the Fuseki query Editor. As you would expect, I can 
see a triple with a UUID as the literal. However, when run the same query 
through the SPARQL endpoint API like this:
        String queryString = "with <urn:testing:uuidTest> insert {<urn:test:s1> 
<urn:test:p1> ?o} where { "
                + "  BIND (URI( CONCAT(\"http://example.org/\";, STRUUID() )) as 
?o) "
                + "} ";

        UpdateRequest update = UpdateFactory.create(queryString);
        UpdateRemote.execute(update,  "http://localhost:3030/ds/update";);

there are no triples in <urn:testing:uuidTest>. However, if I wrap the call to 
STRUUID() in STR():
... " BIND (URI( CONCAT(\"http://example.org/\";, STR(STRUUID()) )) as ?o) " ...

then everything works properly. Why do I need the STR when using the API and 
not in Fuseki? I wouldn't expect to need it in either case.
I'm using Fuseki server built from the SVN trunk, revision 1409883 (a bit 
behind); and the API is using Jena ARQ 2.9.4 and Fuseki 0.2.5 (from the maven 
repo with the latest releases).

Thank you for your help!
-Elli

Reply via email to