update_blank


Description:

[ Version ( deprecated = true , deprecated_since = "3.5" ) ]
public Variant update_blank (string sparql, Cancellable? cancellable = null) throws Error

Warning: update_blank is deprecated since 3.5.

Executes a SPARQL update and returns the names of the generated blank nodes.

Note:

This function makes the expectation that blank nodes have a durable name that persist. The SPARQL and RDF specs define a much more reduced scope for blank node labels. This function advises a behavior that goes against that reduced scope, and will directly make the returned values meaningless if the ANONYMOUS_BNODES flag is defined in the connection.

Users that want names generated for them, should look for other methods (e.g. IRIs containing UUIDv4 strings).

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

The sparql query should be built with [class@Resource], or its parts correctly escaped using [func@sparql_escape_string], otherwise SPARQL injection is possible.

The format string of the `GVariant` is `aaa{ss}` (an array of an array of dictionaries). The first array represents each INSERT that may exist in the SPARQL string. The second array represents each new node for a given WHERE clause. The last array holds a string pair with the blank node name (e.g. `foo` for the blank node `_TrackerSparqlConnection:foo`) and the URN that was generated for it. For most updates the first two outer arrays will only contain one item.

Parameters:

this

A `TrackerSparqlConnection`

sparql

String containing the SPARQL update query

cancellable

Optional [type@Gio.Cancellable]

Returns:

a [type@GLib.Variant] with the generated URNs.