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

RDF mapping for entity terms. More...

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

Public Member Functions

 __construct (RdfVocabulary $vocabulary, RdfWriter $writer, array $labelPredicates=[], array $languages=null)
 
 addEntity (EntityDocument $entity)
 Add the entity's labels, descriptions, and aliases to the RDF graph. More...
 
 addEntityStub (EntityDocument $entity)
 Add the entity's labels and descriptions to the RDF graph. More...
 

Private Member Functions

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

Private Attributes

 $vocabulary
 
 $writer
 
 $languages
 
 $labelPredicates
 

Detailed Description

RDF mapping for entity terms.

Constructor & Destructor Documentation

◆ __construct()

Wikibase\Repo\Rdf\TermsRdfBuilder::__construct ( RdfVocabulary  $vocabulary,
RdfWriter  $writer,
array  $labelPredicates = [],
array  $languages = null 
)
Parameters
RdfVocabulary$vocabulary
RdfWriter$writer
string[][][]$labelPredicatesMap of type to array of [ ns, local ] for each label predicate
string[] | null$languages

Member Function Documentation

◆ addDescriptions()

Wikibase\Repo\Rdf\TermsRdfBuilder::addDescriptions (   $entityNamespace,
  $entityLName,
TermList  $descriptions 
)
private

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

Parameters
string$entityNamespace
string$entityLName
TermList$descriptions

◆ addEntity()

Wikibase\Repo\Rdf\TermsRdfBuilder::addEntity ( EntityDocument  $entity)

Add the entity's labels, descriptions, and aliases to the RDF graph.

See also
EntityRdfBuilder::addEntity
Parameters
EntityDocument$entitythe entity to output. PhanTypeMismatchArgument

Implements Wikibase\Repo\Rdf\EntityRdfBuilder.

◆ addEntityStub()

Wikibase\Repo\Rdf\TermsRdfBuilder::addEntityStub ( EntityDocument  $entity)

Add the entity's labels and descriptions to the RDF graph.

See also
EntityRdfBuilder::addEntityStub
Parameters
EntityDocument$entitythe entity to output. PhanTypeMismatchArgument

Implements Wikibase\Repo\Rdf\EntityRdfBuilder.

◆ addLabels()

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

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

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

◆ getLabelPredicates()

Wikibase\Repo\Rdf\TermsRdfBuilder::getLabelPredicates ( EntityDocument  $entity)
private

Get predicates that will be used for labels.

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

Member Data Documentation

◆ $labelPredicates

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

◆ $languages

Wikibase\Repo\Rdf\TermsRdfBuilder::$languages
private

◆ $vocabulary

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

◆ $writer

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

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