Semantic MediaWiki and related extensions
Public Member Functions | List of all members
SMW\SQLStore\EntityStore\SemanticDataLookup Class Reference

Public Member Functions

 __construct (SQLStore $store)
 
 newRequestOptions (PropertyTableDefinition $propertyTableDef, DIProperty $property, RequestOptions $requestOptions=null)
 
 newStubSemanticData ( $object)
 
 getTableUsageInfo (SemanticData $semanticData)
 
 getSemanticData ( $id, DataItem $dataItem=null, PropertyTableDefinition $propTable, RequestOptions $requestOptions=null)
 
 prefetchDataFromTable (array $subjects, DIProperty $property, PropertyTableDefinition $propTable, RequestOptions $requestOptions=null)
 
 fetchSemanticDataFromTable ( $id, DataItem $dataItem=null, PropertyTableDefinition $propTable, RequestOptions $requestOptions=null)
 

Detailed Description

GNU GPL v2+

Since
3.0
Author
mwjames

Constructor & Destructor Documentation

◆ __construct()

SMW\SQLStore\EntityStore\SemanticDataLookup::__construct ( SQLStore  $store)
Since
3.0
Parameters
SQLStore$store

Member Function Documentation

◆ fetchSemanticDataFromTable()

SMW\SQLStore\EntityStore\SemanticDataLookup::fetchSemanticDataFromTable (   $id,
DataItem  $dataItem = null,
PropertyTableDefinition  $propTable,
RequestOptions  $requestOptions = null 
)

Helper function for reading all data for from a given property table (specified by an SMWSQLStore3Table dataItem), based on certain restrictions. The function can filter data based on the subject (1) or on the property it belongs to (2) – but one of those must be done. The Boolean $issubject is true for (1) and false for (2).

In case (1), the first two parameters are taken to refer to a subject; in case (2) they are taken to refer to a property. In any case, the retrieval is limited to the specified $proptable. The parameters are an internal $id (of a subject or property), and an $dataItem (being an DIWikiPage or SMWDIProperty). Moreover, when filtering by property, it is assumed that the given $proptable belongs to the property: if it is a table with fixed property, it will not be checked that this is the same property as the one that was given in $dataItem.

In case (1), the result in general is an array of pairs (arrays of size 2) consisting of a property key (string), and DB keys (array if many, string if one) from which a datvalue dataItem for this value can be built. It is possible that some of the DB keys are based on internal dataItems; these will be represented by similar result arrays of (recursive calls of) fetchSemanticData().

In case (2), the result is simply an array of DB keys (array) without the property keys. Container dataItems will be encoded with nested arrays like in case (1).

Parameters
integer$id
DataItem$dataItem
PropertyTableDefinition$propTable
RequestOptions$requestOptions
Returns
array

◆ getSemanticData()

SMW\SQLStore\EntityStore\SemanticDataLookup::getSemanticData (   $id,
DataItem  $dataItem = null,
PropertyTableDefinition  $propTable,
RequestOptions  $requestOptions = null 
)
Since
3.0
Parameters
integer$id
DataItem$dataItem
PropertyTableDefinition$propTable
RequestOptions$requestOptions
Returns
SemanticData

◆ getTableUsageInfo()

SMW\SQLStore\EntityStore\SemanticDataLookup::getTableUsageInfo ( SemanticData  $semanticData)
Since
3.0
Parameters
SemanticData$semanticData
Returns
array

◆ newRequestOptions()

SMW\SQLStore\EntityStore\SemanticDataLookup::newRequestOptions ( PropertyTableDefinition  $propertyTableDef,
DIProperty  $property,
RequestOptions  $requestOptions = null 
)
Since
3.0
Parameters
PropertyTableDefinition$propertyTableDef
RequestOptions | null$requestOptions
Returns
RequestOptions|null

◆ newStubSemanticData()

SMW\SQLStore\EntityStore\SemanticDataLookup::newStubSemanticData (   $object)
Since
3.0
Parameters
DIWikiPage | SemanticData$object
Returns
StubSemanticData
Exceptions
RuntimeException

◆ prefetchDataFromTable()

SMW\SQLStore\EntityStore\SemanticDataLookup::prefetchDataFromTable ( array  $subjects,
DIProperty  $property,
PropertyTableDefinition  $propTable,
RequestOptions  $requestOptions = null 
)

#3722

The prefetch mode is provided as means to reduce the amount of SELECT queries required for a known subject list. Internally, it makes use of the WHERE IN construct to fetch an entire set of data for a specific property and a list of subjects.

The method is not expected to be used by any public accessors except for PrefetchItemLookup (or via PrefetchCache) as a specialized return format is used to represent the result set.

Since
3.1
Parameters
array$subjects
DIProperty$property
PropertyTableDefinition$propTable
RequestOptions$requestOptions
Returns
array

The documentation for this class was generated from the following file:

About | General disclaimer | Privacy policy