Class SparqlParser

Description

Parses a SPARQL Query string and returns a Query Object.



History:

Located in /sparql/SparqlParser.php (line 17)

Object
   |
   --SparqlParser
Method Summary
SparqlParser SparqlParser ()
boolean bNodeCheck (String $token)
void checkDtypeLang (String $node)
boolean dtypeCheck (String $node)
String error (SparqlException $e)
String getFN (String $token)
boolean iriCheck (String $token)
boolean literalCheck (String $token)
Query parse ([String $queryString = false])
void parseAsk ()
void parseBase ()
Node parseCollection (TriplePattern $trp)
void parseConstraint (GraphPattern $pattern, mixed $outer)
void parseConstruct ()
void parseDescribe ()
void parseExpression (mixed $constraint, Constraint $constrain)
void parseFrom ()
void parseGraph (GraphPattern $pattern)
void parseGraphPattern ([int $optional = false], [int $union = false], [string $graph = false], [boolean $constr = false], [mixed $external = false])
void parseLiteral (String $node, String $sep)
void parseModifier ()
Node parseNode ([String $node = false])
void parsePrefix ()
void parseQuery ()
void parseSelect ()
void parseTriplePattern (GraphPattern $pattern)
void parseWhere ()
boolean qnameCheck (String $token)
void tokenize (String $queryString)
boolean varCheck (String $token)
void _fastForward ()
void _rewind ()
Methods
Constructor SparqlParser (line 49)

Constructor of SparqlParser

  • access: public
SparqlParser SparqlParser ()
bNodeCheck (line 372)

Checks if $token is a Blanknode.

  • return: TRUE if the token is BNode false if not
  • access: protected
boolean bNodeCheck (String $token)
  • String $token: The token
checkDtypeLang (line 882)

Checks if there is a datatype given and appends it to the node.

  • access: protected
void checkDtypeLang (String $node)
  • String $node
dtypeCheck (line 924)

Checks if the Node is a typed Literal.

  • return: TRUE if typed FALSE if not
  • access: protected
boolean dtypeCheck (String $node)
  • String $node
error (line 982)

Error reporting.

  • access: protected
String error (SparqlException $e)
  • SparqlException $e
getFN (line 1007)

Gets the full URI of a qname token.

  • return: The complete URI of a given token
  • access: protected
String getFN (String $token)
  • String $token
iriCheck (line 358)

Checks if $token is an IRI.

  • return: TRUE if the token is an IRI false if not
  • access: protected
boolean iriCheck (String $token)
  • String $token: The token
literalCheck (line 410)

Checks if $token is a Literal.

  • return: TRUE if the token is a Literal false if not
  • access: protected
boolean literalCheck (String $token)
  • String $token: The token
parse (line 64)

Main function of SparqlParser. Parses a query string.

  • return: The query object
  • access: public
  • throws: SparqlParserException
Query parse ([String $queryString = false])
  • String $queryString: The SPARQL query
parseAsk (line 263)

Sets result form to ''ASK''.

  • access: protected
void parseAsk ()
parseBase (line 173)

Parses the BASE part of the query.

  • access: protected
  • throws: SparqlParserException
void parseBase ()
parseBrackettedExpression (line 637)

Parses a bracketted expression.

  • access: protected
  • throws: SparqlParserException
void parseBrackettedExpression (Constraint $constraint)
parseCollection (line 960)

Parses an RDF collection.

  • return: The first parsed label
  • access: protected
Node parseCollection (TriplePattern $trp)
  • TriplePattern $trp
parseConstraint (line 618)

Parses a value constraint.

  • access: protected
void parseConstraint (GraphPattern $pattern, mixed $outer)
parseConstruct (line 308)

Parses the CONSTRUCT clause.

  • access: protected
  • throws: SparqlParserException
void parseConstruct ()
parseDescribe (line 244)

Adds a new variable to the query and sets result form to ''DESCRIBE''.

  • access: protected
void parseDescribe ()
parseExpression (line 672)

Parses an expression.

  • access: protected
  • throws: SparqlParserException
void parseExpression (mixed $constraint, Constraint $constrain)
parseFrom (line 278)

Parses the FROM clause.

  • access: protected
  • throws: SparqlParserException
void parseFrom ()
parseGraph (line 697)

Parses a GRAPH clause.

  • access: protected
  • throws: SparqlParserException
void parseGraph (GraphPattern $pattern)
parseGraphPattern (line 452)

Parses a graph pattern.

  • access: protected
void parseGraphPattern ([int $optional = false], [int $union = false], [string $graph = false], [boolean $constr = false], [mixed $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
parseLiteral (line 910)

Parses a literal.

  • access: protected
void parseLiteral (String $node, String $sep)
  • String $node
  • String $sep: used separator " or ''
parseModifier (line 723)

Parses the solution modifiers of a query.

  • access: protected
  • throws: SparqlParserException
void parseModifier ()
parseNode (line 815)

Parses a String to an RDF node.

  • return: The parsed RDF node
  • access: protected
  • throws: SparqlParserException
Node parseNode ([String $node = false])
  • String $node
parseOrderCondition (line 757)

Parses order conditions of a query.

  • access: protected
  • throws: SparqlParserException
void parseOrderCondition ()
parsePrefix (line 190)

Adds a new namespace prefix to the query object.

  • access: protected
  • throws: SparqlParserException
void parsePrefix ()
parseQuery (line 129)

Starts parsing the tokenized SPARQL Query.

  • access: protected
void parseQuery ()
parseSelect (line 211)

Parses the SELECT part of a query.

  • access: protected
  • throws: SparqlParserException
void parseSelect ()
parseTriplePattern (line 509)

Parses a triple pattern.

  • access: protected
void parseTriplePattern (GraphPattern $pattern)
parseWhere (line 327)

Parses the WHERE clause.

  • access: protected
  • throws: SparqlParserException
void parseWhere ()
qnameCheck (line 387)

Checks if $token is a qname.

  • return: TRUE if the token is a qname false if not
  • access: protected
  • throws: SparqlParserException
boolean qnameCheck (String $token)
  • String $token: The token
tokenize (line 89)

Tokenizes the querystring.

  • access: protected
void tokenize (String $queryString)
  • String $queryString
varCheck (line 344)

Checks if $token is a variable.

  • return: TRUE if the token is ja variable false if not
  • access: protected
boolean varCheck (String $token)
  • String $token: The token
_fastForward (line 422)

FastForward until next token which is not blank.

  • access: protected
void _fastForward ()
_rewind (line 435)

Rewind until next token which is not blank.

  • access: protected
void _rewind ()

Inherited Methods

Inherited From Object

Object::toString()

Documentation generated on Fri, 13 Jan 2006 07:49:47 +0100 by phpDocumentor 1.3.0RC4