Name

rdf_regex_impl, regexp_parse_list, regexp_replace_hits_with_template, regexp_version, iri_validation_regex, iri_validate — extended regular-expression utilities and IRI validators

Synopsis

integer rdf_regex_impl( in text any,
  in pattern varchar,
  in flags varchar);
 
any regexp_parse_list( in pattern varchar,
  in text varchar,
  in offset integer);
 
varchar regexp_replace_hits_with_template( in text varchar,
  in pattern varchar,
  in template varchar);
 
varchar regexp_version( );
 
varchar iri_validation_regex( in what integer);
 
integer iri_validate( in iri varchar,
  in what integer);
 

Description

rdf_regex_impl is the SPARQL REGEX backend. It tests whether text (unwrapped from an RDF box if needed) matches pattern with the optional flags string. Flags follow XQuery 1.0 / SPARQL 1.1 conventions: i = case-insensitive, m = multi-line, s = dot-all, x = ignore whitespace.

regexp_parse_list applies pattern to text repeatedly starting at offset (default 0) and returns a vector of per-match results, each containing the start offset, end offset and captured groups. This is the list-returning sibling of regexp_parse.

regexp_replace_hits_with_template finds every match of pattern in text and replaces it with template, allowing back-references of the form \1, \2, ... to the captured groups of each match. Equivalent to a global regexp_replace but using \N substitution syntax.

regexp_version returns the version string of the underlying regular-expression engine compiled into the server.

iri_validation_regex returns the regular expression Virtuoso uses to validate IRIs against a specific syntactic profile selected by what: 1 = generic IRI (default), 2 = absolute IRI, 3 = relative IRI.

iri_validate applies that profile to iri and returns 1 if the string conforms, 0 otherwise. Useful for sanitising IRIs before inserting them into the quad store.


© 1992 - OpenLink Software. All rights reserved.

Making Technology Work for You®