Documentation

MetaLookupFile
in package
implements MetaLookupInterface

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

Tags
author

zozlak

Table of Contents

Interfaces

MetaLookupInterface
It is a common problem to couple binary data with their metadata.

Properties

$debug  : bool
Debug flag - setting it to true causes loggin messages to be displayed.
$extension  : string
Suffix added to a file name to form a metadata file name.
$format  : string|null
Metadata file format
$locations  : array<string|int, string>
Array of possible metadata locations (relative and/or absolute)

Methods

__construct()  : mixed
Creates a new MetaLookupFile instance.
getMetadata()  : DatasetNodeInterface
Searches for metadata of a given file.

Properties

$debug

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

public static bool $debug = false

$extension

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

private string $extension

$locations

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

private array<string|int, string> $locations

Methods

__construct()

Creates a new MetaLookupFile instance.

public __construct([array<string|int, string> $locations = [] ][, string $extension = '.ttl' ][, string $format = null ]) : mixed
Parameters
$locations : array<string|int, string> = []

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

$extension : string = '.ttl'

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

$format : string = null

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

getMetadata()

Searches for metadata of a given file.

public getMetadata(string $path, array<string|int, string|NamedNodeInterface$identifiers[, bool $require = false ]) : DatasetNodeInterface
Parameters
$path : string

path to the file

$identifiers : array<string|int, string|NamedNodeInterface>

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

$require : bool = false

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

Tags
throws
InvalidArgumentException
throws
MetaLookupException
Return values
DatasetNodeInterface

fetched metadata


        
On this page

Search results