Tracker.SparqlConnection.update_blank

### Method

# Tracker SparqlConnectionupdate_blank

deprecated: 3.5

#### Declaration [src]

    GVariant*
    tracker_sparql_connection_update_blank (
      TrackerSparqlConnection* connection,
      const gchar* sparql,
      GCancellable* cancellable,
      GError** error
    )

#### Description [src]

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

This method is synchronous and will block until the update is finished. See `tracker_sparql_connection_update_blank_async()` for an asynchronous variant.

The `sparql` query should be built with `TrackerResource`, or its parts correctly escaped using `tracker_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 `_:foo`) and the URN that was generated for it. For most updates the first two outer arrays will only contain one item.

Deprecated since: 3.5

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 #TRACKER_SPARQL_CONNECTION_FLAGS_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).

#### Parameters

`sparql`

  Type: `const gchar*`

  String containing the SPARQL update query.

  The data is owned by the caller of the method.
  The value is a NUL terminated UTF-8 string.

`cancellable`

  Type: `GCancellable`

  Optional `GCancellable`

  The argument can be `NULL`.
  The data is owned by the caller of the method.

`error`

  Type: `GError **`

  The return location for a recoverable error.

  The argument can be `NULL`.
  If the return location is not `NULL`, then you must initialize it to a `NULL` `GError*`.
  The argument will be left initialized to `NULL` by the method if there are no errors.
  In case of error, the argument will be set to a newly allocated `GError`; the caller will take ownership of the data, and be responsible for freeing it.

#### Return value

Type: `GVariant`

A `GVariant` with the generated URNs.

The caller of the method takes ownership of the data, and is responsible for freeing it.