\acdhOeaw\util\metaLookupMetaLookupFile

Implements metadata lookup by searching in a given metadata locations for a file with an original file name with a given extension appended.

Summary

Methods
Properties
Constants
__construct()
getMetadata()
$debug
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
$locations
$extension
$format
N/A

Properties

$debug

$debug : boolean

Debug flag - setting it to true causes loggin messages to be displayed.

Type

boolean

$locations

$locations : array

Array of possible metadata locations (relative and/or absolute)

Type

array

$extension

$extension : string

Suffix added to a file name to form a metadata file name.

Type

string

$format

$format : string

Metadata file format

Type

string

Methods

__construct()

__construct(array  $locations = array(), string  $extension = '.ttl', string  $format = null) 

Creates a new MetaLookupFile instance.

Parameters

array $locations

location to search for metadata files in (both absolute and relative paths allowed)

string $extension

suffix added to the original filename to form a metadata file name

string $format

metadata format understandable for \EasyRdf\Graph::parseFile() (if null format will be autodetected)

getMetadata()

getMetadata(string  $path, \EasyRdf\Resource  $meta, boolean  $require = false) : \EasyRdf\Resource

Searches for metadata of a given file.

Parameters

string $path

path to the file

\EasyRdf\Resource $meta

file's metadata (just for conformance with the interface, they are not used)

boolean $require

should error be thrown when no metadata was found (when false a resource with no triples is returned)

Throws

\InvalidArgumentException
\acdhOeaw\util\metaLookup\MetaLookupException

Returns

\EasyRdf\Resource —

fetched metadata