Wikibase
MediaWiki Wikibase extension
Loading...
Searching...
No Matches
Wikibase\Repo\Rdf\TruthyStatementRdfBuilder Class Reference

"Truthy" RDF mapping for wikibase statements, directly mapping properties to "best" values without modelling statements as identifiable objects. More...

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

Public Member Functions

 __construct (RdfVocabulary $vocabulary, RdfWriter $writer, SnakRdfBuilder $snakBuilder)
 
 addStatements (EntityId $entityId, StatementList $statementList)
 Adds Statements to the RDF graph.
 
 addEntity (EntityDocument $entity)
 Add truthy statements for the given entity to the RDF graph.
 

Private Member Functions

 addMainSnak (EntityId $entityId, Statement $statement)
 Adds the given Statement's main Snak to the RDF graph.
 

Private Attributes

 $vocabulary
 
 $writer
 
 $snakBuilder
 

Detailed Description

"Truthy" RDF mapping for wikibase statements, directly mapping properties to "best" values without modelling statements as identifiable objects.

"Best" statements per property are statements that have the best non-deprecated rank.

This simple property to value mapping excludes deprecated and non-"best" statements, ranks, qualifiers, and references. This allows for a much simpler, much easier to query RDF structure that allows searching for values similar to what would have been shown in infoboxes via Lua.

If more information is needed, use FullStatementRdfBuilder instead.

See also
FullStatementRdfBuilder
Author
Daniel Kinzler
Stas Malyshev

Constructor & Destructor Documentation

◆ __construct()

Wikibase\Repo\Rdf\TruthyStatementRdfBuilder::__construct ( RdfVocabulary $vocabulary,
RdfWriter $writer,
SnakRdfBuilder $snakBuilder )

Member Function Documentation

◆ addEntity()

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

Add truthy statements for the given entity to the RDF graph.

Parameters
EntityDocument$entitythe entity to output.

Implements Wikibase\Repo\Rdf\EntityRdfBuilder.

◆ addMainSnak()

Wikibase\Repo\Rdf\TruthyStatementRdfBuilder::addMainSnak ( EntityId $entityId,
Statement $statement )
private

Adds the given Statement's main Snak to the RDF graph.

Todo
share more of this code with FullStatementRdfBuilder
Parameters
EntityId$entityId
Statement$statement
Exceptions
InvalidArgumentException

◆ addStatements()

Wikibase\Repo\Rdf\TruthyStatementRdfBuilder::addStatements ( EntityId $entityId,
StatementList $statementList )

Adds Statements to the RDF graph.

Parameters
EntityId$entityId
StatementList$statementList

Member Data Documentation

◆ $snakBuilder

Wikibase\Repo\Rdf\TruthyStatementRdfBuilder::$snakBuilder
private

◆ $vocabulary

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

◆ $writer

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

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