This class contains methods for parsing an Rdql query string into PHP variables.
The output of the RdqlParser is an array with variables and constraints of each query clause (Select, From, Where, And, Using). To perform an RDQL query this array has to be passed to the RdqlEngine.
Located in /rdql/RdqlParser.php (line 21)
Object | --RdqlParser
Parsed query variables and constraints.
{ } are only used within the parser class and are not returned as parsed query. ( [] stands for an integer index - 0..N )
Query string divided into a sequence of tokens.
A token is either: ' ' or "\n" or "\r" or "\t" or ',' or '(' or ')' or a string containing any characters except from the above.
Find all query variables used in the WHERE clause.
Parse expressions inside the passed filter: 1) regex equality expressions: ?var [~~ | =~ | !~ ] REG_EX 2a) string equality expressions: ?var [eq | ne] "literal"@lang^^dtype.
2b) string equality expressions: ?var [eq | ne] <URI> or ?var [eq | ne] prefix:local_name 3) numerical expressions: e.q. (?var1 - ?var2)*4 >= 20
In cases 1-2 parse each expression of the given filter into an array of variables. For each parsed expression put a place holder (e.g. ##RegEx_1##) into the filterStr. The RDQLengine will then replace each place holder with the outcomming boolean value of the corresponding expression. The remaining filterStr contains only numerical expressions and place holders.
Check if a filter from the AND clause contains an equal number of '(' and ')' and parse filter expressions.
Parse the FROM/SOURCES clause of an Rdql query When the parsing of this clause is finished, parseWhere() will be called.
Parse the given RDQL query string and return an array with query variables and constraints.
Parse the SELECT clause of an Rdql query.
When the parsing of the SELECT clause is finished, this method will call a suitable method to parse the subsequent clause.
' Parse the WHERE clause of an Rdql query.
When the parsing of the WHERE clause is finished, this method will call a suitable method to parse the subsequent clause if provided.
Remove comments from the passed query string.
Replace all namespace prefixes in the pattern and constraint clause of an rdql query with the namespaces declared in the USING clause and default namespaces.
Divide the query string into tokens.
A token is either: ' ' or "\n" or "\r" or '\t' or ',' or '(' or ')' or a string containing any character except from the above.
Check if the query string of the given clause contains an undesired ','.
If a comma was correctly placed then remove it and clear all whitespaces.
Throw an error if the regular expression from the AND clause is not quoted.
Check if all variables from the SELECT clause are defined in the WHERE clause
Remove whitespace-tokens from the array $this->tokens
Check if the given variable is defined in the WHERE clause.
Replace a prefix in a given QName and return a full URI.
Check if $token is the first token of a valid literal ("LITERAL") and return an array with literal properties (value, language, datatype).
Check if the given token is a valid NCName.
Check if the given token is a valid namespace prefix.
Check if the given token is a valid QName.
Check if $token is the first token of a valid URI (<URI>) and return the whole URI string
Check if the given token is a valid variable name (?var).
Check if the given token is either a variable (?var) or the first token of an URI (<URI>).
In case of an URI this function returns the whole URI string.
Check if the given token is either a variable (?var) or the first token of either an URI (<URI>) or a literal ("Literal").
In case of a literal return an array with literal properties (value, language, datatype). In case of a variable or an URI return only ['value'] = string.
Inherited From Object
Object::toString()
Documentation generated on Mon, 26 Jun 2006 14:26:03 +0200 by phpDocumentor 1.3.0RC6