Use SparqlEngine::factory() instead of this constructor.
SparqlEngine
__construct
()
Sorts the result table.
Array
buildVarmap
(String $order, Array $vartable)
-
String
$order: (ASC/DESC)
-
Array
$vartable: the vartable
Checks it there are internal bindings between variables.
boolean
checkIntBindings
(Triple $trip, Array $intBindings)
-
Triple
$trip
-
Array
$intBindings
Eliminates duplicate results.
Array
distinct
(Array $vartable)
-
Array
$vartable: a table that contains the result vars and their bindings
Creates a new instance of the SparqlEngine, depending on the given model. For example, if you pass a DbModel, you will get a SparqlEngine specialized on databases.
void
factory
([
Model $model =
null])
-
Model
$model: RDF model that uses the engine
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 engine's main method.
Array/String
queryModel
(
Dataset $dataset,
Query $query, [
String $resultform =
false])
-
Dataset
$dataset: the RDF Dataset
-
mixed
$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/ .
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)
Inherited Methods
Inherited From Object
Object::toString()