[Dev] add CMDI schema to DSPACE
Jozef Misutka
misutka at ufal.mff.cuni.cz
Fri Nov 13 11:36:54 CET 2015
Dear Riccardo,
please find my comments below.
On 11/12/2015 5:45 PM, riccardo del gratta wrote:
> Hi devs,
> I'm Riccardo from ILC in Pisa. I just installed a Dspace5 out-of-the-box
You mean "raw" DSpace 5 (https://github.com/DSpace/DSpace) or LINDAT
DSpace (https://github.com/ufal/lindat-dspace) based on DSpace 5?
> and I'm wondering how to define a new metadata schema in the
> repository. I mean I just created one from the user interface pointing
> to the
> schema-http://catalog.clarin.eu/ds/ComponentRegistry/rest/registry/profiles/clarin.eu:cr1:p_1349361150622/xsd
I will explain how it works now in DSpace in general.
# Metadata schemas (in DSpace)
First of all, DSpace uses relational database to store metadata in a key
- value pair idiom.
You define metadata schemas in order for DSpace to know which keys are
"known" and can be used. If I understood you correctly, you tried to use
the profile xsd url in "Namespace" of Metadata Registry in DSpace. But
that does nothing (only saves the information for later, see crosswalks
below). You must Add the schema and the *fields* which can be used as
the keys. If you try to use a key not defined you get an error.
# Inserting records (metadata)
Inserting submissions to DSpace can be done in many ways but we will
focus on the the "manual way". This means filling out metadata during
submission workflow [1].
Most of the steps in the submission workflow are configured in
input-forms.xml [2] e.g.,
...
<page number="1">
...
<field>
<dc-schema>dc</dc-schema>
<dc-element>title</dc-element>
<dc-qualifier></dc-qualifier>
<repeatable>false</repeatable>
<label>Title</label>
<input-type>onebox</input-type>
<hint>Enter the main title of the item in
English.</hint>
<required>You must enter a main title for this
item.</required>
</field>
In other words, the input value is mapped to a metadata schema element.
LINDAT DSpace supports also simple components without recursion though.
Note: If you are a librarian then the metadata schema in DSpace in the
context above might be ambiguous. Simply, think about it as a list of
key-value pairs that can be used.
# Using metadata
Now you know how the metadata are stored and from where. The question
now is how to use or "show" them.
Firstly, in the lindat dspace user interface, you do it mostly from
inside xsl like this
<xsl:value-of
select="dim:field[@mdschema='dc' and
@element='title'][not(@qualifier)][1]/node()"/>
The interesting part is how to export it to different metadata formats
like a CMDI profile. That is done dynamically using crosswalks [3] e.g.,
lindat_cmdi.xsl [4]
...
<xsl:template match="/">
<xsl:variable name="uploaded_md"
select="itemUtil:getUploadedMetadata($handle)"/>
<xsl:choose>
<xsl:when test="$uploaded_md != ''">
<xsl:copy-of select="$uploaded_md"/>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="ConstructCMDI"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
...
<xsl:template name="ConstructCMDI">
<xsl:variable name="contact"
select="/doc:metadata/doc:element[@name='local']/doc:element[@name='contact']/doc:element[@name='person']/doc:element/doc:field[@name='value']"/>
<xsl:variable name="profile">
...
Note: This snippet also shows a ""hidden"" feature - you can upload a
specific file during submission workflow which is then used instead of
the generated one. However, this was meant for very specific needs
(integration to Weblicht).
# CMDI profile
Let's assume you are using lindat dspace. This leaves us with a (very
good) question whether to reuse our CMDI profile or not. The complete
answer is here [5]. If you tend to store the same metadata as we do then
reuse it. Otherwise you have to do the following
1. create new metadata schema
2. add missing fields you plan to use in your profile
3. update input forms to use the fields from 2.
4. create the profile in CMDI
5. update the crosswalk
# Last notes
If you tend to use specific fields for very important information that
you want to be used when searching or when displaying filters (facets)
you have to configure it.
Do not hesitate to join us at our weekly technical meetings -
https://lindat.mff.cuni.cz/en/events.
Best,
Jozef Misutka
[1] https://lindat.mff.cuni.cz/repository/xmlui/page/deposit
[2]
https://github.com/ufal/lindat-dspace/blob/lindat/dspace/config/input-forms.xml
[3] https://wiki.duraspace.org/display/DSPACE/CrosswalkPlugins
[4]
https://github.com/ufal/lindat-dspace/blob/lindat/dspace/config/crosswalks/oai/metadataFormats/lindat_cmdi.xsl
[5] https://lindat.mff.cuni.cz/repository/xmlui/page/metadata
> Is it enough? Because according to LINDAT this seams not enough..
>
> Is there a documentation clearer than dspace's native hot to create
> new schema and ingest items according to that?
>
> Thanks Riccardo
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.clarin.eu/pipermail/dev/attachments/20151113/1cf5d30e/attachment.html>
More information about the Dev
mailing list