Class Query

Description

The Class Query represents a SPARQL query.

  • author: Tobias Gauss <tobias.gauss@web.de>
  • version: $Id: Query.html 443 2007-06-01 16:25:38Z cax $

Located in /sparql/Query.php (line 13)

Object
   |
   --Query
Variable Summary
Method Summary
static mixed getLanguageTag (string $var)
Query Query ()
void addFrom (String $graphURI)
void addFromNamed (String $graphURI)
void addGraphPattern (GraphPattern $pattern)
void addPrefix (String $prefix, String $label)
void addVar (String $var)
void addVariable (String $var)
Array getAllVars ()
String getBase ()
String getBlanknodeLabel ()
mixed getDatatype (string $var)
Array getFromNamedPart ()
String getFromPart ()
string getFullUri (string $token)
GraphPattern getNewPattern ([boolean $constr = false])
Array getPrefixes ()
string getResultForm ()
Array getResultPart ()
Array getResultVars ()
boolean isEmpty ()
void setBase (String $base)
void setResultForm (String $form)
void setSolutionModifier (String $name, Value $value)
Variables
string $base (line 19)

The BASE part of the SPARQL query.

  • access: protected
int $bnodeCounter (line 100)

Blanknode counter.

How many blank nodes are in $resultPart

  • access: protected
mixed $constructPattern (line 123)

If the query type is CONSTRUCT this variable contains the CONSTRUCT graph pattern.

  • access: protected
array $fromNamedPart = array() (line 77)

Contains the FROM NAMED part of the SPARQL query.

  • access: protected
array $fromPart = array() (line 71)

Contains the FROM part of the SPARQL query.

  • access: protected
int $graphPatternCounter (line 108)

GraphPattern counter.

How many GraphPattern are in $resultPart

  • access: public
boolean $isEmpty (line 130)

TRUE if the query is empty FALSE if not.

  • access: public
array $prefixes = array() (line 33)

Array that contains used prefixes and namespaces.

Key is the prefix, value the namespace.

  • access: public
  • example: example not found
string $resultForm (line 57)

What form/type of result should be returned.

One of:

  • "ask"
  • "count"
  • "construct"
  • "describe"
  • "select"
  • "select distinct"

  • see: QueryForms
  • access: protected
array $resultPart (line 65)

Contains the result part of the SPARQL query.

Array of GraphPattern

  • access: protected
array $resultVars = array() (line 41)

Array of result variables that shall be returned.

E.g. "?name", "?mbox"

  • access: protected
array $solutionModifier = array() (line 92)

Optional solution modifier of the query.

Array with three keys: "order by", "limit", "offset" If they are not set, their value is null

"order by" can be an array with subarrays, each of those subarrays having two keys: "val" and "type". "val" determines the variable ("?mbox"), "type" is "asc" or "desc"

  • access: protected
array $usedVars (line 117)

List of all vars used in the query.

Key is the variable (e.g. "?x"), value is boolean true

  • access: public
array $varDatatypes = array() (line 146)

Datatype of variables. NULL if the variable has no data type (e.g. ^^xsd::integer) set.

$varname => $datatype

  • access: public
array $varLanguages = array() (line 138)

Language of variables. NULL if the variable has no language tag (e.g. @en) set.

$varname => $language tag

  • access: public
Methods
static getLanguageTag (line 439)

Returns the language of a variable if the tag is set (e.g. @en) Returns NULL if no language is set.

  • return: NULL or language tag
  • access: public
static mixed getLanguageTag (string $var)
  • string $var: Sparql variable name
Constructor Query (line 153)

Constructor

  • access: public
Query Query ()
addConstructGraphPattern (line 310)

Adds a construct graph pattern to the query.

  • access: public
void addConstructGraphPattern (GraphPattern $pattern)
addFrom (line 321)

Adds a graphuri to the from part.

  • access: public
void addFrom (String $graphURI)
  • String $graphURI
addFromNamed (line 331)

Adds a graphuri to the from named part.

  • access: public
void addFromNamed (String $graphURI)
  • String $graphURI
addGraphPattern (line 298)

Adds a graph pattern to the result part.

  • access: public
void addGraphPattern (GraphPattern $pattern)
addPrefix (line 265)

Adds a prefix to the list of prefixes.

  • access: public
void addPrefix (String $prefix, String $label)
  • String $prefix
  • String $label
addVar (line 370)

Adds a new variable to the variable list.

  • access: public
void addVar (String $var)
  • String $var
addVariable (line 275)

Adds a variable to the list of result variables.

  • access: public
void addVariable (String $var)
  • String $var
getAllVars (line 379)

Returns a list with all used variables.

  • access: public
Array getAllVars ()
getBase (line 168)

Returns the BASE part of the query.

  • access: public
String getBase ()
getBlanknodeLabel (line 242)

Returns an unused Bnode label.

  • access: public
String getBlanknodeLabel ()
getConstructPattern (line 402)

Returns the construvtGraphPattern of the query if there is one.

  • access: public
GraphPattern getConstructPattern ()
getConstructPatternVariables (line 413)

Returns a list of variables used in the construct patterns.

  • return: Array of variable names, unique.
  • access: public
array getConstructPatternVariables ()
getDatatype (line 463)

Returns the datatype of a variable if it is set.

  • return: NULL or datatype
  • access: public
mixed getDatatype (string $var)
  • string $var: Sparql variable name
getFromNamedPart (line 225)

Returns the FROM NAMED clause of the query.

  • access: public
Array getFromNamedPart ()
getFromPart (line 216)

Returns the FROM clause of the query.

  • access: public
String getFromPart ()
getFullUri (line 496)

Gets the full URI of a qname token.

  • return: The complete URI of a given token, false if $token is not a qname or the prefix is not defined
  • access: public
string getFullUri (string $token)
  • string $token
getNewPattern (line 354)

Generates a new GraphPattern. If it is a CONSTRUCT graph pattern $constr has to set to TRUE, FALSE if not.

  • access: public
GraphPattern getNewPattern ([boolean $constr = false])
  • boolean $constr
getPrefixes (line 177)

Returns the prefix map of the query.

  • access: public
Array getPrefixes ()
getResultForm (line 198)

Returns the type the result shall have.

E.g. "select", "select distinct", "ask", ...

string getResultForm ()
getResultPart (line 207)

Returns a list containing the graph patterns of the query.

  • access: public
Array getResultPart ()
getResultVars (line 186)

Returns a list containing the result vars.

  • access: public
Array getResultVars ()
getSolutionModifier (line 392)

Gets the solution modifiers of the query.

$solutionModifier['order by'] = value ['limit'] = vlaue ['offset'] = value

  • access: public
Array getSolutionModifier ()
isEmpty (line 233)

Returns $isEmpty variable

  • access: public
boolean isEmpty ()
setBase (line 253)

Sets the base part.

  • access: public
void setBase (String $base)
  • String $base
setResultForm (line 288)

Sets the result form.

  • access: public
void setResultForm (String $form)
  • String $form
setSolutionModifier (line 342)

Sets a solution modifier.

  • access: public
void setSolutionModifier (String $name, Value $value)
  • String $name
  • Value $value

Inherited Methods

Inherited From Object

Object::toString()

Documentation generated on Fri, 1 Jun 2007 16:50:27 +0200 by phpDocumentor 1.3.2