Wikibase
MediaWiki Wikibase extension
|
RDF mapping for wikibase data model. More...
Public Member Functions | |
__construct (RdfVocabulary $vocabulary, EntityRdfBuilderFactory $entityRdfBuilderFactory, int $flavor, RdfWriter $writer, DedupeBag $dedupeBag, EntityContentFactory $entityContentFactory, EntityStubRdfBuilderFactory $entityStubRdfBuilderFactory, EntityRevisionLookup $entityRevisionLookup) | |
startDocument () | |
Start writing RDF document Note that this builder does not have to finish it, it may be finished later. | |
finishDocument () | |
Finish writing the document After that, nothing should ever be written into the document. | |
getRDF () | |
Returns the RDF generated by the builder. | |
getNamespaces () | |
Returns a map of namespace names to URIs. | |
getPagePropertyDefs () | |
Get map of page properties used by this builder. | |
entityReferenceMentioned (EntityId $id) | |
propertyMentioned (PropertyId $id) | |
subEntityMentioned (EntityDocument $entity) | |
addEntityRevisionInfo (EntityId $entityId, int $revision, string $timestamp) | |
Adds revision information about an entity's revision to the RDF graph. | |
addEntityPageProps (EntityDocument $entity) | |
Add page props information. | |
addEntity (EntityDocument $entity) | |
Add an entity to the RDF graph, including all supported structural components of the entity and its sub entities. | |
resolveMentionedEntities () | |
Add stubs for any entities that were previously mentioned (e.g. | |
addEntityStub (EntityId $entityId) | |
Adds stub information for the given EntityId to the RDF graph. | |
addEntityRedirect (EntityId $from, EntityId $to) | |
Declares $from to be an alias for $to, using the owl:sameAs relationship. | |
addDumpHeader (int $timestamp=0) | |
Create header structure for the dump (this makes RdfProducer::PRODUCE_VERSION_INFO redundant) | |
Private Member Functions | |
shouldProduce (int $what) | |
Should we produce this aspect? | |
entityToResolve (EntityId $entityId) | |
Registers an entity as mentioned. | |
entityResolved (EntityId $entityId) | |
Registers an entity as resolved. | |
addEntityMetaData (EntityId $entityId) | |
Adds meta-information about an entity id (such as the ID and type) to the RDF graph. | |
addSingleEntity (EntityDocument $entity) | |
Add a single entity to the RDF graph, including all supported structural components of the entity. | |
addQueuedEntities () | |
Add the RDF serialization of all entities in the entitiesToOutput queue. | |
markStubEntityDataForPrefetching (array $entityIds) | |
RDF mapping for wikibase data model.
Wikibase\Repo\Rdf\RdfBuilder::__construct | ( | RdfVocabulary | $vocabulary, |
EntityRdfBuilderFactory | $entityRdfBuilderFactory, | ||
int | $flavor, | ||
RdfWriter | $writer, | ||
DedupeBag | $dedupeBag, | ||
EntityContentFactory | $entityContentFactory, | ||
EntityStubRdfBuilderFactory | $entityStubRdfBuilderFactory, | ||
EntityRevisionLookup | $entityRevisionLookup ) |
Wikibase\Repo\Rdf\RdfBuilder::addDumpHeader | ( | int | $timestamp = 0 | ) |
Create header structure for the dump (this makes RdfProducer::PRODUCE_VERSION_INFO redundant)
int | $timestamp | Timestamp (for testing) |
Wikibase\Repo\Rdf\RdfBuilder::addEntity | ( | EntityDocument | $entity | ) |
Add an entity to the RDF graph, including all supported structural components of the entity and its sub entities.
EntityDocument | $entity | the entity to output. |
Implements Wikibase\Repo\Rdf\EntityRdfBuilder.
|
private |
Adds meta-information about an entity id (such as the ID and type) to the RDF graph.
Wikibase\Repo\Rdf\RdfBuilder::addEntityPageProps | ( | EntityDocument | $entity | ) |
Add page props information.
To ensure consistent data, this recalculates the page props from the entity content; it does not actually query the page_props table.
Declares $from to be an alias for $to, using the owl:sameAs relationship.
Wikibase\Repo\Rdf\RdfBuilder::addEntityRevisionInfo | ( | EntityId | $entityId, |
int | $revision, | ||
string | $timestamp ) |
Adds revision information about an entity's revision to the RDF graph.
EntityId | $entityId | |
int | $revision | |
string | $timestamp | in TS_MW format |
Wikibase\Repo\Rdf\RdfBuilder::addEntityStub | ( | EntityId | $entityId | ) |
Adds stub information for the given EntityId to the RDF graph.
Stub information means meta information and labels.
Implements Wikibase\Repo\Rdf\EntityStubRdfBuilder.
|
private |
Add the RDF serialization of all entities in the entitiesToOutput queue.
|
private |
Add a single entity to the RDF graph, including all supported structural components of the entity.
EntityDocument | $entity | the entity to output. |
Wikibase\Repo\Rdf\RdfBuilder::entityReferenceMentioned | ( | EntityId | $id | ) |
Implements Wikibase\Repo\Rdf\EntityMentionListener.
|
private |
Registers an entity as resolved.
|
private |
Registers an entity as mentioned.
Will be recorded as unresolved if it wasn't already marked as resolved.
Wikibase\Repo\Rdf\RdfBuilder::finishDocument | ( | ) |
Finish writing the document After that, nothing should ever be written into the document.
Wikibase\Repo\Rdf\RdfBuilder::getNamespaces | ( | ) |
Returns a map of namespace names to URIs.
Wikibase\Repo\Rdf\RdfBuilder::getPagePropertyDefs | ( | ) |
Get map of page properties used by this builder.
Wikibase\Repo\Rdf\RdfBuilder::getRDF | ( | ) |
Returns the RDF generated by the builder.
|
private |
Wikibase\Repo\Rdf\RdfBuilder::propertyMentioned | ( | PropertyId | $id | ) |
Implements Wikibase\Repo\Rdf\EntityMentionListener.
Wikibase\Repo\Rdf\RdfBuilder::resolveMentionedEntities | ( | ) |
Add stubs for any entities that were previously mentioned (e.g.
as properties or data values).
|
private |
Should we produce this aspect?
Wikibase\Repo\Rdf\RdfBuilder::startDocument | ( | ) |
Start writing RDF document Note that this builder does not have to finish it, it may be finished later.
Wikibase\Repo\Rdf\RdfBuilder::subEntityMentioned | ( | EntityDocument | $entity | ) |
Implements Wikibase\Repo\Rdf\EntityMentionListener.
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |