Generate dump-like RDF for newly added units without running full dump.
More...
Generate dump-like RDF for newly added units without running full dump.
- Copyright
- GPL-2.0-or-later
- Author
- Stas Malyshev
◆ __construct()
Wikibase\Repo\Maintenance\AddUnitConversions::__construct |
( |
| ) |
|
◆ createRdfVocabulary()
Wikibase\Repo\Maintenance\AddUnitConversions::createRdfVocabulary |
( |
|
$baseUri, |
|
|
|
$typeUris |
|
) |
| |
|
private |
Get vocabulary instance.
- Parameters
-
string | $baseUri | |
string[] | $typeUris | |
- Returns
- RdfVocabulary
◆ createRdfWriter()
Wikibase\Repo\Maintenance\AddUnitConversions::createRdfWriter |
( |
|
$format | ) |
|
|
private |
- Parameters
-
string | $format | File extension or MIME type of the output format. |
- Returns
- RdfWriter
◆ execute()
Wikibase\Repo\Maintenance\AddUnitConversions::execute |
( |
| ) |
|
Do the actual work.
All child classes will need to implement this
◆ getNormalized()
Wikibase\Repo\Maintenance\AddUnitConversions::getNormalized |
( |
|
$id, |
|
|
|
$unit, |
|
|
array |
$value |
|
) |
| |
|
private |
Normalize unit and return the hash of the normalized node.
- Parameters
-
string | $id | Original value ID (hash) |
string | $unit | Short ID of the unit |
string[] | $value | Value data array |
- Returns
- string Hash of the normalized node
◆ initializeBuilder()
Wikibase\Repo\Maintenance\AddUnitConversions::initializeBuilder |
( |
| ) |
|
Initialize quantity builder.
◆ initializeWriter()
Wikibase\Repo\Maintenance\AddUnitConversions::initializeWriter |
( |
|
$baseUri, |
|
|
|
$format |
|
) |
| |
Initialize RDF writer.
- Parameters
-
string | $baseUri | |
string | $format | File extension or MIME type of the output format. |
◆ processStatements()
Wikibase\Repo\Maintenance\AddUnitConversions::processStatements |
( |
|
$values, |
|
|
|
$map |
|
) |
| |
|
private |
Process statements for particular set of values.
Will scan through the triples which use each of the values and add appropriate normalized triple referring to the normalized value. E.g. <s123> psv:P345 wdv:xys -> <s123> psn:P345 wdv:xyznorm
- Parameters
-
string[] | $values | Value hashes |
string[] | $map | Map old id -> normalized id |
◆ processUnit()
Wikibase\Repo\Maintenance\AddUnitConversions::processUnit |
( |
|
$unit | ) |
|
Generate all statements for a specific unit.
- Parameters
-
◆ startDocument()
Wikibase\Repo\Maintenance\AddUnitConversions::startDocument |
( |
| ) |
|
◆ writeOut()
Wikibase\Repo\Maintenance\AddUnitConversions::writeOut |
( |
| ) |
|
|
protected |
Write data to the output.
◆ $builder
Wikibase\Repo\Maintenance\AddUnitConversions::$builder |
|
protected |
◆ $client
Wikibase\Repo\Maintenance\AddUnitConversions::$client |
|
protected |
◆ $dryRun
Wikibase\Repo\Maintenance\AddUnitConversions::$dryRun |
|
private |
◆ $normalizedNames
Wikibase\Repo\Maintenance\AddUnitConversions::$normalizedNames |
|
private |
◆ $normMap
Wikibase\Repo\Maintenance\AddUnitConversions::$normMap |
|
private |
◆ $out
Wikibase\Repo\Maintenance\AddUnitConversions::$out |
|
private |
◆ $rdfVocabulary
Wikibase\Repo\Maintenance\AddUnitConversions::$rdfVocabulary |
|
private |
◆ $rdfWriter
Wikibase\Repo\Maintenance\AddUnitConversions::$rdfWriter |
|
protected |
◆ $unitConverter
Wikibase\Repo\Maintenance\AddUnitConversions::$unitConverter |
|
protected |
◆ $valueURI
Wikibase\Repo\Maintenance\AddUnitConversions::$valueURI |
|
private |
◆ MAX_QUERY_CHUNK
const Wikibase\Repo\Maintenance\AddUnitConversions::MAX_QUERY_CHUNK = 100 |
Max chunk of values processed by one query.
The documentation for this class was generated from the following file: