Class SparqlEngineDb_FilterGenerator

Description

Generates SQL from Sparql FILTER parts

Located in /sparql/SparqlEngineDb/FilterGenerator.php (line 10)


	
			
Variable Summary
static mixed $arDumbOperators
static array $arFuncParamNumbers
static array $arOperatorSwitches
static mixed $typeVariable
static mixed $typeXsdBoolean
static mixed $typeXsdDateTime
static mixed $typeXsdDouble
static mixed $typeXsdInteger
static mixed $typeXsdString
boolean $bOptional
Method Summary
static void mkVal ( $value, [ $type = null])
static void switchOperator ( $op)
SparqlEngineDb_FilterGenerator __construct (SparqlEngineDb_SqlGenerator $sg)
void createBooleanValue ( $tree)
void createEquation ( $tree)
string createFilterSql (array $tree, boolean $bOptional,  $nUnionCount)
void createFunction ( $tree)
void createFunction_bound ( $tree)
void createFunction_datatype ( $tree)
void createFunction_isblank ( $tree)
void createFunction_isiri ( $tree)
void createFunction_isliteral ( $tree)
void createFunction_isuri ( $tree)
void createFunction_lang ( $tree)
void createFunction_regex ( $tree)
void createFunction_sameterm ( $tree)
void createFunction_str ( $tree)
void createSingleTypeCheck ( $val,  $tree)
void createTreeSql ( $tree,  $parent)
void createTypeEquation ( $operator,  $val1,  $val2,  $tree1,  $tree2)
void createValue (array $tree, boolean $bDumbParent)
void getCol ( $tree,  $type)
void getDatatypeCol ( $tree)
void getDateConversionSql ( $strValue)
void getIsCol ( $tree)
void getLangCol ( $tree)
void getValueCol ( $tree)
void isNumber ( $tree)
boolean isObject (array $tree)
boolean isObjectOrSubject (array $tree)
boolean isPlainString (array $tree)
boolean isVariable (array $tree)
Variables
static mixed $arDumbOperators = array(
'&&', '||'
)
(line 56)
  • access: protected
static array $arFuncParamNumbers = array(
'bound' => array(1, 1),'datatype'=>array(1,1),'isblank'=>array(1,1),'isiri'=>array(1,1),'isliteral'=>array(1,1),'isuri'=>array(1,1),'lang'=>array(1,1),'langmatches'=>array(2,2),'regex'=>array(2,3),'sameterm'=>array(2,2),'str'=>array(1,1),'xsd:datetime'=>array(1,1),)
(line 29)

Number of parameters for the functions supported.

First value is minimum, second is maximum.

  • access: protected
static array $arOperatorSwitches = array(
'>' => '<',
'<' => '>',
'>=' => '<=',
'<=' => '>=',
)
(line 49)

List of operators and their counterpart if operands are switched.

(a > b) => (b < a)

  • access: protected
static mixed $typeVariable = 'variable' (line 65)
  • access: protected
static mixed $typeXsdBoolean = 'http://www.w3.org/2001/XMLSchema#boolean' (line 60)
  • access: protected
static mixed $typeXsdDateTime = 'http://www.w3.org/2001/XMLSchema#dateTime' (line 61)
  • access: protected
static mixed $typeXsdDouble = 'http://www.w3.org/2001/XMLSchema#double' (line 62)
  • access: protected
static mixed $typeXsdInteger = 'http://www.w3.org/2001/XMLSchema#integer' (line 63)
  • access: protected
static mixed $typeXsdString = 'http://www.w3.org/2001/XMLSchema#string' (line 64)
  • access: protected
boolean $bOptional = false (line 22)

If the filter is in an optional statement

  • access: protected
SparqlEngineDb_SqlGenerator $sg = null (line 16)

SQL Generator

  • access: protected
Methods
static mkVal (line 662)
  • access: protected
static void mkVal ( $value, [ $type = null])
  • $value
  • $type
static switchOperator (line 799)
  • access: protected
static void switchOperator ( $op)
  • $op
Constructor __construct (line 69)
  • access: public
SparqlEngineDb_FilterGenerator __construct (SparqlEngineDb_SqlGenerator $sg)
createBooleanValue (line 213)
  • access: protected
void createBooleanValue ( $tree)
  • $tree
createEquation (line 270)
  • access: protected
void createEquation ( $tree)
  • $tree
createFilterSql (line 84)

Creates the SQL representing a Sparql FILTER.

  • return: SQL WHERE part with prefixed AND
  • access: public
string createFilterSql (array $tree, boolean $bOptional,  $nUnionCount)
  • array $tree: Filter element tree as returned by SparqlParser::parseConstraintTree()
  • boolean $bOptional: If the filter is in an optional statement
  • $nUnionCount
createFunction (line 243)
  • access: protected
void createFunction ( $tree)
  • $tree
createFunction_bound (line 400)

Creates an sql statement that returns if the element is a blank node

  • access: protected
void createFunction_bound ( $tree)
  • $tree
createFunction_datatype (line 415)
  • access: protected
void createFunction_datatype ( $tree)
  • $tree
createFunction_isblank (line 434)

Creates an sql statement that returns if the element is a blank node

  • access: protected
void createFunction_isblank ( $tree)
  • $tree
createFunction_isiri (line 450)
  • access: protected
void createFunction_isiri ( $tree)
  • $tree
createFunction_isliteral (line 460)

Creates an sql statement that returns the language of the object

  • access: protected
void createFunction_isliteral ( $tree)
  • $tree
createFunction_isuri (line 475)
  • access: protected
void createFunction_isuri ( $tree)
  • $tree
createFunction_lang (line 493)

Creates an sql statement that returns the language of the object

  • access: protected
void createFunction_lang ( $tree)
  • $tree
createFunction_langmatches (line 512)

Creates an sql statement that checks if the variable

matches a given language

  • access: protected
void createFunction_langmatches ( $tree)
  • $tree
createFunction_regex (line 559)

Creates an sql statement that checks if the given part matches

an regex

  • access: protected
void createFunction_regex ( $tree)
  • $tree
createFunction_sameterm (line 601)

Creates an sql statement that checks if both terms are the same

  • access: protected
void createFunction_sameterm ( $tree)
  • $tree
createFunction_str (line 618)

Creates an sql statement that returns the string representation

of the given element

  • access: protected
void createFunction_str ( $tree)
  • $tree
createFunction_xsd_datetime (line 639)

Creates an sql statement that returns the datetime representation

of the given element

  • access: protected
void createFunction_xsd_datetime ( $tree)
  • $tree
createSingleTypeCheck (line 376)

Creates sql to ensure the type between $val and variable $tree is the same.

  • access: protected
void createSingleTypeCheck ( $val,  $tree)
  • $val
  • $tree
createTreeSql (line 102)
  • access: protected
void createTreeSql ( $tree,  $parent)
  • $tree
  • $parent
createTypeEquation (line 335)

Generates sql code to make sure the datatypes of the two operands match

  • access: protected
void createTypeEquation ( $operator,  $val1,  $val2,  $tree1,  $tree2)
  • $operator
  • $val1
  • $val2
  • $tree1
  • $tree2
createValue (line 141)

Creates the sql for an element of type "value".

  • access: protected
void createValue (array $tree, boolean $bDumbParent)
  • array $tree: Element
  • boolean $bDumbParent: True if the parent is a boolean equation or null.
getCol (line 668)
  • access: protected
void getCol ( $tree,  $type)
  • $tree
  • $type
getDatatypeCol (line 680)
  • access: protected
void getDatatypeCol ( $tree)
  • $tree
getDateConversionSql (line 688)
  • access: protected
void getDateConversionSql ( $strValue)
  • $strValue
getIsCol (line 695)
  • access: protected
void getIsCol ( $tree)
  • $tree
getLangCol (line 702)
  • access: protected
void getLangCol ( $tree)
  • $tree
getValueCol (line 710)
  • access: protected
void getValueCol ( $tree)
  • $tree
isNumber (line 717)
  • access: protected
void isNumber ( $tree)
  • $tree
isObject (line 734)

Checks if the given tree element is a variable and the variable is actually an object in the database.

  • return: True if the element is an object
  • access: protected
boolean isObject (array $tree)
  • array $tree: Tree element
isObjectOrSubject (line 749)

Checks if the given tree element is a variable and the variable is actually an object or a subject in the database.

  • return: True if the element is an object or an subject
  • access: protected
boolean isObjectOrSubject (array $tree)
  • array $tree: Tree element
isPlainString (line 766)

Checks if the given tree element is a plain string (no variable)

  • return: True if the element is a string
  • access: protected
boolean isPlainString (array $tree)
  • array $tree: Tree element
isValueButNotVariableNorString (line 774)
  • access: protected
void isValueButNotVariableNorString ( $tree)
  • $tree
isVariable (line 789)

Checks if the given tree element is a variable

  • return: True if the element is a variable
  • access: protected
boolean isVariable (array $tree)
  • array $tree: Tree element

Documentation generated on Fri, 1 Jun 2007 16:49:06 +0200 by phpDocumentor 1.3.2