15.157 SEM_APIS.UPDATE_RDF_GRAPH

Format

SEM_APIS.UPDATE_RDF_GRAPH(
     apply_rdf_graph     IN VARCHAR2, 
     update_stmt         IN CLOB, 
     match_models        IN SEM_MODELS DEFAULT NULL, 
     match_rulebases     IN SEM_RULEBASES DEFAULT NULL, 
     match_index_status  IN VARCHAR2 DEFAULT NULL, 
     match_options       IN VARCHAR2 DEFAULT NULL, 
     options             IN VARCHAR2 DEFAULT NULL,
     network_owner       IN VARCHAR2 DEFAULT NULL,
     network_name        IN VARCHAR2 DEFAULT NULL);

Description

Executes a SPARQL update statement on an RDF graph.

Parameters

apply_rdf_graph

Name of the RDF graph to be updated. This is the name specified when the graph was created using the SEM_APIS.CREATE_RDF_GRAPH procedure.

It cannot be an RDF graph collection (see RDF Graph Collections) or an RDF view).

update_stmt

One or more SPARQL update commands to be executed on the apply_rdf_graph graph. Use the semicolon (;) to separate commands.

match_models

A list of RDF graphs that forms the SPARQL data set to query for graph pattern matching during a SPARQL update operation (INSERT WHERE, DELETE WHERE, COPY, MOVE, ADD). Can include RDF graph collections and/or RDF views If this parameter is not specified, the apply_rdf_graph graph is used.

match_rulebases

A list of rulebases to use with match_models to provide an inferred graph that generates additional triples or quads to use for graph pattern matching during a SPARQL update operation.

match_index_status

The desired status for any inferred graphs used for graph pattern matching during a SPARQL update operation.

match_options

String specifying hints to influence graph pattern matching during a SPARQL update operation. The set of hints that can be used here is identical to those that can be used in the options parameter of SEM_MATCH.

options

String specifying hints that affect SPARQL operations. See the Usage Notes for a list of available options.

network_owner

Owner of the RDF network. (See Table 1-2.)

network_name

Name of the RDF network. (See Table 1-2.)

Usage Notes

Before using this procedure, be sure you understand the material in Support for SPARQL Update Operations on an RDF Graph.

The options parameter can specify one or more of the following options:

  • APP_TAB_IDX={INDEX_NAME} uses an INDEX optimizer hint for INDEX_NAME when doing DML operations on the application table.

  • APPEND uses the SQL APPEND hint with DML operations.

  • AUTOCOMMIT=F avoids starting and committing a transaction for each SEM_APIS.UPDATE_RDF_GRAPH call. Instead, this option gives transaction control to the caller. Each SEM_APIS.UPDATE_RDF_GRAPH call will execute as part of a main transaction that is started, committed, or rolled back by the caller.

  • BULK_OPTIONS={OPTIONS_STRING} uses OPTIONS_STRING as the flags parameter when calling SEM_APIS.BULK_LOAD_FROM_STAGING_TABLE.

  • CLOB_UPDATE_SUPPORT=T turns on CLOB functionality.

  • DEL_AS_INS=T performs a large delete operation by inserting all data that should remain after the delete operation instead of doing deletions. This option may significantly improve the performance of large delete operations.

  • DYNAMIC_SAMPLING(n) uses DYNAMIC_SAMPLING(n) SQL optimizer hint with query operations.

  • FORCE_BULK=T uses the SEM_APIS.BULK_LOAD_RDF_GRAPH procedure for bulk insertion of triples. This option may provide better performance on large updates.

  • LOAD_CLOB_ONLY=T loads only triples/quads with object values longer than 4000 bytes in length when executing LOAD operations on N-Triple or N-Quad documents.

  • LOAD_OPTIONS={ OPTIONS_STRING } uses OPTIONS_STRING as the extra file names when performing a LOAD operation.

  • MM_OPTIONS={ OPTIONS_STRING } uses OPTIONS_STRING as the options parameter for operations calling SEM_APIS.MERGE_RDF_GRAPHS.

  • PARALLEL(n) uses the SQL PARALLEL(n) hint for query and DML operations.

  • RESUME_LOAD=T allows resuming an interrupted LOAD operation.

  • SERIALIZABLE=T uses the SERIALIZABLE transaction isolation level for SEM_APIS.UPDATE_RDF_GRAPH operations. READ COMMITTED is the default transaction isolation level.

  • STREAMING=F materializes intermediate data and uses INSERT AS SELECT operations instead of streaming through JDBC Result Sets. This mode may provide better performance on large updates or updates with complex patterns in the WHERE clause.

  • STRICT_BNODE=F enables ID-only operations for ADD, COPY, and MOVE. (ID-only operations are explained in Blank Nodes: Special Considerations for SPARQL Update.)

You can override some options settings at the session level by using the MDSYS.SDO_SEM_UPDATE_CTX.SET_PARAM procedure, as explained in Setting UPDATE_RDF_GRAPH Options at the Session Level.

For information about RDF network types and options, see RDF Networks.

Examples

The following example inserts six triples into an RDF graph.

BEGIN
  sem_apis.update_rdf_graph('electronics',
   'PREFIX : <http://www.example.org/electronics/> 
    INSERT DATA {
       :camera1 :name "Camera 1" .
       :camera1 :price 120 .
       :camera1 :cameraType :Camera .
       :camera2 :name "Camera 2" .
       :camera2 :price 150 .
       :camera2 :cameraType :Camera .
      } ');
END;
/