ValueMapper
in package
Provides vocabulary mappings. Assumes a value is an URL which can be resolved to the RDF . Then extracts given property values from the RDF.
Implements caching.
Tags
Table of Contents
Properties
Methods
- __construct() : mixed
- getMapping() : array<string|int, resource>
- Returns mapped values.
- fetch() : void
- Fetches mappings from the value URL into the cache.
Properties
$cache
private
array<string, resource>
$cache
= []
$client
private
Client
$client
$failed
private
array<string, bool>
$failed
= []
Methods
__construct()
public
__construct([array<string, mixed> $guzzleOptions = [] ]) : mixed
Parameters
- $guzzleOptions : array<string, mixed> = []
-
connection options to be used while fetching the data - see http://docs.guzzlephp.org/en/stable/request-options.html
getMapping()
Returns mapped values.
public
getMapping(string $value, string $property) : array<string|int, resource>
Parameters
- $value : string
-
value to be mapped
- $property : string
-
RDF property which value should be returned
Return values
array<string|int, resource> —mapped values
fetch()
Fetches mappings from the value URL into the cache.
private
fetch(string $value) : void
Parameters
- $value : string
-
value URL to be resolved