PropertyMappings
in package
Description of PropertyMappings
Tags
Table of Contents
Constants
- WIKIDATA_INSTANCE_OF = 'http://www.wikidata.org/prop/direct/P31'
Properties
- $dbNames : array<string|int, string>
- $idProp : NamedNodeInterface
- $mappings : array<string, array<string|int, PropertyMapping>>
- $normalizer : UriNormalizer
- $rules : array<string, UriNormalizerRule>
Methods
- __construct() : mixed
- addExternalDatabase() : void
- Adds URI normalization rule for a given external database.
- addExternalDatabaseClass() : void
- Adds property mappings for a given class of a given external database.
- getDbNames() : array<string|int, string>
- getRule() : UriNormalizerRule
- mapIdentifiers() : array<string|int, string>
- matchExternalDatabase() : string
- parseConfig() : void
- resolveAndMerge() : void
- getClasses() : array<string|int, string>
- getId() : string
Constants
WIKIDATA_INSTANCE_OF
public
mixed
WIKIDATA_INSTANCE_OF
= 'http://www.wikidata.org/prop/direct/P31'
Properties
$dbNames
private
array<string|int, string>
$dbNames
= []
$idProp
private
NamedNodeInterface
$idProp
$mappings
private
array<string, array<string|int, PropertyMapping>>
$mappings
= []
$normalizer
private
UriNormalizer
$normalizer
$rules
private
array<string, UriNormalizerRule>
$rules
= []
Methods
__construct()
public
__construct(UriNormalizer $normalizer, NamedNodeInterface $idProp) : mixed
Parameters
- $normalizer : UriNormalizer
- $idProp : NamedNodeInterface
addExternalDatabase()
Adds URI normalization rule for a given external database.
public
addExternalDatabase(string $dbName, UriNormalizerRule $rule) : void
Parameters
- $dbName : string
- $rule : UriNormalizerRule
addExternalDatabaseClass()
Adds property mappings for a given class of a given external database.
public
addExternalDatabaseClass(string $dbName, string $class, array<string|int, mixed> $mappings) : void
Parameters
- $dbName : string
- $class : string
- $mappings : array<string|int, mixed>
getDbNames()
public
getDbNames() : array<string|int, string>
Return values
array<string|int, string>getRule()
public
getRule(string $dbName) : UriNormalizerRule
Parameters
- $dbName : string
Return values
UriNormalizerRulemapIdentifiers()
public
mapIdentifiers(DatasetNodeInterface $meta[, string|null $dbName = null ]) : array<string|int, string>
Parameters
- $meta : DatasetNodeInterface
- $dbName : string|null = null
Return values
array<string|int, string>matchExternalDatabase()
public
matchExternalDatabase(string $uri) : string
Parameters
- $uri : string
Return values
stringparseConfig()
public
parseConfig(object $cfg) : void
Parameters
- $cfg : object
resolveAndMerge()
public
resolveAndMerge(string $dbName, DatasetNodeInterface $meta, DatasetNodeInterface $extDbMeta) : void
Parameters
- $dbName : string
- $meta : DatasetNodeInterface
- $extDbMeta : DatasetNodeInterface
getClasses()
private
getClasses(DatasetNodeInterface $meta, string|null $dbName) : array<string|int, string>
Parameters
- $meta : DatasetNodeInterface
- $dbName : string|null
Return values
array<string|int, string>getId()
private
getId(string $dbName, string $class) : string
Parameters
- $dbName : string
- $class : string