Wikibase
MediaWiki Wikibase extension
Loading...
Searching...
No Matches
Wikibase\Repo\Rdf\PropertyStubRdfBuilder Class Reference
+ Inheritance diagram for Wikibase\Repo\Rdf\PropertyStubRdfBuilder:
+ Collaboration diagram for Wikibase\Repo\Rdf\PropertyStubRdfBuilder:

Public Member Functions

 __construct (PrefetchingTermLookup $prefetchingLookup, PropertyDataTypeLookup $dataTypeLookup, ContentLanguages $termLanguages, RdfVocabulary $vocabulary, RdfWriter $writer, array $dataTypes=[], array $labelPredicates=[])
 
 addEntityStub (EntityId $entityId)
 Map some aspect of an Entity to the RDF graph, as it should appear in the stub representation of an entity.
 
 markForPrefetchingEntityStub (EntityId $id)
 Mark an entity ID to be prefetched before the entityStub is added.
 

Public Attributes

const OBJECT_PROPERTY = 'ObjectProperty'
 

Private Member Functions

 addDescriptions ( $entityNamespace, $entityLName, array $descriptions)
 Adds the descriptions of the given entity to the RDF graph.
 
 addLabels ( $entityNamespace, $entityLName, array $labels, array $labelPredicates)
 Adds the labels of the given entity to the RDF graph.
 
 getLabelPredicates (EntityId $entityId)
 Get predicates that will be used for labels.
 
 addProperty (PropertyId $propertyId)
 Adds property info to the RDF graph.
 
 writePropertyPredicates ( $localName, $repositoryName, $propertyRdfType, $normalizedPropertyRdfType)
 Write predicates linking property entity to property predicates.
 
 getPropertyRdfType (string $dataTypeId)
 Check if the property describes link between objects or just data item.
 
 getNormalizedPropertyRdfType (string $dataTypeId)
 
 writeNovalueClass ( $localName, $repositoryName)
 Write definition for wdno:P123 class to use as novalue.
 
 prefetchEntityStubData ()
 

Private Attributes

const DATATYPE_PROPERTY = 'DatatypeProperty'
 
const NO_NORMALIZATION = null
 
 $prefetchingLookup
 
 $dataTypeLookup
 
 $termLanguages
 
 $vocabulary
 
 $writer
 
 $labelPredicates
 
 $dataTypes
 
 $idsToPrefetch = []
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

Wikibase\Repo\Rdf\PropertyStubRdfBuilder::__construct ( PrefetchingTermLookup $prefetchingLookup,
PropertyDataTypeLookup $dataTypeLookup,
ContentLanguages $termLanguages,
RdfVocabulary $vocabulary,
RdfWriter $writer,
array $dataTypes = [],
array $labelPredicates = [] )

Member Function Documentation

◆ addDescriptions()

Wikibase\Repo\Rdf\PropertyStubRdfBuilder::addDescriptions ( $entityNamespace,
$entityLName,
array $descriptions )
private

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

Parameters
string$entityNamespace
string$entityLName
array$descriptions

◆ addEntityStub()

Wikibase\Repo\Rdf\PropertyStubRdfBuilder::addEntityStub ( EntityId $id)

Map some aspect of an Entity to the RDF graph, as it should appear in the stub representation of an entity.

Parameters
EntityId$idthe entity that the rdfbuilder will add stub data to the graph of.

Implements Wikibase\Repo\Rdf\EntityStubRdfBuilder.

◆ addLabels()

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

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

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

◆ addProperty()

Wikibase\Repo\Rdf\PropertyStubRdfBuilder::addProperty ( PropertyId $propertyId)
private

Adds property info to the RDF graph.

Parameters
PropertyId$propertyId

◆ getLabelPredicates()

Wikibase\Repo\Rdf\PropertyStubRdfBuilder::getLabelPredicates ( EntityId $entityId)
private

Get predicates that will be used for labels.

Parameters
EntityId$entityId
Returns
string[][] array of [ ns, local ] for each label predicate

◆ getNormalizedPropertyRdfType()

Wikibase\Repo\Rdf\PropertyStubRdfBuilder::getNormalizedPropertyRdfType ( string $dataTypeId)
private
Parameters
string$dataTypeId
Returns
string|null

◆ getPropertyRdfType()

Wikibase\Repo\Rdf\PropertyStubRdfBuilder::getPropertyRdfType ( string $dataTypeId)
private

Check if the property describes link between objects or just data item.

Parameters
string$dataTypeId
Returns
string RDF/OWL type name for this property.

◆ markForPrefetchingEntityStub()

Wikibase\Repo\Rdf\PropertyStubRdfBuilder::markForPrefetchingEntityStub ( EntityId $id)

Mark an entity ID to be prefetched before the entityStub is added.

Parameters
EntityId$idthe entity ID to prefetch stub data for.

Implements Wikibase\Repo\Rdf\PrefetchingEntityStubRdfBuilder.

◆ prefetchEntityStubData()

Wikibase\Repo\Rdf\PropertyStubRdfBuilder::prefetchEntityStubData ( )
private

◆ writeNovalueClass()

Wikibase\Repo\Rdf\PropertyStubRdfBuilder::writeNovalueClass ( $localName,
$repositoryName )
private

Write definition for wdno:P123 class to use as novalue.

Parameters
string$localName
string$repositoryName

◆ writePropertyPredicates()

Wikibase\Repo\Rdf\PropertyStubRdfBuilder::writePropertyPredicates ( $localName,
$repositoryName,
$propertyRdfType,
$normalizedPropertyRdfType )
private

Write predicates linking property entity to property predicates.

Parameters
string$localName
string$repositoryName
string$propertyRdfTypeOWL data type (OBJECT_PROPERTY or DATATYPE_PROPERTY)
string | null$normalizedPropertyRdfTypeDoes the property have normalized predicates, and if so does the property normalize to data or objects?

Member Data Documentation

◆ $dataTypeLookup

Wikibase\Repo\Rdf\PropertyStubRdfBuilder::$dataTypeLookup
private

◆ $dataTypes

Wikibase\Repo\Rdf\PropertyStubRdfBuilder::$dataTypes
private

◆ $idsToPrefetch

Wikibase\Repo\Rdf\PropertyStubRdfBuilder::$idsToPrefetch = []
private

◆ $labelPredicates

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

◆ $prefetchingLookup

Wikibase\Repo\Rdf\PropertyStubRdfBuilder::$prefetchingLookup
private

◆ $termLanguages

Wikibase\Repo\Rdf\PropertyStubRdfBuilder::$termLanguages
private

◆ $vocabulary

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

◆ $writer

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

◆ DATATYPE_PROPERTY

const Wikibase\Repo\Rdf\PropertyStubRdfBuilder::DATATYPE_PROPERTY = 'DatatypeProperty'
private

◆ NO_NORMALIZATION

const Wikibase\Repo\Rdf\PropertyStubRdfBuilder::NO_NORMALIZATION = null
private

◆ OBJECT_PROPERTY

const Wikibase\Repo\Rdf\PropertyStubRdfBuilder::OBJECT_PROPERTY = 'ObjectProperty'

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