SEM_APIS.RES2VID
Format
SEM_APIS.RES2VID(
vTab IN VARCHAR2,
uri IN VARCHAR2,
lt IN VARCHAR2 DEFAULT NULL,
lang IN VARCHAR2 DEFAULT NULL,
lval IN CLOB DEFAULT NULL,
vtyp IN VARCHAR2 DEFAULT NULL,
max_vc_len IN NUMBER DEFAULT 4000
) RETURN NUMBER;
Description
Returns the VALUE_ID for the canonical version of an RDF term, or NULL if the term does not exist in the values table.
Parameters
vTab
Values table to query for the VALUE_ID value. (Usually RDF_VALUE$)
uri
Prefix value of the RDF term.
lt
Data type URI of a types literal to look up. Do not include the enclosing angle brackets (< and >).
lang
Language tag of a language tagged literal to look up.
lval
The plain literal portion of a long literal to look up.
vtyp
The type of value:
-
PL: Plain literal
-
TL: Typed literal
-
UR: URI/IRI
-
BN: Blank node
-
PL@ language: Tagged literal
The value type is determined automatically if this parameter is NULL.
max_vc_len
The maximum allowed length of a VARCHAR RDF term: 32767 or 4000 (the default).
Usage Notes
For information about the components of an RDF term stored in the RDF_VALUE$ table, see RDF Metadata Tables and Views..
Examples
The following example returns VALUE_ID values for the canonical versions of RDF terms. Comments before each SQL statement describe the purpose of the statement.
-- Look up the VALUE_ID for the RDF term <http://www.example.com/a>.
SELECT sem_apis.res2vid('RDF_VALUE$','<http://www.example.com/a>') FROM DUAL;
-- Look up the VALUE_ID for the RDF term "abc".
SELECT sem_apis.res2vid('RDF_VALUE$','"abc"') FROM DUAL;
-- Look up the VALUE_ID for the RDF term "10"^^<http://www.w3.org/2001/XMLSchema#decimal>.
SELECT sem_apis.res2vid('RDF_VALUE$','"10"','http://www.w3.org/2001/XMLSchema#decimal') FROM DUAL;
-- Look up the VALUE_ID for the RDF term "abc"@en.
SELECT sem_apis.res2vid('RDF_VALUE$','"abc"',lang=>'en') FROM DUAL;
-- Look up the VALUE_ID for the long literal RDF term '"a CLOB literal"'.
SELECT sem_apis.res2vid('RDF_VALUE$',null,lval=>'"a CLOB literal"') FROM DUAL;