Resource
in package
Uses
RunTestsTrait
Description of Doorkeeper
Tags
Table of Contents
Constants
- DB_LOCK_TIMEOUT = 1000
- KULTURPOOL_OAIPMH_SET = 'https://vocabs.acdh.oeaw.ac.at/archeoaisets/kulturpool'
- LITERAL_TYPES = [\zozlak\RdfConstants::XSD_ANY_URI, \zozlak\RdfConstants::XSD_DATE, \zozlak\RdfConstants::XSD_DATE_TIME, \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, \zozlak\RdfConstants::XSD_BOOLEAN]
- NON_NEGATIVE_NUMBERS = [\zozlak\RdfConstants::XSD_NON_NEGATIVE_INTEGER, \zozlak\RdfConstants::XSD_UNSIGNED_LONG, \zozlak\RdfConstants::XSD_UNSIGNED_INT, \zozlak\RdfConstants::XSD_UNSIGNED_SHORT, \zozlak\RdfConstants::XSD_UNSIGNED_BYTE]
- OPENAIRE_OAIPMH_SET = 'https://vocabs.acdh.oeaw.ac.at/archeoaisets/openaire_data'
- PROP_TAG = 'https://vocabs.acdh.oeaw.ac.at/schema#hasTag'
- SAFE_TYPES = [\zozlak\RdfConstants::XSD_STRING, \zozlak\RdfConstants::RDF_LANG_STRING]
Properties
- $log : LoggerInterface|null
- $meta : DatasetNodeInterface
- $ontology : Ontology
- $pdo : PDO|null
- $schema : Schema
- $uriNorm : UriNormalizer
Methods
- __construct() : mixed
- check01TitleProp() : void
- Every resource must have a title property (cfg.schema.label).
- check02PropertyTypes() : void
- Checks property types (datatype/object).
- check03Cardinalities() : void
- Checks property cardinalities according to the ontology.
- check04IdCount() : void
- Every resource must have at least one repository ID and one non-repository ID.
- check05Language() : void
- check06UnknownProperties() : void
- If a property is in the ontology namespace it has to be part of the ontology.
- check07Biblatex() : void
- check08DateRanges() : void
- check09Kulturpool() : void
- onResEdit() : DatasetNodeInterface
- post01MaintainCmdiPid() : void
- CMDI records must have their very own PIDs but this requires special handling as in ARCHE CMDI is just a metadata serialization format and not a separate repository resource.
- post02MaintainPid() : void
- pre01MaintainDefaultValues() : void
- pre02MaintainEndDates() : void
- pre03MaintainOpenAire() : void
- pre04MaintainWkt() : void
- pre05MaintainAccessRights() : void
- Access rights should be maintained according to the `cfg.schema.accessRestriction` value:
- pre06MaintainPropertyRange() : void
- pre07NormalizeIds() : void
- runTests() : array<string|int, DoorkeeperException>|null
- castLiteral() : LiteralInterface
- inArcheCoreContext() : bool
- maintainPropertyRangeLiteral() : void
- maintainPropertyRangeVocabs() : void
- verifyPropertyRangeUri() : void
Constants
DB_LOCK_TIMEOUT
public
mixed
DB_LOCK_TIMEOUT
= 1000
KULTURPOOL_OAIPMH_SET
public
mixed
KULTURPOOL_OAIPMH_SET
= 'https://vocabs.acdh.oeaw.ac.at/archeoaisets/kulturpool'
LITERAL_TYPES
public
mixed
LITERAL_TYPES
= [\zozlak\RdfConstants::XSD_ANY_URI, \zozlak\RdfConstants::XSD_DATE, \zozlak\RdfConstants::XSD_DATE_TIME, \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, \zozlak\RdfConstants::XSD_BOOLEAN]
NON_NEGATIVE_NUMBERS
public
mixed
NON_NEGATIVE_NUMBERS
= [\zozlak\RdfConstants::XSD_NON_NEGATIVE_INTEGER, \zozlak\RdfConstants::XSD_UNSIGNED_LONG, \zozlak\RdfConstants::XSD_UNSIGNED_INT, \zozlak\RdfConstants::XSD_UNSIGNED_SHORT, \zozlak\RdfConstants::XSD_UNSIGNED_BYTE]
OPENAIRE_OAIPMH_SET
public
mixed
OPENAIRE_OAIPMH_SET
= 'https://vocabs.acdh.oeaw.ac.at/archeoaisets/openaire_data'
PROP_TAG
public
mixed
PROP_TAG
= 'https://vocabs.acdh.oeaw.ac.at/schema#hasTag'
SAFE_TYPES
public
mixed
SAFE_TYPES
= [\zozlak\RdfConstants::XSD_STRING, \zozlak\RdfConstants::RDF_LANG_STRING]
Properties
$log
private
LoggerInterface|null
$log
= null
$meta
private
DatasetNodeInterface
$meta
$ontology
private
Ontology
$ontology
$pdo
private
PDO|null
$pdo
= null
$schema
private
Schema
$schema
$uriNorm
private
UriNormalizer
$uriNorm
Methods
__construct()
public
__construct(DatasetNodeInterface $meta, Schema $schema, Ontology $ontology[, PDO|null $pdo = null ][, LoggerInterface|null $log = null ]) : mixed
Parameters
check01TitleProp()
Every resource must have a title property (cfg.schema.label).
public
check01TitleProp() : void
Tags
check02PropertyTypes()
Checks property types (datatype/object).
public
check02PropertyTypes() : void
As the property type doesn't depend on the class context, the check can and should be done for all metadata properties.
Tags
check03Cardinalities()
Checks property cardinalities according to the ontology.
public
check03Cardinalities() : void
Tags
check04IdCount()
Every resource must have at least one repository ID and one non-repository ID.
public
check04IdCount() : void
The non-repository ID is obligatory because repository IDs are sequential and don't have any meaning. Therefore it is very unlikely anyone knows them and uses them in the resources' metadata which causes a serious risk of mismatch on the next import.
Moreover resources representing ontology can have only one non-repository ID (so they must always have exactly two).
Tags
check05Language()
public
check05Language() : void
check06UnknownProperties()
If a property is in the ontology namespace it has to be part of the ontology.
public
check06UnknownProperties() : void
check07Biblatex()
public
check07Biblatex() : void
check08DateRanges()
public
check08DateRanges() : void
check09Kulturpool()
public
check09Kulturpool() : void
onResEdit()
public
static onResEdit(int $id, DatasetNodeInterface $meta, string|null $path) : DatasetNodeInterface
Parameters
- $id : int
- $meta : DatasetNodeInterface
- $path : string|null
Return values
DatasetNodeInterfacepost01MaintainCmdiPid()
CMDI records must have their very own PIDs but this requires special handling as in ARCHE CMDI is just a metadata serialization format and not a separate repository resource.
public
post01MaintainCmdiPid() : void
Because of that we need to store CMDI PIDs in a separate property and we want
it to be automatically filled in for resources in a given
(cfg.schema.doorkeeper.epicPid.clarinSetProperty
with value
cfg.doorkeeper.epicPid.clarinSet
) OAI-PMH set.
This method takes care of it.
Tags
post02MaintainPid()
public
post02MaintainPid() : void
pre01MaintainDefaultValues()
public
pre01MaintainDefaultValues() : void
pre02MaintainEndDates()
public
pre02MaintainEndDates() : void
pre03MaintainOpenAire()
public
pre03MaintainOpenAire() : void
pre04MaintainWkt()
public
pre04MaintainWkt() : void
pre05MaintainAccessRights()
Access rights should be maintained according to the `cfg.schema.accessRestriction` value:
public
pre05MaintainAccessRights() : void
- in all cases write access should be revoked from the public and academic
- when
public
read access to the public should be granted - when
academic
read access to thecfg.doorkeeper.roleAcademic
should be granted and public read access should be revoked - when
restricted
read rights should be revoked from public andcfg.doorkeeper.roleAcademic
and granted to users listed incfg.schema.accessRole
pre06MaintainPropertyRange()
public
pre06MaintainPropertyRange() : void
pre07NormalizeIds()
public
pre07NormalizeIds() : void
runTests()
public
runTests([string $attribute = CheckAttribute::class ][, int $filter = ReflectionMethod::IS_PUBLIC ][, bool $throwException = true ]) : array<string|int, DoorkeeperException>|null
Parameters
- $attribute : string = CheckAttribute::class
- $filter : int = ReflectionMethod::IS_PUBLIC
- $throwException : bool = true
-
if
true
, the method throws a DoorkeeperException on errors or null otherwise. Iffalse
, method returns a (possibly empty) array of DoorkeeperExceptions.
Return values
array<string|int, DoorkeeperException>|nullcastLiteral()
private
castLiteral(LiteralInterface $l, string $range) : LiteralInterface
Parameters
- $l : LiteralInterface
- $range : string
Return values
LiteralInterfaceinArcheCoreContext()
private
inArcheCoreContext() : bool
Return values
boolmaintainPropertyRangeLiteral()
private
maintainPropertyRangeLiteral(PropertyDesc $propDesc, NamedNodeInterface $prop) : void
Parameters
- $propDesc : PropertyDesc
- $prop : NamedNodeInterface
maintainPropertyRangeVocabs()
private
maintainPropertyRangeVocabs(PropertyDesc $propDesc, NamedNodeInterface $prop) : void
Parameters
- $propDesc : PropertyDesc
- $prop : NamedNodeInterface
verifyPropertyRangeUri()
private
verifyPropertyRangeUri(string $rangeUri, string $prop) : void
Parameters
- $rangeUri : string
- $prop : string