SEM_APIS.CREATE_RDF_GRAPH_COLLECTION

Format

SEM_APIS.CREATE_RDF_GRAPH_COLLECTION(
     rdf_graph_collection_name   IN VARCHAR2,
     rdf_graphs                  IN SEM_MODELS,
     rulebases                   IN SEM_RULEBASES DEFAULT NULL,
     options                     IN VARCHAR2 DEFAULT NULL,
     inferred_graphs             IN SEM_ENTAILMENTS DEFAULT NULL,
     network_owner               IN VARCHAR2 DEFAULT NULL,
     network_name                IN VARCHAR2 DEFAULT NULL);

Description

Creates an RDF graph collection containing the specified RDF graphs and/or inferred graphs. Inferred graphs can be specified in one of the following ways:

The first method ensures a sound and complete dataset, whereas the second method relaxes the sound and complete constraints for more flexibility.

Parameters

rdf_graph_collection_name

Name of the RDF graph collection to be created.

rdf_graphs

One or more RDF graph names. Its data type is SEM_MODELS, which has the following definition: TABLE OF VARCHAR2(25). If this parameter is null, no graphs are included in the RDF graph collection.

rulebases

One or more rulebase names. Its data type is SEM_RULEBASES, which has the following definition: TABLE OF VARCHAR2(25). If this parameter is null, no rulebases are included in the RDF graph collection. Rules and rulebases are explained in Inferencing: Rules and Rulebases.

If you specify this parameter, you cannot also specify the inferred_graphs parameter.

options

Options for creation:

inferred_graphs

One or more inferred graph names. Its data type is SEM_ENTAILMENTS, which has the following definition: TABLE OF VARCHAR2(25). If this parameter is null, no inferred graphs are included in the RDF graph collection. Inferred graphs are explained in Using OWL Inferencing.

If you specify this parameter, you cannot also specify the rulebases parameter.

network_owner

Owner of the RDF network. (See Table: network_owner and network_name Parameters.)

network_name

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

Usage Notes

For an explanation of RDF graph collections, including usage information, see RDF Graph Collections.

An inferred graph must exist for each specified combination of RDF graph and rulebase.

To create an RDF graph collection, you must either be (A) the owner of each specified graph and any corresponding inferred graphs, or (B) a user with DBA privileges.

To replace an RDF graph collection, you must be the owner of the graph or a user with DBA privileges.

The option INMEMORY=T should be used only if you have the appropriate licenses.

This procedure creates views with names in the following format:

To use the example in RDF Graph Collections of an RDF graph collection vm1 created from graphs m1, m2, m3, and with an entailment created for m1, m2 ,and m3 using the OWLPrime rulebase, this procedure will create the following two views (assuming that m1, m2, and m3, and the OWLPRIME entailment have internal model_id values 1, 2, 3, 4):

CREATE VIEW RDFUSER.NET1#.SEMV_VM1 AS
  SELECT p_value_id, start_node_id, canon_end_node_id, end_node_id, g_id, model_id
  FROM RDFUSER.NET1#.rdf_link$ partition (MODEL_1)
UNION ALL
  SELECT p_value_id, start_node_id, canon_end_node_id, end_node_id, g_id, model_id
  FROM RDFUSER.NET1#.rdf_link$ partition (MODEL_2)
UNION ALL
  SELECT p_value_id, start_node_id, canon_end_node_id, end_node_id, g_id, model_id
  FROM RDFUSER.NET1#.rdf_link$ partition (MODEL_3)
UNION ALL
  SELECT p_value_id, start_node_id, canon_end_node_id, end_node_id, g_id, model_id
  FROM RDFUSER.NET1#.rdf_link$ partition (MODEL_4);

CREATE VIEW RDFUSER.NET1#.SEMU_VM1 AS
  SELECT p_value_id, start_node_id, canon_end_node_id, MIN(end_node_id) end_node_id, g_id, MIN(model_id) model_id
  FROM RDFUSER.NET1#.rdf_link$
  WHERE model_id in (1, 2, 3, 4)
  GROUP BY p_value_id, start_node_id, canon_end_node_id, g_id;

The user that invokes this procedure will be the owner of the RDF graph collection and will have SELECT WITH GRANT privileges on the SEMU_vm_name and SEMV_vm_name views. To query the corresponding RDF graph collection, a user must have select privileges on these views.

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

Examples

The following example creates an RDF graph collection named VM1.

EXECUTE sem_apis.create_rdf_graph_collection('VM1',
                                          sem_models('model_1', 'model_2'),
                                          sem_rulebases('OWLPRIME'),
                                          network_owner=>'RDFUSER',
                                          network_name=>'NET1');

The following example creates an RDF graph collection named VM1 using the relaxed entailment specification.

EXECUTE sem_apis.create_rdf_graph_collection('VM1',
                                          rdf_graphs=>sem_models('model_1', 'model_2'),
                                          inferred_graphs=>sem_entailments('entailment1','entailment2'),
                                          network_owner=>'RDFUSER',
                                          network_name=>'NET1');

The following example effectively redefines RDF graph collection VM1 by using the REPLACE=T option.

EXECUTE sem_apis.create_rdf_graph_collection('VM1',
                                          rdf_graphs=>sem_models('model_1', 'model_2'),
                                          inferred_graphs=>sem_entailments('entailment1'),
                                          options=>'REPLACE=T',
                                          network_owner=>'RDFUSER',
                                          network_name=>'NET1');