www.openlinksw.com
docs.openlinksw.com

Book Home

Contents
Preface

Virtuoso Functions Guide

Administration
Aggregate Functions
Array Manipulation
BPEL APIs
Backup
Compression
Cursor
Date & Time Manipulation
Debug
Dictionary Manipulation
Encoding & Decoding
File Manipulation
Free Text
Hashing / Cryptographic
LDAP
Locale
Mail
Miscellaneous
Number
Phrases
RDF data
db.dba.rdf_64bit_upg...
db.dba.rdf_audit_met...
db.dba.rdf_backup_me...
db.dba.rdf_convert_r...
db.dba.rdf_langmatch...
db.dba.rdf_load_rdfx...
db.dba.rdf_load_rdfx...
db.dba.rdf_quad_uri
db.dba.rdf_quad_uri_...
db.dba.rdf_quad_uri_...
db.dba.rdf_regex
db.dba.rdf_restore_m...
db.dba.rdf_triples_t...
db.dba.rdf_triples_t...
db.dba.rdf_ttl2hash
db.dba.rdf_void_stor...
db.dba.sparql_eval
db.dba.sparql_eval_t...
db.dba.sparql_rexec
db.dba.sparql_rexec_...
db.dba.sparql_rexec_...
db.dba.ttlp
db.dba.ttlp_mt
db.dba.ttlp_mt_local...
isref
__xml_get_ns_prefix
__xml_get_ns_uri
iri_split
rdfs_rule_set
Remote SQL Data Source
Replication
SOAP
SQL
String
Transaction
Type Mapping
UDDI
User Defined Types & The CLR
Virtuoso Java PL API
Virtuoso Server Extension Interface (VSEI)
Web & Internet
XML
XPATH & XQUERY

Functions Index

DB.DBA.SPARQL_REXEC

Remote execution of SPARQL via SPARQL protocol, produces a result set of SQL values.
DB.DBA.SPARQL_REXEC (in service varchar, in query varchar, in dflt_graph varchar, in named_graphs any, in req_hdr any, in maxrows integer, in bnode_dict any);
Description

Remote execution of SPARQL via SPARQL protocol, produces a result set of SQL values.

Parameters
service – service URI to call via HTTP.
query – text of SPARQL query to execute.
dflt_graph – default graph IRI, if not NULL then this overrides what is specified in query
named_graphs – vector of named graph IRIs, if not NULL then this overrides what is specified in query
req_hdr – additional HTTP header lines that should be passed to the service; 'Host: ...' is most popular.
maxrows – limit on numbers of rows that should be returned.
bnode_dict – dictionary of bnode ID references.
Return Types

any

Examples

create procedure SPARQL_TEST (in rquri varchar, in graph_uri varchar, in resuri varchar, in in_result integer := 0)
{
  declare REPORT varchar;
  declare rqtext, sqltext varchar;
  declare app_env any;
  declare rset, row any;
  declare etalon_vars, etalon_rowids, etalon_rows any;
  declare rctr, rcount integer;
  declare copyright_filter any;
  if (not in_result)
    result_names (REPORT);
  result ('');
  declare exit handler for sqlstate '*' {
   ...
    };
  ...
  rqtext := replace (cast (XML_URI_GET ('', rquri) as varchar), '# \044Id:', '# Id:');
      declare rexec_stat, rexec_msg varchar;
      declare bnode_dict, rexec_rmeta, rexec_rrows any;
      rexec_stat := '00000';
      rexec_msg := 'OK';
      bnode_dict := dict_new ();
      rexec_rrows := null;
      exec (
        'DB.DBA.SPARQL_REXEC (?, ?, ?, ?, ?, ?, ?)',
	rexec_stat, rexec_msg,
	vector (
	  WB_CFG_HTTP_URI() || '/sparql/',
	  rqtext,
	  graph_uri,
	  vector (),
	  '',
	  10000,
	  bnode_dict ),
	10000, rexec_rmeta, rexec_rrows );
      if (not isarray (rexec_rrows))
        rexec_rrows := null;
      result (sprintf ('Remote exec of %s', rquri));
      dump_large_text_impl (
        sprintf ('  completed with state %s msg %s and %d rows',
        rexec_stat, rexec_msg, length (rexec_rrows) ) );
  result ('PASSED');
};