Wikibase
MediaWiki Wikibase extension
Wikibase\Repo\Rdf\Values\ComplexValueRdfHelper Class Reference

Helper object for mapping DataValues to complex RDF structures (value nodes). More...

Public Member Functions

 __construct (RdfVocabulary $vocabulary, RdfWriter $valueNodeWriter, DedupeBag $dedupeBag=null)
 
 getValueNodeWriter ()
 
 attachValueNode (RdfWriter $writer, $propertyValueNamespace, $propertyValueLName, $dataType, $snakNamespace, DataValue $value, $normalized=false)
 Creates a value node for $value, and attaches it to the current subject of $writer. More...
 

Private Attributes

 $vocabulary
 
 $dedupeBag
 
 $valueNodeWriter
 

Detailed Description

Helper object for mapping DataValues to complex RDF structures (value nodes).

Author
Daniel Kinzler
Stas Malyshev

Constructor & Destructor Documentation

◆ __construct()

Wikibase\Repo\Rdf\Values\ComplexValueRdfHelper::__construct ( RdfVocabulary  $vocabulary,
RdfWriter  $valueNodeWriter,
DedupeBag  $dedupeBag = null 
)
Parameters
RdfVocabulary$vocabulary
RdfWriter$valueNodeWriter
DedupeBag | null$dedupeBag

Member Function Documentation

◆ attachValueNode()

Wikibase\Repo\Rdf\Values\ComplexValueRdfHelper::attachValueNode ( RdfWriter  $writer,
  $propertyValueNamespace,
  $propertyValueLName,
  $dataType,
  $snakNamespace,
DataValue  $value,
  $normalized = false 
)

Creates a value node for $value, and attaches it to the current subject of $writer.

If a value node for $value was already created, null is returned. Otherwise, the value node's lname is returned, which should be used to generate detailed about the value into the writer returned by getValueNodeWriter().

When this method returns a non-null lname, the current subject of the RdfWriter returned by getValueNodeWriter() will the be value node with that lname.

Parameters
RdfWriter$writer
string$propertyValueNamespaceProperty value relation namespace
string$propertyValueLNameProperty value relation name
string$dataTypeProperty data type (unused, passed here for symmetry with the signature of ValueSnakRdfBuilder::addValue).
DataValue$value
bool$normalizedIs this a normalized value?
Returns
string|null The LName of the value node (in the RdfVocabulary::NS_VALUE namespace), or null if the value node should not be processed (generally, because it already has been processed).

◆ getValueNodeWriter()

Wikibase\Repo\Rdf\Values\ComplexValueRdfHelper::getValueNodeWriter ( )
Returns
RdfWriter

Member Data Documentation

◆ $dedupeBag

Wikibase\Repo\Rdf\Values\ComplexValueRdfHelper::$dedupeBag
private

◆ $valueNodeWriter

Wikibase\Repo\Rdf\Values\ComplexValueRdfHelper::$valueNodeWriter
private

◆ $vocabulary

Wikibase\Repo\Rdf\Values\ComplexValueRdfHelper::$vocabulary
private

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