Class: RdqlMemEngine ---------------------------------------------------------------------------------- This class performes as RDQL query on a MemModel. Provided an rdql query parsed into an array of php variables and constraints at first the engine searches for tuples matching all patterns from the WHERE clause of the given RDQL query. Then the query result set is filtered with evaluated boolean expressions from the AND clause of the given RDQL query. <BR><BR>History:<UL> <LI>09-08-2004 : findTriplesMatchingPattern() rewritten to only use the $model->find() function for accessing the model. Changed the method of comparing literals to literals->equals according to actual specification <LI>05-12-2004 : Bug in the handling of empty Literals fixed.</LI> <LI>03-17-2004 : Function findTuplesMatchingOnePattern() pass-by-reference bug fixed</LI> <LI>08-29-2003 : Function filterTuples(): some bugs fixed:
|
PHP | boolean _checkIntBindings(unknown $triple, unknown $intBindings) |
---|
Check if the given triple meets pattern internal bindings e.g. (?x, ?z, ?x) ==> statement subject must be identical with the statement object
Arguments
PHP | boolean _equalsLangDtype(unknown $literal, unknown $lang, unknown $dtype) |
---|
Check if the lang and dtype of the passed object Literal are equal $lang and $dtype !!! Language only differentiates literals in rdf:XMLLiterals and plain literals (xsd:string). !!! Therefore if a literal is datatyped ignore the language.
Arguments
PHP | array filterTuples(unknown $finalRes) |
---|
Filter the result-set of query variables by evaluating each filter from the AND clause of the RDQL query.
Arguments
Return
[][?VARNAME] = object Node
PHP | object findTriplesMatchingPattern(unknown $memModel, string $subjLabel, string $predLabel, string $obj_is, string $objLabel, unknown $objLang, string $objDtype, array $intBindings) |
---|
Search in $memModel for triples matching one pattern from the WHERE clause. 'ANY' input for $subjLabel..$objLabel, $obj_is will match anything. NULL input for $objDtype will only match obj->dtype = NULL NULL input for $objLanguage will match obj->lang = NULL or anything if a literal is datatyped (except for XMLLiterals and plain literals) This method also checks internal bindings if provided.
Arguments
[] = string
Return
MemModel
PHP | array findTuplesMatchingAllPatterns(unknown $memModel) |
---|
Find triples matching all patterns of an RDQL query and return an array with variables from all patterns and their corresponding values. The variable values returned are instances of object Node.
Arguments
Return
[][?VARNAME] = object Node
PHP | array findTuplesMatchingOnePattern(unknown $memModel, unknown $pattern) |
---|
Find tuples matching one pattern and return an array with pattern variables and their corresponding values (instances of object Node).
Arguments
Return
[][?VARNAME] = object Node
PHP | array joinTuples(unknown $finalRes, unknown $res) |
---|
Perform an SQL-like inner join on two resultSets.
Arguments
Return
[][?VARNAME] = object Node
PHP | array queryModel(unknown $memModel, unknown $parsedQuery, boolean $returnNodes) |
---|
Perform an RDQL Query on the given MemModel.
Arguments
Return
[][?VARNAME] = object Node (if $returnNodes = TRUE) OR array [][?VARNAME] = string
PHP | array selectVariables(unknown $finalRes) |
---|
Remove all conditional variables from the result-set and leave only variables specified in the SELECT clause of the RDQL query.
Arguments
Return
[][?VARNAME] = object Node
PHP | array toString(unknown $finalRes) |
---|
Convert the variable values of $finalRes from objects to their string serialization.
Arguments
Return
[][?VARNAME] = string