On 19/01/2021 10:47, Siddharth Trikha wrote:
Hi,

I am trying to run a SPARQL Update operation on my TDB database running behind 
a Fuseki Server.

As per the API I found there, I am able to run something like this:

String updateQuery = "WITH <http://example.org/Employee>\n" +
                                "DELETE { ?person 
<http://bigco.example/HR/Person/fname> 'William' }\n" +
                                "INSERT { ?person 
<http://bigco.example/HR/Person/fname> 'Wolly' }\n" +
                                "WHERE\n" +
                                "  { ?person <http://bigco.example/HR/Person/fname> 
'William'\n" +
                                "  } ";

try ( RDFConnectionFuseki conn = (RDFConnectionFuseki)builder.build() ) {
                        
                        conn.update(updateQuery);
}


This works fine.

However, my SPARQL UPDATE query will not contain GRAPH name and I couldn't find 
an API method where I could pass the GRAPH name as a method argument.

I could find APIs for passing graph name as an argument for following SPARQL 
operations like:

conn.fetch(graphName)
conn.load(graphName, Model)
conn.put(graphName, Model)

However, for update there was just "conn.update(updateQuery)"

Am I missing something here ?

A SPARQL Update operates on a dataset, not am individual graph.

You have to say in the update which graph you are targeting much like which subjects are affected.

    Andy


BR
Siddharth Trikha

Reply via email to