Metadata
in package
Manages resources's metadata (loads from database or HTTP request, writes into the database, serializes to RDF, etc.).
Tags
Table of Contents
Constants
- DATE_TYPES = [\zozlak\RdfConstants::XSD_DATE, \zozlak\RdfConstants::XSD_DATE_TIME]
- FILTER_INCLUDE = 'include'
- FILTER_SKIP = 'skip'
- NUMERIC_TYPES = [\zozlak\RdfConstants::XSD_DECIMAL, \zozlak\RdfConstants::XSD_FLOAT, \zozlak\RdfConstants::XSD_DOUBLE, \zozlak\RdfConstants::XSD_INTEGER, \zozlak\RdfConstants::XSD_NEGATIVE_INTEGER, \zozlak\RdfConstants::XSD_NON_NEGATIVE_INTEGER, \zozlak\RdfConstants::XSD_NON_POSITIVE_INTEGER, \zozlak\RdfConstants::XSD_POSITIVE_INTEGER, \zozlak\RdfConstants::XSD_LONG, \zozlak\RdfConstants::XSD_INT, \zozlak\RdfConstants::XSD_SHORT, \zozlak\RdfConstants::XSD_BYTE, \zozlak\RdfConstants::XSD_UNSIGNED_LONG, \zozlak\RdfConstants::XSD_UNSIGNED_INT, \zozlak\RdfConstants::XSD_UNSIGNED_SHORT, \zozlak\RdfConstants::XSD_UNSIGNED_BYTE]
- SAVE_ADD = 'add'
- SAVE_MERGE = 'merge'
- SAVE_OVERWRITE = 'overwrite'
- TYPE_GEOM = 'GEOM'
- TYPE_URI = 'URI'
Properties
Methods
- __construct() : mixed
- getAcceptedFormats() : string
- getDatasetNode() : DatasetNodeInterface
- getUri() : string
- idAsUri() : string
- loadFromDb() : void
- loadFromRequest() : int
- loadFromResource() : void
- merge() : DatasetNodeInterface
- negotiateFormat() : string
- save() : void
- setId() : void
- setResponseBody() : void
- update() : void
- autoAddId() : bool
- manageSystemMetadata() : void
- Updates system-managed metadata, e.g. who and when lastly modified a resource
Constants
DATE_TYPES
public
mixed
DATE_TYPES
= [\zozlak\RdfConstants::XSD_DATE, \zozlak\RdfConstants::XSD_DATE_TIME]
FILTER_INCLUDE
public
mixed
FILTER_INCLUDE
= 'include'
FILTER_SKIP
public
mixed
FILTER_SKIP
= 'skip'
NUMERIC_TYPES
public
mixed
NUMERIC_TYPES
= [\zozlak\RdfConstants::XSD_DECIMAL, \zozlak\RdfConstants::XSD_FLOAT, \zozlak\RdfConstants::XSD_DOUBLE, \zozlak\RdfConstants::XSD_INTEGER, \zozlak\RdfConstants::XSD_NEGATIVE_INTEGER, \zozlak\RdfConstants::XSD_NON_NEGATIVE_INTEGER, \zozlak\RdfConstants::XSD_NON_POSITIVE_INTEGER, \zozlak\RdfConstants::XSD_POSITIVE_INTEGER, \zozlak\RdfConstants::XSD_LONG, \zozlak\RdfConstants::XSD_INT, \zozlak\RdfConstants::XSD_SHORT, \zozlak\RdfConstants::XSD_BYTE, \zozlak\RdfConstants::XSD_UNSIGNED_LONG, \zozlak\RdfConstants::XSD_UNSIGNED_INT, \zozlak\RdfConstants::XSD_UNSIGNED_SHORT, \zozlak\RdfConstants::XSD_UNSIGNED_BYTE]
SAVE_ADD
public
mixed
SAVE_ADD
= 'add'
SAVE_MERGE
public
mixed
SAVE_MERGE
= 'merge'
SAVE_OVERWRITE
public
mixed
SAVE_OVERWRITE
= 'overwrite'
TYPE_GEOM
public
mixed
TYPE_GEOM
= 'GEOM'
TYPE_URI
public
mixed
TYPE_URI
= 'URI'
Properties
$graph
private
DatasetNodeInterface
$graph
$id
private
int
$id
Methods
__construct()
public
__construct([int|null $id = null ]) : mixed
Parameters
- $id : int|null = null
getAcceptedFormats()
public
static getAcceptedFormats() : string
Return values
stringgetDatasetNode()
public
getDatasetNode() : DatasetNodeInterface
Return values
DatasetNodeInterfacegetUri()
public
getUri() : string
Return values
stringidAsUri()
public
static idAsUri(int $id) : string
Parameters
- $id : int
Return values
stringloadFromDb()
public
loadFromDb(string $mode[, string|null $property = null ]) : void
Parameters
- $mode : string
- $property : string|null = null
loadFromRequest()
public
loadFromRequest([string|null $resUri = null ]) : int
Parameters
- $resUri : string|null = null
Return values
intloadFromResource()
public
loadFromResource(DatasetNodeInterface $res) : void
Parameters
- $res : DatasetNodeInterface
merge()
public
merge(string $mode) : DatasetNodeInterface
Parameters
- $mode : string
Return values
DatasetNodeInterfacenegotiateFormat()
public
static negotiateFormat() : string
Return values
stringsave()
public
save() : void
setId()
public
setId(int $id) : void
Parameters
- $id : int
setResponseBody()
public
setResponseBody(string $format) : void
Parameters
- $format : string
update()
public
update(DatasetNode $newMeta[, array<string|int, string> $preserve = [] ]) : void
Parameters
- $newMeta : DatasetNode
- $preserve : array<string|int, string> = []
autoAddId()
private
autoAddId(string $ids) : bool
Parameters
- $ids : string
Return values
boolmanageSystemMetadata()
Updates system-managed metadata, e.g. who and when lastly modified a resource
private
manageSystemMetadata(DatasetNodeInterface $meta) : void
Parameters
- $meta : DatasetNodeInterface