BlueSpice MediaWiki REL1_27
 All Classes Namespaces Files Functions Variables Groups Pages
SMWSQLStore3 Class Reference
Inheritance diagram for SMWSQLStore3:
Collaboration diagram for SMWSQLStore3:

Public Member Functions

 __construct ()
 
 getDataItemHandlerForDIType ($diType)
 
 getDataItemHandlerForDatatype ($typeid)
 
 getReader ()
 
 getSemanticData (DIWikiPage $subject, $filter=false)
 
 getPropertyValues ($subject, DIProperty $property, $requestOptions=null)
 
 getPropertySubjects (DIProperty $property, $dataItem, $requestOptions=null)
 
 getAllPropertySubjects (DIProperty $property, $requestoptions=null)
 
 getProperties (DIWikiPage $subject, $requestOptions=null)
 
 getInProperties (SMWDataItem $value, $requestoptions=null)
 
 getWriter ()
 
 deleteSubject (Title $title)
 
 changeTitle (Title $oldtitle, Title $newtitle, $pageid, $redirid=0)
 
 getQueryResult (SMWQuery $query)
 
 getPropertiesSpecial ($requestOptions=null)
 
 getUnusedPropertiesSpecial ($requestOptions=null)
 
 getWantedPropertiesSpecial ($requestOptions=null)
 
 getStatistics ()
 
 getSetupHandler ()
 
 setup ($verbose=true)
 
 drop ($verbose=true)
 
 refreshData (&$id, $count, $namespaces=false, $usejobs=true)
 
 refreshConceptCache (Title $concept)
 
 deleteConceptCache ($concept)
 
 getConceptCacheStatus ($concept)
 
 getSQLOptions (SMWRequestOptions $requestOptions=null, $valueCol= '')
 
 getSQLConditions (SMWRequestOptions $requestOptions=null, $valueCol= '', $labelCol= '', $addAnd=true)
 
 applyRequestOptions (array $data, SMWRequestOptions $requestOptions=null)
 
 findTypeTableId ($typeid)
 
 findDiTypeTableId ($dataItemId)
 
 findPropertyTableID (DIProperty $property)
 
 changeSMWPageID ($oldid, $newid, $oldnamespace=-1, $newnamespace=-1, $sdata=true, $podata=true)
 
 getPropertyTables ()
 
 getObjectIds ()
 
 getStatisticsTable ()
 
 clear ()
 
 getConnection ($connectionTypeId= 'mw.db')
 
 getPropertyTableInfoFetcher ()
 
 getPropertyTableIdReferenceFinder ()
 
- Public Member Functions inherited from SMW\Store
 getSemanticData (DIWikiPage $subject, $filter=false)
 
 getPropertyValues ($subject, DIProperty $property, $requestoptions=null)
 
 getPropertySubjects (DIProperty $property, $value, $requestoptions=null)
 
 getAllPropertySubjects (DIProperty $property, $requestoptions=null)
 
 getProperties (DIWikiPage $subject, $requestOptions=null)
 
 getInProperties (SMWDataItem $object, $requestoptions=null)
 
 getWikiPageSortKey (DIWikiPage $wikiPage)
 
 getWikiPageLastModifiedTimestamp (DIWikiPage $wikiPage)
 
 getRedirectTarget (SMWDataItem $dataItem)
 
 deleteSubject (Title $subject)
 
 updateData (SemanticData $semanticData)
 
 clearData (DIWikiPage $di)
 
 changeTitle (Title $oldtitle, Title $newtitle, $pageid, $redirid=0)
 
 getQueryResult (SMWQuery $query)
 
 getPropertiesSpecial ($requestoptions=null)
 
 getUnusedPropertiesSpecial ($requestoptions=null)
 
 getWantedPropertiesSpecial ($requestoptions=null)
 
 getStatistics ()
 
 setup ($verbose=true)
 
 drop ($verbose=true)
 
 refreshData (&$index, $count, $namespaces=false, $usejobs=true)
 
 getParserTestTables ()
 
 clear ()
 
 setUpdateJobsEnabledState ($status)
 
 getUpdateJobsEnabledState ()
 
 setConnectionManager (ConnectionManager $connectionManager)
 
 getConnection ($connectionTypeId)
 

Public Attributes

const FIXED_PROPERTY_ID_UPPERBOUND = 50
 
const CONCEPT_CACHE_TABLE = 'smw_concept_cache'
 
const CONCEPT_TABLE = 'smw_fpt_conc'
 
const PROPERTY_STATISTICS_TABLE = 'smw_prop_stats'
 
const QUERY_LINKS_TABLE = 'smw_query_links'
 
const ID_TABLE = 'smw_object_ids'
 
 $smwIds
 
 $m_semdata = array()
 
 $m_sdstate = array()
 

Protected Member Functions

 doDataUpdate (SemanticData $semanticData)
 
 fetchQueryResult (SMWQuery $query)
 
- Protected Member Functions inherited from SMW\Store
 doDataUpdate (SemanticData $data)
 
 fetchQueryResult (SMWQuery $query)
 

Protected Attributes

 $reader = false
 
 $writer = false
 
 $setupHandler = false
 
 $diHandlers = array()
 
- Protected Attributes inherited from SMW\Store
 $connectionManager = null
 

Additional Inherited Members

- Static Public Member Functions inherited from SMW\Store
static setupStore ($verbose=true)
 

Detailed Description

Storage access class for using the standard MediaWiki SQL database for keeping semantic data.

Note
Regarding the use of interwiki links in the store, there is currently no support for storing semantic data about interwiki objects, and hence queries that involve interwiki objects really make sense only for them occurring in object positions. Most methods still use the given input interwiki text as a simple way to filter out results that may be found if an interwiki object is given but a local object of the same name exists. It is currently not planned to support things like interwiki reuse of properties.
Since
1.8

Constructor & Destructor Documentation

SMWSQLStore3::__construct ( )
Since
1.8

Member Function Documentation

SMWSQLStore3::applyRequestOptions ( array  $data,
SMWRequestOptions  $requestOptions = null 
)
See Also
RequestOptionsProcessor::applyRequestOptionsTo
Since
1.8
Parameters
array$dataarray of SMWDataItem objects
SMWRequestOptions | null$requestOptions
Returns
SMWDataItem[]
SMWSQLStore3::changeSMWPageID (   $oldid,
  $newid,
  $oldnamespace = -1,
  $newnamespace = -1,
  $sdata = true,
  $podata = true 
)

Change an SMW page id across all relevant tables. The redirect table is also updated (without much effect if the change happended due to some redirect, since the table should not contain the id of the redirected page). If namespaces are given, then they are used to delete any entries that are limited to one particular namespace (e.g. only properties can be used as properties) instead of moving them.

The id in the SMW IDs table is not touched.

Note
This method only changes internal page IDs in SMW. It does not assume any change in (title-related) data, as e.g. in a page move. Internal objects (subobject) do not need to be updated since they refer to the title of their parent page, not to its ID.
Since
1.8
Parameters
integer$oldidnumeric ID that is to be changed
integer$newidnumeric ID to which the records are to be changed
integer$oldnamespacenamespace of old id's page (-1 to ignore it)
integer$newnamespacenamespace of new id's page (-1 to ignore it)
boolean$sdatastating whether to update subject references
boolean$podatastating if to update property/object references
SMWSQLStore3::clear ( )

Resets internal objects

Since
1.9.1.1
SMWSQLStore3::deleteConceptCache (   $concept)

Delete the concept cache for the given concept.

Since
1.8
Parameters
Title$concept
SMWSQLStore3::findDiTypeTableId (   $dataItemId)

PropertyTableInfoFetcher::findTableIdForDataItemTypeId

Parameters
integer$dataItemId
Returns
string
SMWSQLStore3::findPropertyTableID ( DIProperty  $property)

PropertyTableInfoFetcher::findTableIdForProperty

Parameters
DIProperty$property
Returns
string
SMWSQLStore3::findTypeTableId (   $typeid)

PropertyTableInfoFetcher::findTableIdForDataTypeTypeId

Parameters
string$typeid
Returns
string
SMWSQLStore3::getConceptCacheStatus (   $concept)

Return status of the concept cache for the given concept as an array with key 'status' ('empty': not cached, 'full': cached, 'no': not cachable). If status is not 'no', the array also contains keys 'size' (query size), 'depth' (query depth), 'features' (query features). If status is 'full', the array also contains keys 'date' (timestamp of cache), 'count' (number of results in cache).

Since
1.8
Parameters
Title | SMWWikiPageValue$concept
Returns
DIConcept|null
SMWSQLStore3::getConnection (   $connectionTypeId = 'mw.db')
Since
2.1
Parameters
string$connectionTypeId
Returns
mixed
SMWSQLStore3::getDataItemHandlerForDatatype (   $typeid)

Convenience method to get a dataitem handler for a datatype id.

Since
1.8
Parameters
string$typeid
Exceptions
MWExceptionif there is no handler for this type
Returns
SMWDataItemHandler
SMWSQLStore3::getDataItemHandlerForDIType (   $diType)

Get an object of the dataitem handler from the dataitem provided.

Since
1.8
Parameters
integer$diType
Exceptions
MWExceptionif no handler exists for the given type
Returns
SMWDataItemHandler
SMWSQLStore3::getObjectIds ( )

Returns SMW Id object

Since
1.9
Returns
SMWSql3SmwIds
SMWSQLStore3::getPropertiesSpecial (   $requestOptions = null)
Parameters
RequestOptions | null$requestOptions
Returns
CachedListLookup
SMWSQLStore3::getPropertyTableIdReferenceFinder ( )
Since
2.4
Returns
PropertyTableIdReferenceFinder
SMWSQLStore3::getPropertyTableInfoFetcher ( )
Since
2.2
Returns
PropertyTableInfoFetcher
SMWSQLStore3::getPropertyTables ( )

PropertyTableInfoFetcher::getPropertyTableDefinitions

Returns
TableDefinition[]
SMWSQLStore3::getPropertyValues (   $subject,
DIProperty  $property,
  $requestOptions = null 
)
Parameters
mixed$subject
DIProperty$property
null$requestOptions
Returns
SMWDataItem[]
SMWSQLStore3::getQueryResult ( SMWQuery  $query)
Note
Move hooks to the base class in 3.*
See Also
SMWStore::fetchQueryResult
Since
1.8
Parameters
SMWQuery$query
Returns
SMWQueryResult|string|integer depends on $query->querymode
SMWSQLStore3::getSQLConditions ( SMWRequestOptions  $requestOptions = null,
  $valueCol = '',
  $labelCol = '',
  $addAnd = true 
)
See Also
RequestOptionsProcessor::transformToSQLConditions
Since
1.8
Parameters
SMWRequestOptions | null$requestOptions
string$valueColname of SQL column to which conditions apply
string$labelColname of SQL column to which string conditions apply, if any
boolean$addAndindicate whether the string should begin with " AND " if non-empty
Returns
string
SMWSQLStore3::getSQLOptions ( SMWRequestOptions  $requestOptions = null,
  $valueCol = '' 
)
See Also
RequestOptionsProcessor::transformToSQLOptions
Since
1.8
Parameters
SMWRequestOptions | null$requestOptions
string$valuecol
Returns
array
SMWSQLStore3::getStatisticsTable ( )

Returns the statics table

Since
1.9
Returns
string
SMWSQLStore3::getUnusedPropertiesSpecial (   $requestOptions = null)
Parameters
RequestOptions | null$requestOptions
Returns
CachedListLookup
SMWSQLStore3::getWantedPropertiesSpecial (   $requestOptions = null)
Parameters
RequestOptions | null$requestOptions
Returns
CachedListLookup
SMWSQLStore3::refreshConceptCache ( Title  $concept)

Refresh the concept cache for the given concept.

Since
1.8
Parameters
Title$concept
Returns
array of error strings (empty if no errors occurred)

Member Data Documentation

const SMWSQLStore3::CONCEPT_CACHE_TABLE = 'smw_concept_cache'

Name of the table to store the concept cache in.

Note
This should never change. If it is changed, the concept caches will appear empty until they are recomputed.
const SMWSQLStore3::FIXED_PROPERTY_ID_UPPERBOUND = 50

Specifies the border limit (upper bound) for pre-defined properties used in the ID_TABLE

When changing the upper bound, please make sure to copy the current upper bound as legcy to the SMWSQLStore3SetupHandlers::checkPredefinedPropertyBorder

const SMWSQLStore3::ID_TABLE = 'smw_object_ids'

Name of the table that manages the Store IDs

const SMWSQLStore3::PROPERTY_STATISTICS_TABLE = 'smw_prop_stats'

Name of the table to store the concept cache in.

Note
This should never change, but if it does then its contents can simply be rebuilt by running the setup.
const SMWSQLStore3::QUERY_LINKS_TABLE = 'smw_query_links'

Name of the table that manages the query dependency links


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