SEM_APIS.UPDATE_MODEL

Format

SEM_APIS.UPDATE_MODEL(
     apply_model         IN VARCHAR2,
     update_stmt         IN CLOB,
     match_models        IN RDF_MODELS DEFAULT NULL,
     match_rulebases     IN RDF_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);

Note: This subprogram will be deprecated in a future release. It is recommended that you use the SEM_APIS.UPDATE_RDF_GRAPH subprogram instead.

Description

Executes a SPARQL Update statement on a semantic model.

Parameters

apply_model

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

It cannot be a virtual model (see RDF Graph Collections) or an RDF view).

update_stmt

One or more SPARQL Update commands to be executed on the apply_model model. Use the semicolon (;) to separate commands.

match_models

A list of models 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 virtual models and/or RDF views If this parameter is not specified, the apply_model model is used.

match_rulebases

A list of rulebases to use with match_models to provide an entailment 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 entailments 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 semantic network. (See Table: network_owner and network_name Parameters.)

network_name

Name of the semantic network. (See Table: network_owner and network_name Parameters.)

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:

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 semantic network types and options, see RDF Networks.

Examples

The following example inserts six triples into a semantic model.

BEGIN
  sem_apis.update_model('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;
/