$res
$res : \acdhOeaw\fedora\FedoraResource
Repository resource object
Creates <metadata> element by filling in an XML template with values read from the repository resource's metadata.
Required metadata format definitition properties:
uriProp
- metadata property storing resource's OAI-PMH ididProp
- metadata property identifying a repository resourcelabelProp
- metadata property storing repository resource labelschemaProp
- metadata property storing resource's CMDI profile URItemplateDir
- path to a directory storing XML templates;
each template should have exactly same name as the CMDI profile id, e.g. clarin.eu:cr1:p_1290431694580.xml
defaultLang
- default language to be used when the template doesn't explicitly specify oneOptional metadata format definition properties:
propNmsp[prefix]
- an array of property URIs namespaces used in the templateschemaDefault
provides a default CMDI profile (e.g. clarin.eu:cr1:p_1290431694580.xml
)
to be used when a resource's metadata don't contain the schemaProp
or none of its values
correspond to an existing CMDI template.
If schemaDefault
isn't provided, resources which don't contain the schemaProp
in their metadata are automatically excluded from the OAI-PMH search.schemaEnforce
if provided, only resources with a given value of the schemaProp
are processed.XML tags in the template can be annotated with following attributes:
val="valuePath"
specifies how to get the value. Possible valuePath
variants are:
/propUri
- get a value from a given metadata property value/propUri[key]
- parse given metadata property value as YAML and take the value
at the key key
@propUri1/propUri2
- get another resource URI from the propUri1
metadata
property value, then use the propUri2
metadata property value of this resourceNOW
- get the current timeURI
- get the resource's repository URIOAIURI
- get the resource's OAI-PMH IDcount="N"
(default 1
)
val
attribute
the tag is removed from the template;val
attribute
the tag is repeated for each metadata property valueval
attribute
the tag is left empty in the template;val
attribute
first metadata property value is usedlang="true"
if present and a metadata property value contains information about
the language, the xml:lang
attribute is added to the template tagasXML="true"
if present, value specified with the val
attribute is parsed and added
as XML$format : \acdhOeaw\oai\data\MetadataFormat
Metadata format descriptor
__construct(\acdhOeaw\fedora\FedoraResource $resource, \stdClass $sparqlResultRow, \acdhOeaw\oai\data\MetadataFormat $format)
Creates a metadata object for a given repository resource.
\acdhOeaw\fedora\FedoraResource | $resource | repository resource object |
\stdClass | $sparqlResultRow | SPARQL search query result row |
\acdhOeaw\oai\data\MetadataFormat | $format | metadata format descriptor describing this resource |
extendSearchQuery(\acdhOeaw\oai\data\MetadataFormat $format, string $resVar) : string
Applies metadata format restrictions.
Returned string must be a valid SPARQL query part one can insert as ...
in a query like SELECT * WHERE { ... LIMIT (someRule)}
. It means if
you need your own LIMIT clause or other advanced constructs, you must
return a subquery.
Remark! PHP doesn't consider static methods as an interface part therefore existance of this method in classes implementing this interface is not enforced.
\acdhOeaw\oai\data\MetadataFormat | $format | metadata format descriptor |
string | $resVar | variable used in the search query to denote the repository resource |