Semantic MediaWiki and related extensions
|
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) | |
GNU GPL v2+
SMW\SQLStore\EntityStore\SemanticDataLookup::__construct | ( | SQLStore | $store | ) |
SQLStore | $store |
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).
integer | $id | |
DataItem | $dataItem | |
PropertyTableDefinition | $propTable | |
RequestOptions | $requestOptions |
SMW\SQLStore\EntityStore\SemanticDataLookup::getSemanticData | ( | $id, | |
DataItem | $dataItem = null , |
||
PropertyTableDefinition | $propTable, | ||
RequestOptions | $requestOptions = null |
||
) |
integer | $id | |
DataItem | $dataItem | |
PropertyTableDefinition | $propTable | |
RequestOptions | $requestOptions |
SMW\SQLStore\EntityStore\SemanticDataLookup::getTableUsageInfo | ( | SemanticData | $semanticData | ) |
SMW\SQLStore\EntityStore\SemanticDataLookup::newRequestOptions | ( | PropertyTableDefinition | $propertyTableDef, |
DIProperty | $property, | ||
RequestOptions | $requestOptions = null |
||
) |
PropertyTableDefinition | $propertyTableDef | |
RequestOptions | null | $requestOptions |
SMW\SQLStore\EntityStore\SemanticDataLookup::newStubSemanticData | ( | $object | ) |
DIWikiPage | SemanticData | $object |
RuntimeException |
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.
array | $subjects | |
DIProperty | $property | |
PropertyTableDefinition | $propTable | |
RequestOptions | $requestOptions |