update


Description:

public void update (string sparql, Cancellable? cancellable = null) throws Error

Executes a SPARQL update on this.

This method is synchronous and will block until the update is finished. See [method@SparqlConnection.update_async] for an asynchronous variant.

It is recommented to consider the usage of [class@Batch] to cluster database updates. Frequent isolated SPARQL updates through this method will have a degraded performance in comparison.

If the query is partially built from user input or other untrusted sources, special care is required about possible SPARQL injection. In order to avoid it entirely, it is recommended to use [class@SparqlStatement], or to build the SPARQL input through [class@Resource]. The function [func@sparql_escape_string] exists as a last resort, but its use is not recommended.

Parameters:

this

A `TrackerSparqlConnection`

sparql

String containing the SPARQL update query

cancellable

Optional [type@Gio.Cancellable]