Wikibase
MediaWiki Wikibase extension
Loading...
Searching...
No Matches
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.
 
 addEntityStub (EntityId $id)
 Map some aspect of an Entity to the RDF graph, as it should appear in the stub representation of an entity.
 
 markForPrefetchingEntityStub (EntityId $id)
 Mark an entity ID to be prefetched before the entityStub is added.
 

Private Member Functions

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

Private Attributes

PrefetchingTermLookup $termLookup
 
RdfVocabulary $vocabulary
 
RdfWriter $writer
 
array $languageCodes
 
array $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

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

◆ $languageCodes

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

◆ $termLookup

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

◆ $vocabulary

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

◆ $writer

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

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