RDQL
[ class tree: RDQL ] [ index: RDQL ] [ all elements ]

Class: RDF_RDQL_Engine_Memory

Source Location: /RDF_RDQL-0.2.0/RDF/RDQL/Engine/Memory.php

Class Overview

RDF_Object
   |
   --RDF_RDQL_Engine
      |
      --RDF_RDQL_Engine_Memory

Some general methods common for RDQLMemEngine and RDQLDBEngine


Author(s):

Version:

  • V0.7

Variables

Methods


Inherited Variables

Inherited Methods

Class: RDF_RDQL_Engine

RDF_RDQL_Engine::writeQueryResultAsHtmlTable()
Prints a query result as HTML table.

Class Details

[line 21]
Some general methods common for RDQLMemEngine and RDQLDBEngine


[ Top ]


Class Variables

$parsedQuery =

[line 49]

Parsed query variables and constraints.
  • Var: ['selectVars'][] = ?VARNAME ['sources'][] = URI ['patterns'][]['subject']['value'] = VARorURI ['predicate']['value'] = VARorURI ['object']['value'] = VARorURIorLiterl ['is_literal'] = boolean ['l_lang'] = string ['l_dtype'] = string ['filters'][]['string'] = string ['evalFilterStr'] = string ['reqexEqExprs'][]['var'] = ?VARNAME ['operator'] = (eq | ne) ['regex'] = string ['strEqExprs'][]['var'] = ?VARNAME ['operator'] = (eq | ne) ['value'] = string ['value_type'] = ('variable' | 'URI' | 'Literal') ['value_lang'] = string ['value_dtype'] = string ['numExpr']['vars'][] = ?VARNAME ( [] stands for an integer index - 0..N )
  • Access: protected

Type:   array


[ Top ]



Method Detail

filterTuples   [line 377]

array filterTuples( array &$finalRes)

Filter the result-set of query variables by evaluating each filter from the AND clause of the RDQL query.
  • Return: [][?VARNAME] = object Node
  • Access: protected

Parameters:

array   &$finalRes   —  [][?VARNAME] = object Node

[ Top ]

findTriplesMatchingPattern   [line 211]

object Model_Memory findTriplesMatchingPattern( &$Model_Memory, string $subjLabel, string $predLabel, string $obj_is, string $objLabel, $objLang, string $objDtype, &$intBindings, object Model_Memory $Model_Memory, string $objLanguage, array $intBindings)

Search in $Model_Memory 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 opbj->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.

  • Access: protected

Parameters:

object Model_Memory   $Model_Memory   — 
string   $subjLabel   — 
string   $predLabel   — 
string   $objLabel   — 
string   $obj_is   — 
string   $objLanguage   — 
string   $objDtype   — 
array   $intBindings   —  [] = string
   &$Model_Memory   — 
   $objLang   — 
   &$intBindings   — 

[ Top ]

findTuplesMatchingAllPatterns   [line 95]

array findTuplesMatchingAllPatterns( object Model_Memory &$Model_Memory)

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.

  • Return: [][?VARNAME] = object Node
  • Access: protected

Parameters:

object Model_Memory   &$Model_Memory   — 

[ Top ]

findTuplesMatchingOnePattern   [line 119]

array findTuplesMatchingOnePattern( object Model_Memory &$Model_Memory, array &$pattern)

Find tuples matching one pattern and return an array with pattern variables and their corresponding values (instances of object Node).
  • Return: [][?VARNAME] = object Node
  • Access: protected

Parameters:

object Model_Memory   &$Model_Memory   — 
array   &$pattern   —  ['subject']['value'] = VARorURI ['predicate']['value'] = VARorURI ['object']['value'] = VARorURIorLiterl ['is_literal'] = boolean ['l_lang'] = string ['l_dtype'] = string

[ Top ]

joinTuples   [line 311]

array joinTuples( array &$finalRes, array &$res)

Perform an SQL-like inner join on two resultSets.
  • Return: [][?VARNAME] = object Node
  • Access: protected

Parameters:

array   &$finalRes   —  [][?VARNAME] = object Node
array   &$res   —  [][?VARNAME] = object Node

[ Top ]

queryModel   [line 61]

array &queryModel( object Model_Memory &$Model_Memory, array &$parsedQuery, [boolean $returnNodes = true])

Perform an RDQL Query on the given Model_Memory.
  • Return: [][?VARNAME] = object Node (if $returnNodes = TRUE) OR array [][?VARNAME] = string
  • Access: public

Parameters:

object Model_Memory   &$Model_Memory   — 
array   &$parsedQuery   —  (the same format as $this->parsedQuery)
boolean   $returnNodes   — 

[ Top ]

selectVariables   [line 482]

array selectVariables( array &$finalRes)

Remove all conditional variables from the result-set and leave only variables specified in the SELECT clause of the RDQL query.
  • Return: [][?VARNAME] = object Node
  • Access: protected

Parameters:

array   &$finalRes   —  [][?VARNAME] = object Node

[ Top ]

toString   [line 513]

array toString( array &$finalRes)

Convert the variable values of $finalRes from objects to their string serialization.
  • Return: [][?VARNAME] = string
  • Access: protected

Parameters:

array   &$finalRes   —  [][?VARNAME] = object Node

[ Top ]

_checkIntBindings   [line 544]

boolean _checkIntBindings( object statement &$triple, array &$intBindings)

Check if the given triple meets pattern internal bindings e.g. (?x, ?z, ?x) ==> statement subject must be identical with the statement object
  • Access: protected

Parameters:

object statement   &$triple   — 
array   &$intBindings   —  [] = string

[ Top ]

_equalsLangDtype   [line 582]

boolean _equalsLangDtype( object Literal &$literal, $lang, $dtype, string $dtype1, string $dtype2)

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.

  • Access: protected

Parameters:

object Literal   &$literal   — 
string   $dtype1   — 
string   $dtype2   — 
   $lang   — 
   $dtype   — 

[ Top ]


Documentation generated on Mon, 11 Mar 2019 15:39:49 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.