Name

sparql_to_sql_text — Converts a sparql query directly to SQL.

Synopsis

varchar sparql_to_sql_text ( in squery varchar );
 

Description

The sparql_to_sql_text() function can be used to convert a SPARQL query directly to the SQL it would be executed as.

Parameters

squery

The sparql query to be converted.

Return Types

A string will be returned containing the converted sparql query.

Examples

Example 24.69. Using the sparql_to_sql_text() function

This simple example shows how to covert sparql query in SQL:

SQL> select sparql_to_sql_text('select * where {?s ?p ?o}');
sparql_to_sql_text
VARCHAR
_______________________________________________________________________________

SELECT __id2i ( /*retval[*/ "s-1-1-t0"."S" /* s */ /*]retval*/ ) AS /*tmpl*/ "s",
  __id2i ( /*retval[*/ "s-1-1-t0"."P" /* p */ /*]retval*/ ) AS /*tmpl*/ "p",
  __ro2sq ( /*retval[*/ "s-1-1-t0"."O" /* o */ /*]retval*/ ) AS /*tmpl*/ "o"
FROM DB.DBA.RDF_QUAD AS "s-1-1-t0"
OPTION (QUIETCAST)

1 Rows. -- 15 msec.