Wikibase
MediaWiki Wikibase extension
Wikibase\Repo\Rdf\DispatchingValueSnakRdfBuilder Class Reference

Dispatching implementation of ValueSnakRdfBuilder. More...

+ Inheritance diagram for Wikibase\Repo\Rdf\DispatchingValueSnakRdfBuilder:
+ Collaboration diagram for Wikibase\Repo\Rdf\DispatchingValueSnakRdfBuilder:

Public Member Functions

 __construct (array $valueBuilders, LoggerInterface $logger=null)
 
 addValue (RdfWriter $writer, $propertyValueNamespace, $propertyValueLName, $dataType, $snakNamespace, PropertyValueSnak $snak)
 Adds specific value. More...
 

Private Member Functions

 getValueBuilder ( $dataTypeId, $dataValueType)
 

Private Attributes

 $valueBuilders
 
 $logger
 

Detailed Description

Dispatching implementation of ValueSnakRdfBuilder.

This allows extensions to register ValueSnakRdfBuilders for custom data types.

Author
Daniel Kinzler

Constructor & Destructor Documentation

◆ __construct()

Wikibase\Repo\Rdf\DispatchingValueSnakRdfBuilder::__construct ( array  $valueBuilders,
LoggerInterface  $logger = null 
)
Parameters
ValueSnakRdfBuilder[]$valueBuildersValueSnakRdfBuilder objects keyed by data type (with prefix "PT:") or value type (with prefix "VT:").
LoggerInterface | null$loggerUsed to log a warning when encountering a value without a builder in $valueBuilders.

Member Function Documentation

◆ addValue()

Wikibase\Repo\Rdf\DispatchingValueSnakRdfBuilder::addValue ( RdfWriter  $writer,
  $propertyValueNamespace,
  $propertyValueLName,
  $dataType,
  $snakNamespace,
PropertyValueSnak  $snak 
)

Adds specific value.

Parameters
RdfWriter$writer
string$propertyValueNamespaceProperty value relation namespace
string$propertyValueLNameProperty value relation name
string$dataTypeProperty data type
PropertyValueSnak$snak

Implements Wikibase\Repo\Rdf\ValueSnakRdfBuilder.

◆ getValueBuilder()

Wikibase\Repo\Rdf\DispatchingValueSnakRdfBuilder::getValueBuilder (   $dataTypeId,
  $dataValueType 
)
private
Parameters
string | null$dataTypeId
string$dataValueType
Returns
null|ValueSnakRdfBuilder

Member Data Documentation

◆ $logger

Wikibase\Repo\Rdf\DispatchingValueSnakRdfBuilder::$logger
private

◆ $valueBuilders

Wikibase\Repo\Rdf\DispatchingValueSnakRdfBuilder::$valueBuilders
private

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