Semantic MediaWiki and related extensions
Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | List of all members
SMW\SQLStore\SQLStore Class Reference
Inheritance diagram for SMW\SQLStore\SQLStore:
Inheritance graph
[legend]
Collaboration diagram for SMW\SQLStore\SQLStore:
Collaboration graph
[legend]

Public Member Functions

 __construct ()
 
 setFactory (SQLStoreFactory $factory)
 
 getDataItemHandlerForDIType ( $diType)
 
 getSemanticData (DIWikiPage $subject, $filter=false)
 
 getPropertyValues ( $subject, DIProperty $property, $requestOptions=null)
 
 getProperties (DIWikiPage $subject, $requestOptions=null)
 
 getPropertySubjects (DIProperty $property, $dataItem, $requestOptions=null)
 
 getAllPropertySubjects (DIProperty $property, $requestoptions=null)
 
 getInProperties (DataItem $value, $requestoptions=null)
 
 deleteSubject (Title $title)
 
 changeTitle (Title $oldTitle, Title $newTitle, $pageId, $redirectId=0)
 
 getQueryResult (Query $query)
 
 getPropertiesSpecial ( $requestOptions=null)
 
 getUnusedPropertiesSpecial ( $requestOptions=null)
 
 getWantedPropertiesSpecial ( $requestOptions=null)
 
 getStatistics ()
 
 service ( $service,... $args)
 
 setup ( $verbose=true)
 
 drop ( $verbose=true)
 
 refreshData (&$id, $count, $namespaces=false, $usejobs=true)
 
 refreshConceptCache (Title $concept)
 
 deleteConceptCache ( $concept)
 
 getConceptCacheStatus ( $concept)
 
 getSQLOptions (RequestOptions $requestOptions=null, $valueCol='')
 
 getSQLConditions (RequestOptions $requestOptions=null, $valueCol='', $labelCol='', $addAnd=true)
 
 applyRequestOptions (array $data, RequestOptions $requestOptions=null)
 
 findTypeTableId ( $typeid)
 
 findDiTypeTableId ( $dataItemId)
 
 findPropertyTableID (DIProperty $property)
 
 getPropertyTables ()
 
 getObjectIds ()
 
 clear ()
 
 getInfo ( $type=null)
 
 getConnection ( $type='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 (DataItem $object, $requestoptions=null)
 
 getWikiPageSortKey (DIWikiPage $dataItem)
 
 getRedirectTarget (DataItem $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 ()
 
 service ( $service,... $args)
 
 setup ( $verbose=true)
 
 drop ( $verbose=true)
 
 refreshData (&$index, $count, $namespaces=false, $usejobs=true)
 
 getOptions ()
 
 setOption ( $key, $value)
 
 getOption ( $key, $default=null)
 
 clear ()
 
 getInfo ( $type=null)
 
 setConnectionManager (ConnectionManager $connectionManager)
 
 getConnection ( $type)
 

Public Attributes

const FIXED_PROPERTY_ID_UPPERBOUND = 500
 
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 FT_SEARCH_TABLE = 'smw_ft_search'
 
const ID_TABLE = 'smw_object_ids'
 
const ID_AUXILIARY_TABLE = 'smw_object_aux'
 
const UPDATE_TRANSACTION = 'sql/transaction/update'
 
 $smwIds
 
- Public Attributes inherited from SMW\Store
const OPT_CREATE_UPDATE_JOB = 'opt.create.update.job'
 

Protected Member Functions

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

Protected Attributes

 $servicesContainer
 
- Protected Attributes inherited from SMW\Store
 $connectionManager = null
 
 $options = null
 

Additional Inherited Members

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

Detailed Description

SQL-based implementation of SMW's storage abstraction layer.

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.

GNU GPL v2+

Since
1.8
Author
Markus Krötzsch
Jeroen De Dauw
Nischay Nahata
mwjames

Constructor & Destructor Documentation

◆ __construct()

SMW\SQLStore\SQLStore::__construct ( )
Since
1.8

Member Function Documentation

◆ applyRequestOptions()

SMW\SQLStore\SQLStore::applyRequestOptions ( array  $data,
RequestOptions  $requestOptions = null 
)
See also
RequestOptionsProcessor::applyRequestOptions
Since
1.8
Parameters
array$dataarray of DataItem objects
RequestOptions | null$requestOptions
Returns
DataItem[]

◆ clear()

SMW\SQLStore\SQLStore::clear ( )

Resets internal objects

Since
1.9.1.1

◆ deleteConceptCache()

SMW\SQLStore\SQLStore::deleteConceptCache (   $concept)

Delete the concept cache for the given concept.

Since
1.8
Parameters
Title$concept

◆ drop()

SMW\SQLStore\SQLStore::drop (   $verbose = true)
Since
1.8

◆ findDiTypeTableId()

SMW\SQLStore\SQLStore::findDiTypeTableId (   $dataItemId)

PropertyTableInfoFetcher::findTableIdForDataItemTypeId

Parameters
integer$dataItemId
Returns
string

◆ findPropertyTableID()

SMW\SQLStore\SQLStore::findPropertyTableID ( DIProperty  $property)

◆ findTypeTableId()

SMW\SQLStore\SQLStore::findTypeTableId (   $typeid)

PropertyTableInfoFetcher::findTableIdForDataTypeTypeId

Parameters
string$typeid
Returns
string

◆ getAllPropertySubjects()

SMW\SQLStore\SQLStore::getAllPropertySubjects ( DIProperty  $property,
  $requestoptions = null 
)

◆ getConceptCacheStatus()

SMW\SQLStore\SQLStore::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 cacheable). 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

◆ getConnection()

SMW\SQLStore\SQLStore::getConnection (   $type = 'mw.db')
Since
2.1
Parameters
string$type
Returns
Database

◆ getDataItemHandlerForDIType()

SMW\SQLStore\SQLStore::getDataItemHandlerForDIType (   $diType)

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

Since
1.8
Parameters
integer$diType
Returns
DataItemHandler
Exceptions
RuntimeExceptionif no handler exists for the given type

◆ getInfo()

SMW\SQLStore\SQLStore::getInfo (   $type = null)
Since
3.0
Parameters
string | null$type
Returns
array

◆ getInProperties()

SMW\SQLStore\SQLStore::getInProperties ( DataItem  $value,
  $requestoptions = null 
)

◆ getObjectIds()

SMW\SQLStore\SQLStore::getObjectIds ( )

Returns SMW Id object

Since
1.9
Returns
SMWSql3SmwIds

◆ getProperties()

SMW\SQLStore\SQLStore::getProperties ( DIWikiPage  $subject,
  $requestOptions = null 
)

◆ getPropertiesSpecial()

SMW\SQLStore\SQLStore::getPropertiesSpecial (   $requestOptions = null)
Parameters
RequestOptions | null$requestOptions
Returns
CachedListLookup

◆ getPropertySubjects()

SMW\SQLStore\SQLStore::getPropertySubjects ( DIProperty  $property,
  $dataItem,
  $requestOptions = null 
)

◆ getPropertyTableIdReferenceFinder()

SMW\SQLStore\SQLStore::getPropertyTableIdReferenceFinder ( )

◆ getPropertyTableInfoFetcher()

SMW\SQLStore\SQLStore::getPropertyTableInfoFetcher ( )
Since
2.2
Returns
PropertyTableInfoFetcher

◆ getPropertyTables()

SMW\SQLStore\SQLStore::getPropertyTables ( )

◆ getPropertyValues()

SMW\SQLStore\SQLStore::getPropertyValues (   $subject,
DIProperty  $property,
  $requestOptions = null 
)

◆ getQueryResult()

SMW\SQLStore\SQLStore::getQueryResult ( Query  $query)
Note
Move hooks to the base class in 3.*
See also
SMWStore::fetchQueryResult
Since
1.8
Parameters
Query$query
Returns
QueryResult|string|integer depends on $query->querymode

Implements SMW\QueryEngine.

◆ getSemanticData()

SMW\SQLStore\SQLStore::getSemanticData ( DIWikiPage  $subject,
  $filter = false 
)

◆ getSQLConditions()

SMW\SQLStore\SQLStore::getSQLConditions ( RequestOptions  $requestOptions = null,
  $valueCol = '',
  $labelCol = '',
  $addAnd = true 
)
See also
RequestOptionsProcessor::getSQLConditions
Since
1.8
Parameters
RequestOptions | 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

◆ getSQLOptions()

SMW\SQLStore\SQLStore::getSQLOptions ( RequestOptions  $requestOptions = null,
  $valueCol = '' 
)
See also
RequestOptionsProcessor::getSQLOptions
Since
1.8
Parameters
RequestOptions | null$requestOptions
string$valuecol
Returns
array

◆ getUnusedPropertiesSpecial()

SMW\SQLStore\SQLStore::getUnusedPropertiesSpecial (   $requestOptions = null)
Parameters
RequestOptions | null$requestOptions
Returns
CachedListLookup

◆ getWantedPropertiesSpecial()

SMW\SQLStore\SQLStore::getWantedPropertiesSpecial (   $requestOptions = null)
Parameters
RequestOptions | null$requestOptions
Returns
CachedListLookup

◆ newServicesContainer()

SMW\SQLStore\SQLStore::newServicesContainer ( )
protected
Returns
ServicesContainer

◆ refreshConceptCache()

SMW\SQLStore\SQLStore::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)

◆ service()

SMW\SQLStore\SQLStore::service (   $service,
  $args 
)
See also
Store::service

◆ setFactory()

SMW\SQLStore\SQLStore::setFactory ( SQLStoreFactory  $factory)
Since
3.1
Parameters
SQLStoreFactory$factory

◆ setup()

SMW\SQLStore\SQLStore::setup (   $verbose = true)
Since
1.8

Member Data Documentation

◆ CONCEPT_CACHE_TABLE

const SMW\SQLStore\SQLStore::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.

◆ FIXED_PROPERTY_ID_UPPERBOUND

const SMW\SQLStore\SQLStore::FIXED_PROPERTY_ID_UPPERBOUND = 500

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 legacy to the TableIntegrityExaminer::checkOnPostCreation

◆ FT_SEARCH_TABLE

const SMW\SQLStore\SQLStore::FT_SEARCH_TABLE = 'smw_ft_search'

Name of the table that manages the fulltext index

◆ ID_AUXILIARY_TABLE

const SMW\SQLStore\SQLStore::ID_AUXILIARY_TABLE = 'smw_object_aux'

Name of the ID auxiliary table

◆ ID_TABLE

const SMW\SQLStore\SQLStore::ID_TABLE = 'smw_object_ids'

Name of the table that manages the Store IDs

◆ PROPERTY_STATISTICS_TABLE

const SMW\SQLStore\SQLStore::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.

◆ QUERY_LINKS_TABLE

const SMW\SQLStore\SQLStore::QUERY_LINKS_TABLE = 'smw_query_links'

Name of the table that manages the query dependency links

◆ UPDATE_TRANSACTION

const SMW\SQLStore\SQLStore::UPDATE_TRANSACTION = 'sql/transaction/update'

Identifies the UPDATE transaction


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

About | General disclaimer | Privacy policy