wiki:CmdiMultipleRecords

In OAI-PMH it is possible to request multiple CMDI records, which then will be returned in one response. However, due to possible clashes of IDs, i.e., one record uses the same ID for a ResourceProxy as another record. Peter Fankhauser (IDS) pointed out that xs:key and/or xs:unique could provide a solution.

Indeed adding these to comp2schema.xsl can solve the problem to a large extend:

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:dcr="http://www.isocat.org/ns/dcr" xmlns:cmd="http://www.clarin.eu/cmd/" targetNamespace="http://www.clarin.eu/cmd/" elementFormDefault="qualified">            
...
    <xs:element name="CMD">
...                
        <!-- Resource key and reference constraints -->
                
        <xs:key name="ResourceProxy">
            <xs:selector
                xpath="cmd:Resources/cmd:ResourceProxyList/cmd:ResourceProxy"/>
            <xs:field xpath="@id"/>
        </xs:key>
                
        <xs:keyref name="ResourceRef"
            refer="cmd:ResourceProxy">
            <xs:selector xpath=".//*"/>
            <xs:field xpath="@ref"/>
        </xs:keyref>
                
    </xs:element>
</xs:schema>

The problem in CMDI 1.1 is that @ref is defined to be an IDREFS, i.e., a @ref can refer to multiple resource proxies. Unfortunately there is no xs:keyrefs. So to implement this would mean a backwards incompatible change of making @ref an IDREF (again).

To see the impact of this the CMDI records harvested end of August 2013 were loaded into BaseX and queried for @ref referring to multiple resource proxies:

declare namespace cmdi = "http://www.clarin.eu/cmd/";

count(//cmdi:Components[exists(//*[count(tokenize(@ref,'\s+')) > 1])])

Which, using a harvest dump of 20130927, results in And this returns 215 cmdi:Components nodes.

declare default element namespace "http://www.clarin.eu/cmd/";

distinct-values(/CMD/Header/MdProfile[exists(/CMD/Components/*[count(tokenize(@ref,'\s'))>1])])

Shows they all come from the collection profile.

Update 20131001: check this fix also in a OAI-PMH setup

Last modified 10 years ago Last modified on 12/04/13 13:49:00