SKIP
SKIP
Class for importing whole metadata graph into the repository.
$fedora : \acdhOeaw\fedora\Fedora
Fedora connection object
$resource : \acdhOeaw\fedora\FedoraResource
Parent resource for all imported graph nodes
__construct(\acdhOeaw\fedora\Fedora $fedora, string $file, string $format = null)
Creates a new metadata parser.
\acdhOeaw\fedora\Fedora | $fedora | |
string | $file | |
string | $format |
setResource(\acdhOeaw\fedora\FedoraResource $res) : \acdhOeaw\util\MetadataCollection
Sets the repository resource being parent of all resources in the graph imported by the import() method.
\acdhOeaw\fedora\FedoraResource | $res |
setFedoraLocation(string $fedoraLoc) : \acdhOeaw\util\MetadataCollection
Sets a location where the resource will be placed.
Can be absolute (but will be sanitized anyway) or relative to the repository root.
Given location must already exist.
Note that this parameter is used ONLY if the resource DOES NOT EXISTS. If it exists already, its location is not changed.
string | $fedoraLoc | fedora location |
setAutoCommit(integer $count) : \acdhOeaw\util\MetadataCollection
Controls the automatic commit behaviour.
Even when you use autocommit, you should commit your transaction after
Indexer::index()
(the only exception is when you set auto commit to 1
forcing commiting each and every resource separately but you probably
don't want to do that for performance reasons).
integer | $count | number of resource automatically triggering a commit (0 - no auto commit) |
import(string $namespace, integer $singleOutNmsp) : array
Imports the whole graph by looping over all resources.
A repository resource is created for every node containing at least one cfg:fedoraIdProp property and:
Resources without cfg:fedoraIdProp property are skipped as we are unable to identify them on the next import (which would lead to duplication).
Resource with a fully qualified URI is considered as having cfg:fedoraIdProp (its URI is taken as cfg:fedoraIdProp property value).
Resources in the graph can denote relationships in any way but all object URIs already existing in the repository and all object URIs in the $namespace will be turned into ACDH ids.
string | $namespace | repository resources will be created for all resources in this namespace |
integer | $singleOutNmsp | should repository resources be created representing URIs outside $namespace (MetadataCollection::SKIP or MetadataCollection::CREATE) |
filterResources(string $namespace, integer $singleOutNmsp) : array
Returns set of resources to be imported skipping all other.
string | $namespace | repository resources will be created for all resources in this namespace |
integer | $singleOutNmsp | should repository resources be created representing URIs outside $namespace (MetadataCollection::SKIP or MetadataCollection::CREATE) |