Wikibase
MediaWiki Wikibase extension
Wikibase\Repo\Rdf\PropertyStubRdfBuilder Class Reference
+ Inheritance diagram for Wikibase\Repo\Rdf\PropertyStubRdfBuilder:
+ Collaboration diagram for Wikibase\Repo\Rdf\PropertyStubRdfBuilder:

Public Member Functions

 __construct (TermLookup $termLookup, 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. More...
 

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

Private Attributes

const DATATYPE_PROPERTY = 'DatatypeProperty'
 
const NO_NORMALIZATION = null
 
 $termLookup
 
 $dataTypeLookup
 
 $termLanguages
 
 $vocabulary
 
 $writer
 
 $labelPredicates
 
 $dataTypes
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

Wikibase\Repo\Rdf\PropertyStubRdfBuilder::__construct ( TermLookup  $termLookup,
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.

◆ 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

◆ $labelPredicates

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

◆ $termLanguages

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

◆ $termLookup

Wikibase\Repo\Rdf\PropertyStubRdfBuilder::$termLookup
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: