COMPILE

This procedure compiles added extraction rules into an extraction policy. It can also be used to compile added stop entities into an extraction policy. Users have to invoke this procedure if they have added any rules or stop entities to their policy.

Invokers compile rules and stop entities into their own extraction policy. Users can choose to compile added rules, added stop entities, or both.

After compilation, the CTX_USER_EXTRACT_RULES, CTX_USER_EXTRACT_STOP_ENTITIES, and CTX_USER_EXTRACT_TYPE views will show which rules, stop entities, and types are being used in the entity extraction.

Syntax

CTX_ENTITY.COMPILE(
  policy_name                 IN VARCHAR2,
  compile_choice              IN NUMBER DEFAULT COMPILE_ALL,
  locking                     IN NUMBER DEFAULT LOCK_NOWAIT_ERROR,
  storing                     IN BOOLEAN DEFAULT TRUE);

policy_name

Specify the policy name that is to be compiled.

compile_choice

Specify the entity name to be listed as a stop entity. If entity_type is NULL, all mentions with this entity_name will be listed as stop entities. It is case-sensitive.

The options are COMPILE_ALL, COMPILE_RULES, and COMPILE_STOP_ENTITIES. COMPILE_ALL compiles both rules and stop entities. COMPILE_RULES compiles only rules. COMPILE_STOP_ENTITIES compiles only stop entities.

locking

The maximum byte length is 4000 bytes. Configure how COMPILE deals with the situation where another COMPILE is already running on the same policy.

The options for locking are:

storing

The default value is TRUE. The data used in entity extraction is stored to improve the entity extraction’s performance. Specify FALSE to stop storing the data used in entity extraction.

Example

The following example compiles the policy using the default setting:

exec ctx_entity.compile('pol1');

The following example compiles only the stop entities for the policy:

exec ctx_entity.compile('pol1', CTX_ENTITY.COMPILE_STOP_ENTITIES);

The following example compiles both rules and stop entities. If a lock exists, the function returns immediately, but does not raise an error.

exec ctx_entity.compile('pol1', CTX_ENTITY.COMPILE_ALL,
                                CTX_ENTITY.LOCK_NOWAIT);

CTX_USER_EXTRACT_RULES

CTX_USER_EXTRACT_STOP_ENTITIES

CTX_USER_EXTRACT_TYPE