Sorts the result table.
Array
buildVarmap
(String $order, Array $vartable)
-
String
$order: (ASC/DESC)
-
Array
$vartable: the vartable
Generates an xml string from a given result table.
String
buildXmlResult
(mixed $vartable)
Checks it there are internal bindings between variables.
boolean
checkIntBindings
(Triple $trip, Array $intBindings)
-
Triple
$trip
-
Array
$intBindings
Constructs a result graph.
-
Array
$vartable: a table containing the result vars and their bindings
-
GraphPattern
$constructPattern: the CONSTRUCT pattern
Builds a describing named graph. To define an attribute list for a several rdf:type look at constants.php
MemModel
describeGraph
(
Array $vartable)
Eliminates duplicate results.
Array
distinct
(Array $vartable)
-
Array
$vartable: a table that contains the result vars and their bindings
Builds an evaluation string to determine wether the result passes the filter or not. This string is evaluatet by the php buildin eval() function
String
fillConstraintString
(
Array $vars,
Array $res,
Constraint $constraint,
Array $function)
-
Array
$vars: a list which contains the used variables
-
Array
$res: the result part which have to be evaluated
-
Constraint
$constraint: the Constrain object
-
Array
$function: an Array which contains the used functions
Filters the pattern results.
Array
filterPatterns
(Array $patternlist, boolean $outer)
-
Array
$patternlist: list containing the results of the GraphPatterns
-
boolean
$outer: TRUE if its an outer filter FALSE if not
Finds Tuples matching one TriplePattern.
Array
findTuplesMatchingOnePattern
(TriplePattern $pattern, Array $graphlist)
-
TriplePattern
$pattern
-
Array
$graphlist
Joins OPTIONAL pattern results.
Array
joinOptionalTuples
(Array &$finalRes, Array &$res)
-
Array
&$finalRes
-
Array
&$res
Joins the results of the different Graphpatterns.
Array
joinResults
(Array $patternlist)
Perform an SQL-like inner join on two resultSets.
Array
joinTuples
(Array &$finalRes, Array &$res)
-
Array
&$finalRes
-
Array
&$res
Finds tuples that match one graph pattern.
void
matchPattern
(
&$patternlist,
array $graphlist,
&$graphPattern,
Array $patternlist,
GraphPattern $graphPattern)
-
Array
$patternlist: list that contains the graphPatterns
-
array
$graphlist: the graphlist
-
GraphPattern
$graphPattern: the pattern which has to be matched
-
&$patternlist
-
&$graphPattern
Matches all graph Patterns against the dataset and generates an array which contains the result sets for every given GraphPattern.
Array
matchPatterns
(Array $graphlist)
-
Array
$graphlist: the graphlist which contains the names of the named graphs which has to be queried.
Looks in from and from named part of the query and adds the graphs to the graphlist.
Array
preselectGraphs
()
The query engines main method.
Array/String
queryModel
(
Dataset $dataset,
Query $query, [
String $resultform =
false])
-
Dataset
$dataset: the RDF Dataset
-
Query
$query: the parsed SPARQL query
-
String
$resultform: the result form. If set to 'xml' the result will be SPARQL Query Results XML Format as described in http://www.w3.org/TR/rdf-sparql-XMLres/ .
Generates the result object.
Array/String
returnResult
(Array $vartable, [String/boolean $resultform = false])
-
Array
$vartable: The result table
-
String/boolean
$resultform: If set to 'xml' the result will be SPARQL Query Results XML Format as described in http://www.w3.org/TR/rdf-sparql-XMLres/
Selects the result variables and builds a result table.
Array
selectVars
(Array $table, Array $vars)
-
Array
$table: the result table
-
Array
$vars: the result variables
Sorts the results.
Array
sortVars
(Array $vartable)
-
Array
$vartable: List containing the unsorted result vars
Prints a query result as HTML table.
You can change the colors in the configuration file.
void
writeQueryResultAsHtmlTable
(array $queryResult)
-
array
$queryResult: [][?VARNAME] = object Node
Marks triples with internal bindings.
int bindings -1 :none 0:sub=pred 1:sub=obj 2:pred=obj 3:sub=pred=obj.
Array
_buildIntBindings
(Array $var)
Builds the resultset.
Array
_buildResultSet
(
GraphPattern $pattern,
Array $resmodel)
Evaluates the GRPAH clause if there is one. Checks if the GRAPH clause contains an IRI, variable or nothing.
Returns an array which contains the graphs that has to be matched.
Array
_checkGraphs
(
&$pattern,
Array $graphlist,
GraphPattern $pattern)
Tries to determine the rdf:type of the variable.
-
Node
$var: The variable
-
MemModel
$resultGraph: The result graph which describes the Resource
Search the attributes listed in $list in the dataset.
void
_getAttributes
(
Array $list,
MemModel $resultGraph,
$varvalue)
-
Array
$list: List containing the attributes
-
MemModel
$resultGraph: The result graph which describes the Resource
-
$varvalue
Helper Function for function buildXmlResult($vartable). Generates an xml string for a single variable an their corresponding value.
String
_getBindingString
(
String $varname,
Node $varvalue)
-
String
$varname: The variables name
-
Node
$varvalue: The value of the variable
Inherited Methods
Inherited From Object
Object::toString()