Wikibase
MediaWiki Wikibase extension
Loading...
Searching...
No Matches
Wikibase\Repo\Dumpers\RdfDumpGenerator Class Reference

RdfDumpGenerator generates an RDF dump of a given set of entities, excluding redirects. More...

+ Inheritance diagram for Wikibase\Repo\Dumpers\RdfDumpGenerator:
+ Collaboration diagram for Wikibase\Repo\Dumpers\RdfDumpGenerator:

Public Member Functions

 __construct ( $out, EntityRevisionLookup $lookup, RdfBuilder $rdfBuilder, EntityPrefetcher $entityPrefetcher, EntityTitleLookup $titleLookup)
 
 setTimestamp ( $timestamp)
 
- Public Member Functions inherited from Wikibase\Repo\Dumpers\DumpGenerator
 __construct ( $out, EntityPrefetcher $entityPrefetcher)
 
 setLimit ( $limit)
 Set maximum number of entities produced.
 
 setBatchSize ( $batchSize)
 Sets the batch size for processing.
 
 setProgressReporter (MessageReporter $progressReporter)
 
 setExceptionHandler (ExceptionHandler $exceptionHandler)
 
 setShardingFilter ( $shardingFactor, $shard)
 Set the sharding factor and desired shard.
 
 setEntityTypesFilter ( $types)
 Set the entity types to be included in the output.
 
 generateDump (EntityIdPager $idPager)
 Generates a dump, writing to the file handle provided to the constructor.
 

Static Public Member Functions

static createDumpGenerator ( $format, $output, $flavor, SiteList $sites, EntityRevisionLookup $entityRevisionLookup, PropertyDataTypeLookup $propertyLookup, ValueSnakRdfBuilderFactory $valueSnakRdfBuilderFactory, EntityRdfBuilderFactory $entityRdfBuilderFactory, EntityPrefetcher $entityPrefetcher, RdfVocabulary $vocabulary, EntityTitleLookup $titleLookup, BNodeLabeler $labeler=null)
 

Protected Member Functions

 preDump ()
 Do something before dumping data.
 
 postDump ()
 Do something after dumping data.
 
 preBatchDump ( $entities)
 Do something before dumping a batch of entities.
 
 generateDumpForEntityId (EntityId $entityId)
 Produces RDF dump of the entity.
 
- Protected Member Functions inherited from Wikibase\Repo\Dumpers\DumpGenerator
 writeToDump ( $data)
 Writers the given string to the output provided to the constructor.
 
 preEntityDump ( $dumpCount)
 Do something before dumping entity.
 
 postEntityDump ( $dumpCount)
 Do something after dumping entity.
 

Static Private Member Functions

static getRdfWriter ( $name, BNodeLabeler $labeler=null)
 
static getFlavorFlags ( $flavorName)
 Get the producer setting for the given flavor.
 

Private Attributes

 $rdfBuilder
 
 $entityRevisionLookup
 
 $timestamp
 
 $pageProps
 
 $titleLookup
 

Additional Inherited Members

- Protected Attributes inherited from Wikibase\Repo\Dumpers\DumpGenerator
 $batchSize = 100
 
 $out
 
 $shardingFactor = 1
 
 $shard = 0
 
 $progressReporter
 
 $exceptionHandler
 
 $entityPrefetcher
 
 $entityTypes
 
 $limit = 0
 

Detailed Description

RdfDumpGenerator generates an RDF dump of a given set of entities, excluding redirects.

Author
Daniel Kinzler
Stas Malyshev

Constructor & Destructor Documentation

◆ __construct()

Wikibase\Repo\Dumpers\RdfDumpGenerator::__construct (   $out,
EntityRevisionLookup  $lookup,
RdfBuilder  $rdfBuilder,
EntityPrefetcher  $entityPrefetcher,
EntityTitleLookup  $titleLookup 
)
Parameters
resource$out
EntityRevisionLookup$lookupMust not resolve redirects
RdfBuilder$rdfBuilder
EntityPrefetcher$entityPrefetcher
EntityTitleLookup$titleLookup

Member Function Documentation

◆ createDumpGenerator()

static Wikibase\Repo\Dumpers\RdfDumpGenerator::createDumpGenerator (   $format,
  $output,
  $flavor,
SiteList  $sites,
EntityRevisionLookup  $entityRevisionLookup,
PropertyDataTypeLookup  $propertyLookup,
ValueSnakRdfBuilderFactory  $valueSnakRdfBuilderFactory,
EntityRdfBuilderFactory  $entityRdfBuilderFactory,
EntityPrefetcher  $entityPrefetcher,
RdfVocabulary  $vocabulary,
EntityTitleLookup  $titleLookup,
BNodeLabeler  $labeler = null 
)
static
Parameters
string$format
resource$output
string$flavorEither "full" or "truthy"
SiteList$sites
EntityRevisionLookup$entityRevisionLookup
PropertyDataTypeLookup$propertyLookup
ValueSnakRdfBuilderFactory$valueSnakRdfBuilderFactory
EntityRdfBuilderFactory$entityRdfBuilderFactory
EntityPrefetcher$entityPrefetcher
RdfVocabulary$vocabulary
EntityTitleLookup$titleLookup
BNodeLabeler | null$labeler
Returns
static
Exceptions
InvalidArgumentException

◆ generateDumpForEntityId()

Wikibase\Repo\Dumpers\RdfDumpGenerator::generateDumpForEntityId ( EntityId  $entityId)
protected

Produces RDF dump of the entity.

Parameters
EntityId$entityId
Exceptions
EntityLookupException
StorageException
Returns
string|null RDF

Reimplemented from Wikibase\Repo\Dumpers\DumpGenerator.

◆ getFlavorFlags()

static Wikibase\Repo\Dumpers\RdfDumpGenerator::getFlavorFlags (   $flavorName)
staticprivate

Get the producer setting for the given flavor.

Parameters
string | null$flavorName
Returns
int
Exceptions
InvalidArgumentException

◆ getRdfWriter()

static Wikibase\Repo\Dumpers\RdfDumpGenerator::getRdfWriter (   $name,
BNodeLabeler  $labeler = null 
)
staticprivate

◆ postDump()

Wikibase\Repo\Dumpers\RdfDumpGenerator::postDump ( )
protected

Do something after dumping data.

Reimplemented from Wikibase\Repo\Dumpers\DumpGenerator.

◆ preBatchDump()

Wikibase\Repo\Dumpers\RdfDumpGenerator::preBatchDump (   $entities)
protected

Do something before dumping a batch of entities.

Parameters
EntityId[]$entities

Reimplemented from Wikibase\Repo\Dumpers\DumpGenerator.

◆ preDump()

Wikibase\Repo\Dumpers\RdfDumpGenerator::preDump ( )
protected

Do something before dumping data.

Reimplemented from Wikibase\Repo\Dumpers\DumpGenerator.

◆ setTimestamp()

Wikibase\Repo\Dumpers\RdfDumpGenerator::setTimestamp (   $timestamp)
Parameters
int$timestamp

Member Data Documentation

◆ $entityRevisionLookup

Wikibase\Repo\Dumpers\RdfDumpGenerator::$entityRevisionLookup
private

◆ $pageProps

Wikibase\Repo\Dumpers\RdfDumpGenerator::$pageProps
private

◆ $rdfBuilder

Wikibase\Repo\Dumpers\RdfDumpGenerator::$rdfBuilder
private

◆ $timestamp

Wikibase\Repo\Dumpers\RdfDumpGenerator::$timestamp
private

◆ $titleLookup

Wikibase\Repo\Dumpers\RdfDumpGenerator::$titleLookup
private

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