"Balances" the filter tree in the way that operators on the same level are nested according to their precedence defined in $operatorPrecedence array.
static void
balanceTree
( &$tree, array $tree)
-
array
$tree: Tree to be modified
-
&$tree
static void
fixNegationInFuncName
( &$tree)
Constructor of SparqlParser
SparqlParser
SparqlParser
()
Checks if $token is a Blanknode.
boolean
bNodeCheck
(String $token)
Checks if there is a datatype given and appends it to the node.
void
checkDtypeLang
( &$node, String $node)
Checks if the Node is a typed Literal.
boolean
dtypeCheck
( &$node, String $node)
Error reporting.
String
error
(SparqlException $e)
Checks if $token is an IRI.
boolean
iriCheck
(String $token)
Checks if $token is a Literal.
boolean
literalCheck
(String $token)
Main function of SparqlParser. Parses a query string.
Query
parse
([
String $queryString =
false])
-
String
$queryString: The SPARQL query
Sets result form to 'ASK' and 'COUNT'.
void
parseAsk
(string $form)
-
string
$form: if it's an ASK or COUNT query
Parses the BASE part of the query.
void
parseBase
()
Parses a bracketted expression.
void
parseBrackettedExpression
(
&$constraint,
Constraint $constraint)
Parses an RDF collection.
Node
parseCollection
(
&$trp,
TriplePattern $trp)
Parses a value constraint.
void
parseConstraint
(
&$pattern,
boolean $outer,
GraphPattern $pattern)
-
GraphPattern
$pattern
-
boolean
$outer: If the constraint is an outer one.
-
&$pattern
Parses a constraint string recursively.
The result array is one "element" which may contain subelements. All elements have one key "type" that determines which other array keys the element array has. Valid types are:
- "value":
Just a plain value with a value key, nothing else
- "function"
A function has a name and an array of parameter(s). Each parameter
is an element.
- "equation"
An equation has an operator, and operand1 and operand2 which
are elements themselves
Any element may have the "negated" value set to true, which means that is is - negated (!).
array
parseConstraintTree
([ $nLevel = 0], [ $bParameter = false])
Parses the CONSTRUCT clause.
void
parseConstruct
()
Adds a new variable to the query and sets result form to 'DESCRIBE'.
void
parseDescribe
()
Parses an expression.
void
parseExpression
(
&$constraint,
Constraint $constrain)
Parses the FROM clause.
void
parseFrom
()
Parses a graph pattern.
void
parseGraphPattern
([int $optional = false], [int $union = false], [string $graph = false], [boolean $constr = false], [ $external = false])
-
int
$optional: Optional graph pattern
-
int
$union: Union graph pattern
-
string
$graph: Graphname
-
boolean
$constr: TRUE if the pattern is a construct pattern
-
$external
Parses a literal.
void
parseLiteral
( &$node, String $sep, String $node)
-
String
$node
-
String
$sep: used separator " or '
-
&$node
Parses the solution modifiers of a query.
void
parseModifier
()
Parses a String to an RDF node.
Node
parseNode
([
String $node =
false])
Parses order conditions of a query.
void
parseOrderCondition
()
Adds a new namespace prefix to the query object.
void
parsePrefix
()
Starts parsing the tokenized SPARQL Query.
void
parseQuery
()
Parses the SELECT part of a query.
void
parseSelect
()
Parses the WHERE clause.
void
parseWhere
()
Set all internal variables to a clear state before we start parsing.
void
prepare
()
Checks if $token is a qname.
boolean
qnameCheck
(String $token)
Tokenizes the querystring.
void
tokenize
(String $queryString)
Removes comments in the query string. Comments are indicated by '#'.
String
uncomment
(String $queryString)
Checks if $token is a variable.
boolean
varCheck
(String $token)
FastForward until next token which is not blank.
void
_fastForward
()
Rewind until next token which is not blank.
void
_rewind
()
Inherited Methods
Inherited From Object
Object::toString()