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

Manages URIs for the linked data interface. More...

Public Member Functions

 __construct (Title $interfaceTitle, array $supportedExtensions, EntityTitleLookup $entityTitleLookup)
 
 getExtension ( $format)
 
 getFormatName ( $extension)
 
 parseDocName ( $doc)
 Parser for the file-name like document name syntax for specifying an entity data document.
 
 getDocName (EntityId $id, $format='')
 Returns the canonical subpage name used to address a given set of entity data.
 
 getDocTitle (EntityId $id, $format='')
 Returns a Title representing the given document.
 
 getDocUrl (EntityId $id, $format='', $revision=0)
 Returns a Title representing the given document.
 
 getCacheableUrls (EntityId $id)
 Returns a list of all cacheable URLs for all the formats of the given entity.
 

Private Attributes

 $interfaceTitle
 
 $supportedExtensions
 
 $entityTitleLookup
 

Detailed Description

Manages URIs for the linked data interface.

Author
Daniel Kinzler

Constructor & Destructor Documentation

◆ __construct()

Wikibase\Repo\LinkedData\EntityDataUriManager::__construct ( Title  $interfaceTitle,
array  $supportedExtensions,
EntityTitleLookup  $entityTitleLookup 
)
Parameters
Title$interfaceTitle
string[]$supportedExtensionsan associative Array mapping canonical format names to file extensions.
EntityTitleLookup$entityTitleLookup

Member Function Documentation

◆ getCacheableUrls()

Wikibase\Repo\LinkedData\EntityDataUriManager::getCacheableUrls ( EntityId  $id)

Returns a list of all cacheable URLs for all the formats of the given entity.

Parameters
EntityId$id
Returns
string[]

◆ getDocName()

Wikibase\Repo\LinkedData\EntityDataUriManager::getDocName ( EntityId  $id,
  $format = '' 
)

Returns the canonical subpage name used to address a given set of entity data.

Parameters
EntityId$idThe entity
string | null$formatThe (normalized) format name, or ''
Returns
string

◆ getDocTitle()

Wikibase\Repo\LinkedData\EntityDataUriManager::getDocTitle ( EntityId  $id,
  $format = '' 
)

Returns a Title representing the given document.

Parameters
EntityId$idThe entity
string | null$formatThe (normalized) format name, or ''
Returns
Title

◆ getDocUrl()

Wikibase\Repo\LinkedData\EntityDataUriManager::getDocUrl ( EntityId  $id,
  $format = '',
  $revision = 0 
)

Returns a Title representing the given document.

Parameters
EntityId$idThe entity
string | null$formatThe (normalized) format name, or ''
int$revision
Returns
string

◆ getExtension()

Wikibase\Repo\LinkedData\EntityDataUriManager::getExtension (   $format)
Parameters
string$formata canonical format name
Returns
string|null a file extension (without the leading dot), or null.

◆ getFormatName()

Wikibase\Repo\LinkedData\EntityDataUriManager::getFormatName (   $extension)
Parameters
string$extensionfile extension
Returns
string|null the canonical format name (or null)

◆ parseDocName()

Wikibase\Repo\LinkedData\EntityDataUriManager::parseDocName (   $doc)

Parser for the file-name like document name syntax for specifying an entity data document.

This does not validate or interpret the ID or format, it just splits the string.

Parameters
string$doc
Returns
string[] A 2-element array in the form [ string $id, string $format ]

Member Data Documentation

◆ $entityTitleLookup

Wikibase\Repo\LinkedData\EntityDataUriManager::$entityTitleLookup
private

◆ $interfaceTitle

Wikibase\Repo\LinkedData\EntityDataUriManager::$interfaceTitle
private

◆ $supportedExtensions

Wikibase\Repo\LinkedData\EntityDataUriManager::$supportedExtensions
private

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