Documentation

RepoInterface

Tags
author

zozlak

Table of Contents

Methods

getBaseUrl()  : string
Returns the repository REST API base URL.
getGraphBySearchTerms()  : DatasetInterface
Returns RDF metadata graph of the search results.
getGraphBySqlQuery()  : DatasetInterface
Returns RDF metadata graph of the search results.
getResourceById()  : RepoResourceInterface
Tries to find a repository resource with a given id.
getResourceByIds()  : RepoResourceInterface
Tries to find a single repository resource matching provided identifiers.
getResourcesBySearchTerms()  : Generator<string|int, RepoResourceInterface>
Returns repository resources matching all provided search terms.
getResourcesBySqlQuery()  : Generator<string|int, RepoResourceInterface>
Returns repository resources matching a given SQL search query.
getSchema()  : Schema
Returns the `Schema` object defining repository entities to RDF property mappings.

Methods

getBaseUrl()

Returns the repository REST API base URL.

public getBaseUrl() : string
Return values
string

getGraphBySearchTerms()

Returns RDF metadata graph of the search results.

public getGraphBySearchTerms(array<string|int, SearchTerm$searchTerms, SearchConfig $config) : DatasetInterface
Parameters
$searchTerms : array<string|int, SearchTerm>
$config : SearchConfig
Return values
DatasetInterface

getGraphBySqlQuery()

Returns RDF metadata graph of the search results.

public getGraphBySqlQuery(string $query, array<string|int, mixed> $parameters, SearchConfig $config) : DatasetInterface
Parameters
$query : string
$parameters : array<string|int, mixed>
$config : SearchConfig
Return values
DatasetInterface

getResourceById()

Tries to find a repository resource with a given id.

public getResourceById(string $id[, string $class = null ]) : RepoResourceInterface

Throws an error on failure.

Parameters
$id : string
$class : string = null

an optional class of the resulting object representing the resource (to be used by extension libraries)

Return values
RepoResourceInterface

getResourceByIds()

Tries to find a single repository resource matching provided identifiers.

public getResourceByIds(array<string|int, string> $ids[, string $class = null ]) : RepoResourceInterface

A resource matches the search if at lest one id matches the provided list. Resource is not required to have all provided ids.

If more then one resources matches the search or there is no resource matching the search, an error is thrown.

Parameters
$ids : array<string|int, string>

an array of identifiers (being strings)

$class : string = null

an optional class of the resulting object representing the resource (to be used by extension libraries)

Return values
RepoResourceInterface

getResourcesBySqlQuery()

Returns repository resources matching a given SQL search query.

public getResourcesBySqlQuery(string $query, array<string|int, mixed> $parameters, SearchConfig $config) : Generator<string|int, RepoResourceInterface>

The query should return the resources.id database column value of all resources matching the search. The column name "id" has to be used.

Parameters
$query : string
$parameters : array<string|int, mixed>
$config : SearchConfig
Return values
Generator<string|int, RepoResourceInterface>

getSchema()

Returns the `Schema` object defining repository entities to RDF property mappings.

public getSchema() : Schema
Return values
Schema

        
On this page

Search results