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
Remote SQL Data Source
Replication
SOAP
SQL
String
Transaction
Type Mapping
UDDI
User Defined Types & The CLR
VAD
Virtuoso Java PL API
Virtuoso Server Extension Interface (VSEI)
Web & Internet
dav add & update fun...
dav lock manipulatio...
dav manipulation fun...
dav search functions
dav_exp
lfs_exp
serv_queue_top
urlrewrite_create_re...
user_key_load
vhost_define
vhost_remove
webdav users & group...
client_attr
connection_get
connection_id
connection_is_dirty
connection_set
connection_vars
connection_vars_set
dbname
ftp_get
ftp_ls
ftp_put
get_certificate_info
get_keyword
get_keyword_ucase
http
http_acl_get
http_acl_remove
http_acl_set
http_body_read
http_client
http_client_ext
http_client_ip
http_debug_log
http_enable_gz
http_file
http_flush
http_get
http_header
http_header_get
http_kill
http_listen_host
http_map_get
http_map_table
http_param
http_path
http_pending_req
http_physical_path
http_proxy
http_request_get
http_request_header
http_request_status
http_rewrite
http_root
http_url
http_value
http_xslt
ses_connect
ses_disconnect
ses_read_line
ses_write
tcpip_gethostbyaddr
tcpip_gethostbyname
vsp_calculate_digest
wsdl_import_udt
XML
XPATH & XQUERY

Functions Index

URLREWRITE_CREATE_REGEX_RULE

Creates regex rules.
URLREWRITE_CREATE_REGEX_RULE (in rule_iri varchar, in allow_update integer, in nice_match varchar, in nice_params any, in nice_min_params integer, in target_compose varchar, in target_params any, in target_expn varchar, in accept_pattern varchar, in do_not_continue integer, in http_redirect_code integer);
Description

Creates regex rules.

Parameters
rule_iri – The rule's name / identifier
allow_update – Indicates whether the rule can be updated. 1 indicates yes; 0 indicates no. The update is subject to the following rules: If the given rule_iri is already in use as a rule list identifier, an error is signaled. If the given rule_iri is already in use as a rule identifier and allow_update for the existing rule is zero, an error is signalled. If the given rule_iri is already in use as a rule identifier and allow_update for the existing rule is non-zero, the existing rule is updated.
nice_match – A regex match expression to parse the URL into a vector of occurrences.
nice_params – A vector of the names of the parsed parameters. The length of the vector should be equal to the number of '(...)' specifiers in the format string.
nice_min_params – Used to specify the minimum number of sprintf format patterns to be matched in order to trigger the given rule. In existing versions of Virtuoso it only affects sprintf rules and has no effect for regex rules.
target_compose – A regex compose expression for the URL of the destination page.
target_params – A vector of names of parameters that should be passed to the compose expression (target_compose) as $1, $2 and so on. Special names can be used in addition to names from nice_params. That names start and end with asterisk. Name '*accept*' is for required MIME type string, other names of the sort refer to values from HTTP request header lines. Note that '*Accept*' will return the whole "Accept:" line whereas '*accept*' is for the part that matches accept_pattern.
target_expn – Optional SQL text that should be executed instead of a regex compose call.
accept_pattern – A regex expression to match the HTTP Accept header
do_not_continue – If the given rule satisfies the match conditions, 1 signifies do not try the next rule from same rule list, and 0 signifies try the next rule.
http_redirect_code – NULL or the integer values 301, 302, 303, or 406, are currently allowed. If a 3xx redirect code is given, an HTTP redirect response will be sent back to client. If NULL is specified, the server will process the redirect internally.
Return Types

The return value is not specified.

Examples

DB.DBA.URLREWRITE_CREATE_REGEX_RULE (
    'demo_nw_rule2',
    1,
    '(/[^#]*)',
    vector('path'),
    1,
    '/sparql?query=CONSTRUCT+{+%%3Chttp%%3A//^{URIQADefaultHost}^%U%%23this%%3E+%%3Fp+%%3Fo+}+FROM+%%3Chttp%%3A//^{URIQADefaultHost}^/Northwind%%3E+WHERE+{+%%3Chttp%%3A//^{URIQADefaultHost}^%U%%23this%%3E+%%3Fp+%%3Fo+}&format=%U',
    vector('path', 'path', '*accept*'),
    null,
    '(text/rdf.n3)|(application/rdf.xml)',
    0,
    null
    );