Source for file FilterFunctions.php
Documentation is available at FilterFunctions.php
* List of functions used to evaluate the FILTER statements in
* @author Tobias Gauss <tobias.gauss@web.de>
* @version $Id: fsource_sparql__sparqlFilterFunctions.php.html 443 2007-06-01 16:25:38Z cax $
* Evaluates the regex() function. Returns true if the regex is matched false if not.
* @param String $string the string which has to be evaluated
* @param String $pattern the regex pattern
* @param String $flags additional flags like "i"
function regex($string,$pattern,$flags =
''){
$pattern =
trim($pattern);
if(strpos($string,"str_")===
0){
$pattern =
substr($pattern,4);
* Evaluates the dateTime() function.Tries to convert a date string into
* @param String $string the date string
* @return integer the corresponding unix timestamp
if(strpos($string,"str_")===
0)
* Evaluates the langMatches() function. Return true if the lang tag matches false if not.
* @param String $lang_range the string.
* @param String $lang_tag the regex pattern
if(strpos($lang_range,"str_")===
0)
$lang_range =
substr($lang_range,4);
if(strpos($lang_tag,"str_")===
0)
$lang_tag =
substr($lang_tag,4);
foreach($hits[0] as $tag){
* Evaluates the str() function. Returns the string representation of a
* @param String $string the string
$str =
preg_match("/\".[^\"]*\"|\'.[^\']*\'/",$string,$hits);
if(strpos($string,"str_")===
0){
if(strpos($string,"uri_")===
0)
return "str_".
substr($string,4);
return "str_".
substr($string,1,-
1);
* Evaluates the lang() function. Returns lang tag of a Literal.
* @param String $string the string.
* @return String the lang tag or false if there is no language tag.
$str =
preg_match("/\".[^\"]*\"@(.[^\s]*)|\'.[^\']*\'@(.[^\s]*)/",$string,$hits);
Documentation generated on Fri, 1 Jun 2007 16:49:03 +0200 by phpDocumentor 1.3.2