Skip Headers
Oracle® Spatial Resource Description Framework (RDF)
10g Release 2 (10.2)

Part Number B19307-03
Go to Documentation Home
Home
Go to Book List
Book List
Go to Table of Contents
Contents
Go to Index
Index
Go to Master Index
Master Index
Go to Feedback page
Contact Us

Go to previous page
Previous
Go to next page
Next
PDF · Mobi · ePub

3 SDO_RDF_INFERENCE Package Subprograms

The MDSYS.SDO_RDF_INFERENCE package contains subprograms (functions and procedures) for using the inferencing capabilities of the Resource Description Framework (RDF) in an Oracle database. To use the subprograms in this chapter, you must understand the conceptual and usage information in Chapter 1.

This chapter provides reference information about the subprograms, listed in alphabetical order.


SDO_RDF_INFERENCE.CLEANUP_FAILED

Format

SDO_RDF_INFERENCE.CLEANUP_FAILED(

     rdf_object_type IN VARCHAR2,

     rdf_object_name IN VARCHAR2);

Description

Drops (deletes) a specified rulebase or rules index if it is in a failed state.

Parameters

rdf_object_type

Type of the RDF object: RULEBASE for a rulebase or RULES_INDEX for a rules index.

rdf_object_name

Name of the RDF object of type rdf_object_type.

Usage Notes

This procedure checks to see if the specified RDF object is in a failed state; and if the object is in a failed state, the procedure deletes the object.

A rulebase or rules index is in a failed state if a system failure occurred during the creation of that object. You can check if a rulebase or rules index is in a failed state by checking to see if the value of the STATUS column is FAILED in the SDO_RULEBASE_INFO view (described in Section 1.2.10) or the SDO_RULES_INDEX_INFO view (described in Section 1.2.11), respectively.

If the rulebase or rules index is not in a failed state, this procedure performs no action and returns a successful status.

An exception is generated if the RDF object is currently being used.

Examples

The following example deletes the rulebase named family_rb if (and only if) that rulebase is in a failed state.

EXECUTE SDO_RDF_INFERENCE.CLEANUP_FAILED('RULEBASE', 'family_rb');

SDO_RDF_INFERENCE.CREATE_RULEBASE

Format

SDO_RDF_INFERENCE.CREATE_RULEBASE(

     rulebase_name IN VARCHAR2);

Description

Creates a rulebase.

Parameters

rulebase_name

Name of the rulebase.

Usage Notes

This procedure creates a user-defined rulebase. After creating the rulebase, you can add rules to it. To cause the rules in the rulebase to be applied in a query of RDF data, you can specify the rulebase in the call to the SDO_RDF_MATCH table function.

Rules and rulebases are explained in Section 1.2.10. The SDO_RDF_MATCH table function is described in Section 1.5,

Examples

The following example creates a rulebase named family_rb. (It is an excerpt from Example 1-9 in Section 1.8.2.)

EXECUTE SDO_RDF_INFERENCE.CREATE_RULEBASE('family_rb');

SDO_RDF_INFERENCE.CREATE_RULES_INDEX

Format

SDO_RDF_INFERENCE.CREATE_RULES_INDEX(

     index_name_in IN VARCHAR2,

     models_in IN SDO_RDF_MODELS,

     rulebases_in IN SDO_RDF_RULEBASES);

Description

Creates a rules index based on data in one or more RDF models and one or more rulebases.

Parameters

index_name_in

Name of the rules index.

models_in

One or more RDF model names. Its data type is SDO_RDF_MODELS, which has the following definition: TABLE OF VARCHAR2(25)

rulebases_in

One or more rulebase names. Its data type is SDO_RDF_RULEBASES, which has the following definition: TABLE OF VARCHAR2(25). Rules and rulebases are explained in Section 1.2.10.

Usage Notes

This procedure creates a rules index. For information about rules indexes, see Section 1.2.11.

Examples

The following example creates a a rules index named family_rb_rix_family, using the family model and the RDFS and family_rb rulebases. (This example is an excerpt from Example 1-9 in Section 1.8.2.)

BEGIN
  SDO_RDF_INFERENCE.CREATE_RULES_INDEX(
    'rdfs_rix_family',
    SDO_RDF_Models('family'),
    SDO_RDF_Rulebases('RDFS','family_rb'));
END;
/

SDO_RDF_INFERENCE.DROP_RULEBASE

Format

SDO_RDF_INFERENCE.DROP_RULEBASE(

     rulebase_name IN VARCHAR2);

Description

Deletes a rulebase.

Parameters

rulebase_name

Name of the rulebase.

Usage Notes

This procedure deletes the specified rulebase, making it no longer available for use in calls to the SDO_RDF_MATCH table function. For information about rulebases, see Section 1.2.10.

Only the creator of a rulebase can delete the rulebase.

Examples

The following example drops the rulebase named family_rb.

EXECUTE SDO_RDF_INFERENCE.DROP_RULEBASE('family_rb');

SDO_RDF_INFERENCE.DROP_RULES_INDEX

Format

SDO_RDF_INFERENCE.DROP_RULES_INDEX(

     index_name IN VARCHAR2);

Description

Deletes a rules index.

Parameters

index_name

Name of the rules index.

Usage Notes

This procedure deletes the specified rules index, making it no longer available for use with queries against RDF data. For information about rules indexes, see Section 1.2.11.

Only the owner of a rulebase can call this procedure to drop the rules index. However, a rules index can be dropped implicitly if an authorized user drops any model or rulebase on which the rules index is based; in such a case, the rules index is dropped automatically.

Examples

The following example drops the rules index named rdfs_rix_family.

EXECUTE SDO_RDF_INFERENCE.DROP_RULES_INDEX ('rdfs_rix_family');

SDO_RDF_INFERENCE.DROP_USER_INFERENCE_OBJS

Format

SDO_RDF_INFERENCE.DROP_USER_INFERENCE_OBJS(

     uname IN VARCHAR2);

Description

Drops (deletes) all rulebases and rules index owned by a specified database user.

Parameters

uname

Name of a database user. (This value is case sensitive; for example, HERMAN and herman are considered different users.)

Usage Notes

You must have sufficient privileges to delete rules and rulebases for the specified user.

This procedure does not delete the database user. It deletes only RDF rulebases and rules indexes owned by that user.

Examples

The following example deletes all rulebases and rules indexes owned by user SCOTT.

EXECUTE SDO_RDF_INFERENCE.DROP_USER_INFERENCE_OBJS('SCOTT');
 
PL/SQL procedure successfully completed.


SDO_RDF_INFERENCE.LOOKUP_RULES_INDEX

Format

SDO_RDF_INFERENCE.LOOKUP_RULES_INDEX (

     models IN SDO_RDF_MODELS,

     rulebases IN SDO_RDF_RULEBASES

     ) RETURN VARCHAR2;

Description

Returns the name of the rules index based on the specified models and rulebases.

Parameters

models

One or more RDF model names. Its data type is SDO_RDF_MODELS, which has the following definition: TABLE OF VARCHAR2(25)

rulebases

One or more rulebase names. Its data type is SDO_RDF_RULEBASES, which has the following definition: TABLE OF VARCHAR2(25)Rules and rulebases are explained in Section 1.2.10.

Usage Notes

For a rulebase index to be returned, it must be based on all specified models and rulebases.

Examples

The following example find the rules index that is based on the family model and the RDFS and family_rb rulebases. (It is an excerpt from Example 1-9 in Section 1.8.2.)

SELECT SDO_RDF_INFERENCE.LOOKUP_RULES_INDEX(SDO_RDF_MODELS('family'),
  SDO_RDF_RULEBASES('RDFS','family_rb')) AS lookup_rules_index FROM DUAL;

LOOKUP_RULES_INDEX
--------------------------------------------------------------------------------
RDFS_RIX_FAMILY