Wikibase
MediaWiki Wikibase extension
Wikibase\Repo\Rdf\ItemStubRdfBuilder Class Reference
+ Inheritance diagram for Wikibase\Repo\Rdf\ItemStubRdfBuilder:
+ Collaboration diagram for Wikibase\Repo\Rdf\ItemStubRdfBuilder:

Public Member Functions

 __construct (PrefetchingTermLookup $termLookup, RdfVocabulary $vocabulary, RdfWriter $writer, array $labelPredicates, array $languageCodes)
 ItemStubRdfBuilder constructor. More...
 
 addEntityStub (EntityId $id)
 Map some aspect of an Entity to the RDF graph, as it should appear in the stub representation of an entity. More...
 
 markForPrefetchingEntityStub (EntityId $id)
 Mark an entity ID to be prefetched before the entityStub is added. More...
 

Private Member Functions

 addDescriptions ( $entityNamespace, $entityLName, array $descriptions)
 Adds the descriptions of the given entity to the RDF graph. More...
 
 getLabelPredicates (string $entityType)
 Get predicates that will be used for labels. More...
 
 addLabels ( $entityNamespace, $entityLName, array $labels, array $labelPredicates)
 Adds the labels of the given entity to the RDF graph. More...
 
 prefetchEntityStubData ()
 

Private Attributes

 $termLookup
 
 $vocabulary
 
 $writer
 
 $languageCodes
 
 $labelPredicates
 
 $idsToPrefetch = []
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

Wikibase\Repo\Rdf\ItemStubRdfBuilder::__construct ( PrefetchingTermLookup  $termLookup,
RdfVocabulary  $vocabulary,
RdfWriter  $writer,
array  $labelPredicates,
array  $languageCodes 
)

ItemStubRdfBuilder constructor.

Parameters
PrefetchingTermLookup$termLookup
RdfVocabulary$vocabulary
RdfWriter$writer
string[][][]$labelPredicatesMap of type to array of [ ns, local ] for each label predicate
string[]$languageCodes

Member Function Documentation

◆ addDescriptions()

Wikibase\Repo\Rdf\ItemStubRdfBuilder::addDescriptions (   $entityNamespace,
  $entityLName,
array  $descriptions 
)
private

Adds the descriptions of the given entity to the RDF graph.

Parameters
string$entityNamespace
string$entityLName
string[]$descriptions

◆ addEntityStub()

Wikibase\Repo\Rdf\ItemStubRdfBuilder::addEntityStub ( EntityId  $id)

Map some aspect of an Entity to the RDF graph, as it should appear in the stub representation of an entity.

Parameters
EntityId$idthe entity that the rdfbuilder will add stub data to the graph of.

Implements Wikibase\Repo\Rdf\EntityStubRdfBuilder.

◆ addLabels()

Wikibase\Repo\Rdf\ItemStubRdfBuilder::addLabels (   $entityNamespace,
  $entityLName,
array  $labels,
array  $labelPredicates 
)
private

Adds the labels of the given entity to the RDF graph.

Parameters
string$entityNamespace
string$entityLName
array$labels
string[][]$labelPredicatesarray of [ ns, local ] for each label predicate

◆ getLabelPredicates()

Wikibase\Repo\Rdf\ItemStubRdfBuilder::getLabelPredicates ( string  $entityType)
private

Get predicates that will be used for labels.

Parameters
string$entityType
Returns
string[][] array of [ ns, local ] for each label predicate

◆ markForPrefetchingEntityStub()

Wikibase\Repo\Rdf\ItemStubRdfBuilder::markForPrefetchingEntityStub ( EntityId  $id)

Mark an entity ID to be prefetched before the entityStub is added.

Parameters
EntityId$idthe entity ID to prefetch stub data for.

Implements Wikibase\Repo\Rdf\PrefetchingEntityStubRdfBuilder.

◆ prefetchEntityStubData()

Wikibase\Repo\Rdf\ItemStubRdfBuilder::prefetchEntityStubData ( )
private

Member Data Documentation

◆ $idsToPrefetch

Wikibase\Repo\Rdf\ItemStubRdfBuilder::$idsToPrefetch = []
private

◆ $labelPredicates

Wikibase\Repo\Rdf\ItemStubRdfBuilder::$labelPredicates
private

◆ $languageCodes

Wikibase\Repo\Rdf\ItemStubRdfBuilder::$languageCodes
private

◆ $termLookup

Wikibase\Repo\Rdf\ItemStubRdfBuilder::$termLookup
private

◆ $vocabulary

Wikibase\Repo\Rdf\ItemStubRdfBuilder::$vocabulary
private

◆ $writer

Wikibase\Repo\Rdf\ItemStubRdfBuilder::$writer
private

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