Wikibase
MediaWiki Wikibase extension
Wikibase\DataAccess\EntitySource Class Reference

An EntitySource includes information needed to interact with one or more entity types at a given source. More...

+ Inheritance diagram for Wikibase\DataAccess\EntitySource:

Public Member Functions

 __construct ( $name, $databaseName, array $entityNamespaceIdsAndSlots, $conceptBaseUri, $rdfNodeNamespacePrefix, $rdfPredicateNamespacePrefix, $interwikiPrefix, string $type=self::TYPE_DB)
 
 getDatabaseName ()
 
 getSourceName ()
 
 getEntityTypes ()
 
 getEntityNamespaceIds ()
 
 getEntitySlotNames ()
 
 getConceptBaseUri ()
 
 getRdfNodeNamespacePrefix ()
 
 getRdfPredicateNamespacePrefix ()
 
 getInterwikiPrefix ()
 
 getType ()
 

Public Attributes

const TYPE_DB = 'db'
 
const TYPE_API = 'api'
 

Protected Member Functions

 assertEntityNamespaceIdsAndSlots (array $entityNamespaceIdsAndSlots)
 

Private Member Functions

 setEntityTypeData (array $entityNamespaceIdsAndSlots)
 

Private Attributes

 $sourceName
 
 $databaseName
 
 $entityTypes
 
 $entityNamespaceIds
 
 $entitySlots
 
 $conceptBaseUri
 
 $rdfNodeNamespacePrefix
 
 $rdfPredicateNamespacePrefix
 
 $interwikiPrefix
 
 $type
 

Detailed Description

An EntitySource includes information needed to interact with one or more entity types at a given source.

EntitySource can only currently be used via direct database access.

See also
EntitySourceDefinitions for defining multiple EntitySources within a single site.

Constructor & Destructor Documentation

◆ __construct()

Wikibase\DataAccess\EntitySource::__construct (   $name,
  $databaseName,
array  $entityNamespaceIdsAndSlots,
  $conceptBaseUri,
  $rdfNodeNamespacePrefix,
  $rdfPredicateNamespacePrefix,
  $interwikiPrefix,
string  $type = self::TYPE_DB 
)
Parameters
string$nameUnique name for the source for a given configuration / site, used for indexing the sources internally. This does not have to be a wikiname, sitename or dbname, it can for example just be 'properties'.
string | false$databaseNameThe name of the database to use (use false for the local db)
array$entityNamespaceIdsAndSlotsAssociative array indexed by entity type (string), values are array of form [ 'namespaceId' => int, 'slot' => string ]
string$conceptBaseUri
string$rdfNodeNamespacePrefix
string$rdfPredicateNamespacePrefix
string$interwikiPrefix
string$type

Member Function Documentation

◆ assertEntityNamespaceIdsAndSlots()

Wikibase\DataAccess\EntitySource::assertEntityNamespaceIdsAndSlots ( array  $entityNamespaceIdsAndSlots)
protected

◆ getConceptBaseUri()

Wikibase\DataAccess\EntitySource::getConceptBaseUri ( )

◆ getDatabaseName()

Wikibase\DataAccess\EntitySource::getDatabaseName ( )
Returns
string|false The name of the database to use (use false for the local db)

Reimplemented in Wikibase\DataAccess\DatabaseEntitySource.

◆ getEntityNamespaceIds()

Wikibase\DataAccess\EntitySource::getEntityNamespaceIds ( )

◆ getEntitySlotNames()

Wikibase\DataAccess\EntitySource::getEntitySlotNames ( )

◆ getEntityTypes()

Wikibase\DataAccess\EntitySource::getEntityTypes ( )

◆ getInterwikiPrefix()

Wikibase\DataAccess\EntitySource::getInterwikiPrefix ( )

◆ getRdfNodeNamespacePrefix()

Wikibase\DataAccess\EntitySource::getRdfNodeNamespacePrefix ( )

◆ getRdfPredicateNamespacePrefix()

Wikibase\DataAccess\EntitySource::getRdfPredicateNamespacePrefix ( )

◆ getSourceName()

Wikibase\DataAccess\EntitySource::getSourceName ( )

◆ getType()

Wikibase\DataAccess\EntitySource::getType ( )

◆ setEntityTypeData()

Wikibase\DataAccess\EntitySource::setEntityTypeData ( array  $entityNamespaceIdsAndSlots)
private

Member Data Documentation

◆ $conceptBaseUri

Wikibase\DataAccess\EntitySource::$conceptBaseUri
private

◆ $databaseName

Wikibase\DataAccess\EntitySource::$databaseName
private

◆ $entityNamespaceIds

Wikibase\DataAccess\EntitySource::$entityNamespaceIds
private

◆ $entitySlots

Wikibase\DataAccess\EntitySource::$entitySlots
private

◆ $entityTypes

Wikibase\DataAccess\EntitySource::$entityTypes
private

◆ $interwikiPrefix

Wikibase\DataAccess\EntitySource::$interwikiPrefix
private

◆ $rdfNodeNamespacePrefix

Wikibase\DataAccess\EntitySource::$rdfNodeNamespacePrefix
private

◆ $rdfPredicateNamespacePrefix

Wikibase\DataAccess\EntitySource::$rdfPredicateNamespacePrefix
private

◆ $sourceName

Wikibase\DataAccess\EntitySource::$sourceName
private

◆ $type

Wikibase\DataAccess\EntitySource::$type
private

◆ TYPE_API

const Wikibase\DataAccess\EntitySource::TYPE_API = 'api'

◆ TYPE_DB

const Wikibase\DataAccess\EntitySource::TYPE_DB = 'db'

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