CREATE_RELATION
Creates a relation between two phrases in the thesaurus. The synonym ring is limited in length to about 4000 synonyms, depending on word length.
Note: Oracle recommends that you use CTX_THES.CREATE_RELATION rather than CTX_THES.CREATE_PHRASE to create relations in a thesaurus.
Only thesaurus owner and CTXSYS can invoke this procedure on a given thesaurus.
Syntax
CTX_THES.CREATE_RELATION(tname in varchar2,
phrase in varchar2,
rel in varchar2,
relphrase in varchar2);
tname
Specify the thesaurus name
phrase
Specify the phrase to alter or create. If phrase is a disambiguated homograph, you must specify the qualifier. If phrase does not exist in the thesaurus, it is created.
rel
Specify the relation to create. The relation is from phrase to relphrase. You can specify one of the following relations:
| relation | meaning | relphrase |
|---|---|---|
| BT/NT | Add hierarchical relation. | Specify the related phrase. The relationship is interpreted from phrase to relphrase. |
| RT | Add associative relation. | Specify the phrase to associate. |
| SYN | Add phrase to a synonym ring. | Specify an existing phrase in the synonym ring. |
| Specify language | Add translation for a phrase. | Specify a new translation phrase. |
relphrase
Specify the related phrase. If relphrase does not exist in tname, relphrase is created. See table for rel.
Notes
The relation you specify for rel is interpreted as from phrase to relphrase. For example, consider dog with broader term animal:
dog
BT animal
To add this relation, specify the arguments as follows:
begin
CTX_THES.CREATE_RELATION('thes','dog','BT','animal');
end;
Note: The order in which you specify arguments for CTX_THES.CREATE_RELATION is different from the order you specify them with CTX_THES.CREATE_PHRASE.
Examples
Create relation VEHICLE NT CAR:
ctx_thes.create_relation('thes1', 'vehicle', 'NT', 'car');
Create Japanese translation for you:
ctx_thes.create_relation('thes1', 'you', 'JAPANESE:', 'kimi');