Wikibase
MediaWiki Wikibase extension
Loading...
Searching...
No Matches
Wikibase\Repo\ValidatorBuilders Class Reference

Defines validators for the basic well known data types supported by Wikibase. More...

+ Collaboration diagram for Wikibase\Repo\ValidatorBuilders:

Public Member Functions

 __construct (EntityLookup $lookup, EntityIdParser $idParser, array $urlSchemes, string $itemVocabularyBaseUri, ContentLanguages $contentLanguages, CachingCommonsMediaFileNameLookup $cachingCommonsMediaFileNameLookup, MediaWikiPageNameNormalizer $mediaWikiPageNameNormalizer, string $geoShapeStorageApiUrl, string $tabularDataStorageApiUrl)
 
 buildItemValidators ()
 
 buildPropertyValidators ()
 
 buildEntityValidators ()
 
 getEntityValidators (string $entityType=null)
 
 buildMediaValidators (string $checkExistence='checkExistence')
 
 buildGeoShapeValidators (string $checkExistence='checkExistence')
 
 buildTabularDataValidators (string $checkExistence='checkExistence')
 
 buildStringValidators (int $maxLength=400)
 
 buildMonolingualTextValidators (int $maxLength=400)
 
 buildTimeValidators ()
 
 buildCoordinateValidators ()
 
 buildUrlValidators (int $maxLength=500)
 
 buildQuantityValidators ()
 

Private Member Functions

 getCommonStringValidators (int $maxLength=400)
 
 getUrlValidators (array $urlSchemes, int $maxLength)
 
 getEntityUriValidator (string $prefix, int $maxLength, ?string $entityType=null)
 

Private Attributes

EntityLookup $entityLookup
 
EntityIdParser $entityIdParser
 
array $urlSchemes
 
string $itemVocabularyBaseUri
 
string $wikidataBaseUri = 'http://www.wikidata.org/entity/'
 
ContentLanguages $contentLanguages
 
CachingCommonsMediaFileNameLookup $mediaFileNameLookup
 
MediaWikiPageNameNormalizer $mediaWikiPageNameNormalizer
 
string $geoShapeStorageApiUrl
 
string $tabularDataStorageApiUrl
 

Detailed Description

Defines validators for the basic well known data types supported by Wikibase.

Warning
: This is a low level factory for use by bootstrap code only! Program logic should use an instance of DataTypeValidatorFactory.
Author
Daniel Kinzler

Constructor & Destructor Documentation

◆ __construct()

Wikibase\Repo\ValidatorBuilders::__construct ( EntityLookup $lookup,
EntityIdParser $idParser,
array $urlSchemes,
string $itemVocabularyBaseUri,
ContentLanguages $contentLanguages,
CachingCommonsMediaFileNameLookup $cachingCommonsMediaFileNameLookup,
MediaWikiPageNameNormalizer $mediaWikiPageNameNormalizer,
string $geoShapeStorageApiUrl,
string $tabularDataStorageApiUrl )
Parameters
EntityLookup$lookup
EntityIdParser$idParser
string[]$urlSchemes
string$itemVocabularyBaseUriThe base URI for vocabulary concepts.
ContentLanguages$contentLanguages
CachingCommonsMediaFileNameLookup$cachingCommonsMediaFileNameLookup
MediaWikiPageNameNormalizer$mediaWikiPageNameNormalizer
string$geoShapeStorageApiUrl
string$tabularDataStorageApiUrl

Member Function Documentation

◆ buildCoordinateValidators()

Wikibase\Repo\ValidatorBuilders::buildCoordinateValidators ( )
Returns
ValueValidator[]

◆ buildEntityValidators()

Wikibase\Repo\ValidatorBuilders::buildEntityValidators ( )
Returns
ValueValidator[]

◆ buildGeoShapeValidators()

Wikibase\Repo\ValidatorBuilders::buildGeoShapeValidators ( string $checkExistence = 'checkExistence')
Parameters
string$checkExistenceEither 'checkExistence' or 'doNotCheckExistence'
Returns
ValueValidator[]

◆ buildItemValidators()

Wikibase\Repo\ValidatorBuilders::buildItemValidators ( )
Returns
ValueValidator[]

◆ buildMediaValidators()

Wikibase\Repo\ValidatorBuilders::buildMediaValidators ( string $checkExistence = 'checkExistence')
Parameters
string$checkExistenceEither 'checkExistence' or 'doNotCheckExistence'
Returns
ValueValidator[]

◆ buildMonolingualTextValidators()

Wikibase\Repo\ValidatorBuilders::buildMonolingualTextValidators ( int $maxLength = 400)
Parameters
int$maxLengthDefaults to 400 characters. This was an arbitrary decision and simply copied the default of the CommonStringValidators
Returns
ValueValidator[]

◆ buildPropertyValidators()

Wikibase\Repo\ValidatorBuilders::buildPropertyValidators ( )
Returns
ValueValidator[]

◆ buildQuantityValidators()

Wikibase\Repo\ValidatorBuilders::buildQuantityValidators ( )
Returns
ValueValidator[]

◆ buildStringValidators()

Wikibase\Repo\ValidatorBuilders::buildStringValidators ( int $maxLength = 400)
Parameters
int$maxLength
Returns
ValueValidator[]

◆ buildTabularDataValidators()

Wikibase\Repo\ValidatorBuilders::buildTabularDataValidators ( string $checkExistence = 'checkExistence')
Parameters
string$checkExistenceEither 'checkExistence' or 'doNotCheckExistence'
Returns
ValueValidator[]

◆ buildTimeValidators()

Wikibase\Repo\ValidatorBuilders::buildTimeValidators ( )
Returns
ValueValidator[]

◆ buildUrlValidators()

Wikibase\Repo\ValidatorBuilders::buildUrlValidators ( int $maxLength = 500)
Parameters
int$maxLength
Returns
ValueValidator[]

◆ getCommonStringValidators()

Wikibase\Repo\ValidatorBuilders::getCommonStringValidators ( int $maxLength = 400)
private
Parameters
int$maxLengthDefaults to 400 characters. This was an arbitrary decision when it turned out that 255 was to short for descriptions.
Returns
ValueValidator[]

◆ getEntityUriValidator()

Wikibase\Repo\ValidatorBuilders::getEntityUriValidator ( string $prefix,
int $maxLength,
?string $entityType = null )
private

◆ getEntityValidators()

Wikibase\Repo\ValidatorBuilders::getEntityValidators ( string $entityType = null)
Parameters
string | null$entityType
Returns
ValueValidator[]

◆ getUrlValidators()

Wikibase\Repo\ValidatorBuilders::getUrlValidators ( array $urlSchemes,
int $maxLength )
private
Parameters
string[]$urlSchemesList of URL schemes, e.g. 'http'
int$maxLengthMaximum length in bytes; compare https://stackoverflow.com/a/417184
Returns
ValueValidator[]

Member Data Documentation

◆ $contentLanguages

ContentLanguages Wikibase\Repo\ValidatorBuilders::$contentLanguages
private

◆ $entityIdParser

EntityIdParser Wikibase\Repo\ValidatorBuilders::$entityIdParser
private

◆ $entityLookup

EntityLookup Wikibase\Repo\ValidatorBuilders::$entityLookup
private

◆ $geoShapeStorageApiUrl

string Wikibase\Repo\ValidatorBuilders::$geoShapeStorageApiUrl
private

◆ $itemVocabularyBaseUri

string Wikibase\Repo\ValidatorBuilders::$itemVocabularyBaseUri
private

◆ $mediaFileNameLookup

CachingCommonsMediaFileNameLookup Wikibase\Repo\ValidatorBuilders::$mediaFileNameLookup
private

◆ $mediaWikiPageNameNormalizer

MediaWikiPageNameNormalizer Wikibase\Repo\ValidatorBuilders::$mediaWikiPageNameNormalizer
private

◆ $tabularDataStorageApiUrl

string Wikibase\Repo\ValidatorBuilders::$tabularDataStorageApiUrl
private

◆ $urlSchemes

array Wikibase\Repo\ValidatorBuilders::$urlSchemes
private

◆ $wikidataBaseUri

string Wikibase\Repo\ValidatorBuilders::$wikidataBaseUri = 'http://www.wikidata.org/entity/'
private

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