Documentation

Doorkeeper
in package

Description of Doorkeeper

Tags
author

zozlak

Table of Contents

Constants

DB_LOCK_TIMEOUT  = 1000
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]

Properties

$ontology  : Ontology
$schema  : Schema
$uriNorm  : UriNormalizer

Methods

checkIsNewVersionOf()  : void
isNewVersionOf can't create cycles so creation of the 2nd (and higher order) isNewVersionOf links to a resource is forbidden.
maintainAccessRights()  : void
Access rights should be maintained according to the `cfg.schema.accessRestriction` value:
onResEdit()  : DatasetNodeInterface
onTxCommit()  : void
castLiteral()  : LiteralInterface
checkAutoCreatedResources()  : void
checkBiblatex()  : void
checkCardinalities()  : void
Checks property cardinalities according to the ontology.
checkIdCount()  : void
Every resource must have at least one repository ID and one non-repository ID.
checkLanguage()  : void
checkPropertyRangeUri()  : void
checkPropertyTypes()  : void
Checks property types (datatype/object).
checkTitleProp()  : void
Every resource must have a title property (cfg.schema.label).
checkUnknownProperties()  : void
If a property is in the ontology namespace it has to be part of the ontology.
loadOntology()  : void
maintainCmdiPid()  : 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.
maintainDefaultValues()  : void
maintainPid()  : void
maintainPropertyRange()  : void
maintainPropertyRangeLiteral()  : void
maintainPropertyRangeVocabs()  : void
maintainWkt()  : void
normalizeIds()  : void
updateCollectionAggregates()  : void
updateCollections()  : void
updateCollectionSize()  : void

Constants

DB_LOCK_TIMEOUT

public mixed DB_LOCK_TIMEOUT = 1000

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]

Properties

Methods

checkIsNewVersionOf()

isNewVersionOf can't create cycles so creation of the 2nd (and higher order) isNewVersionOf links to a resource is forbidden.

public static checkIsNewVersionOf(PDO $pdo, int $txId, array<string|int, int> $resourceIds) : void

As the doorkeeper can't lock resources in an effective way checking it is possible only at the transaction commit.

Parameters
$pdo : PDO
$txId : int
$resourceIds : array<string|int, int>
Tags
throws
DoorkeeperException

maintainAccessRights()

Access rights should be maintained according to the `cfg.schema.accessRestriction` value:

public static maintainAccessRights(DatasetNodeInterface $meta, PDO $pdo) : 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 the cfg.doorkeeper.roleAcademic should be granted and public read access should be revoked
  • when restricted read rights should be revoked from public and cfg.doorkeeper.roleAcademic and granted to users listed in cfg.schema.accessRole
Parameters
$meta : DatasetNodeInterface

repository resource's metadata

$pdo : PDO

onResEdit()

public static onResEdit(int $id, DatasetNodeInterface $meta, string|null $path) : DatasetNodeInterface
Parameters
$id : int
$meta : DatasetNodeInterface
$path : string|null
Return values
DatasetNodeInterface

onTxCommit()

public static onTxCommit(string $method, int $txId, array<string|int, int> $resourceIds) : void
Parameters
$method : string
$txId : int
$resourceIds : array<string|int, int>
Tags
throws
DoorkeeperException

castLiteral()

private static castLiteral(LiteralInterface $l, string $range) : LiteralInterface
Parameters
$l : LiteralInterface
$range : string
Return values
LiteralInterface

checkAutoCreatedResources()

private static checkAutoCreatedResources(PDO $pdo, int $txId, array<string|int, int> $resourceIds) : void
Parameters
$pdo : PDO
$txId : int
$resourceIds : array<string|int, int>
Tags
throws
DoorkeeperException

checkBiblatex()

private static checkBiblatex(DatasetNodeInterface $meta) : void
Parameters
$meta : DatasetNodeInterface

checkCardinalities()

Checks property cardinalities according to the ontology.

private static checkCardinalities(DatasetNodeInterface $meta) : void
Parameters
$meta : DatasetNodeInterface
Tags
throws
DoorkeeperException

checkIdCount()

Every resource must have at least one repository ID and one non-repository ID.

private static checkIdCount(DatasetNodeInterface $meta) : 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).

Parameters
$meta : DatasetNodeInterface
Tags
throws
DoorkeeperException

checkLanguage()

private static checkLanguage(DatasetNodeInterface $meta) : void
Parameters
$meta : DatasetNodeInterface

checkPropertyRangeUri()

private static checkPropertyRangeUri(DatasetNodeInterface $meta, string $rangeUri, string $prop) : void
Parameters
$meta : DatasetNodeInterface
$rangeUri : string
$prop : string

checkPropertyTypes()

Checks property types (datatype/object).

private static checkPropertyTypes(DatasetNodeInterface $meta) : void

As the property type doesn't depend on the class context, the check can and should be done for all metadata properties.

Parameters
$meta : DatasetNodeInterface
Tags
throws
DoorkeeperException

checkTitleProp()

Every resource must have a title property (cfg.schema.label).

private static checkTitleProp(DatasetNodeInterface $meta) : void
Parameters
$meta : DatasetNodeInterface
Tags
throws
DoorkeeperException

checkUnknownProperties()

If a property is in the ontology namespace it has to be part of the ontology.

private static checkUnknownProperties(DatasetNodeInterface $meta) : void
Parameters
$meta : DatasetNodeInterface

loadOntology()

private static loadOntology() : void

maintainCmdiPid()

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.

private static maintainCmdiPid(DatasetNodeInterface $meta, PDO $pdo) : 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.

Parameters
$meta : DatasetNodeInterface
$pdo : PDO
Tags
throws
DoorkeeperException

maintainDefaultValues()

private static maintainDefaultValues(DatasetNodeInterface $meta) : void
Parameters
$meta : DatasetNodeInterface

maintainPid()

private static maintainPid(DatasetNodeInterface $meta) : void
Parameters
$meta : DatasetNodeInterface

maintainPropertyRange()

private static maintainPropertyRange(DatasetNodeInterface $meta) : void
Parameters
$meta : DatasetNodeInterface

maintainPropertyRangeLiteral()

private static maintainPropertyRangeLiteral(DatasetNodeInterface $meta, PropertyDesc $propDesc, NamedNodeInterface $prop) : void
Parameters
$meta : DatasetNodeInterface
$propDesc : PropertyDesc
$prop : NamedNodeInterface

maintainPropertyRangeVocabs()

private static maintainPropertyRangeVocabs(DatasetNodeInterface $meta, PropertyDesc $propDesc, NamedNodeInterface $prop) : void
Parameters
$meta : DatasetNodeInterface
$propDesc : PropertyDesc
$prop : NamedNodeInterface

maintainWkt()

private static maintainWkt(DatasetNodeInterface $meta) : void
Parameters
$meta : DatasetNodeInterface

normalizeIds()

private static normalizeIds(DatasetNodeInterface $meta) : void
Parameters
$meta : DatasetNodeInterface

updateCollectionAggregates()

private static updateCollectionAggregates(PDO $pdo) : void
Parameters
$pdo : PDO

updateCollections()

private static updateCollections(PDO $pdo, int $txId, array<string|int, int> $resourceIds) : void
Parameters
$pdo : PDO
$txId : int
$resourceIds : array<string|int, int>
Tags
throws
DoorkeeperException

updateCollectionSize()

private static updateCollectionSize(PDO $pdo) : void
Parameters
$pdo : PDO

        
On this page

Search results