[OAI-implementers] I have problems with OAI

Heinrich Stamerjohanns stamer at physnet.physik.uni-oldenburg.de
Fri Feb 25 06:02:19 EST 2005


On Wed, 23 Feb 2005, Daniel Manchego wrote:

Dear Daniel, 

the problem is that the Protocol suggests to return the identifier in this 
error case. However the invalid identifier does not match 
the type oai:identifierType, so the generated XML is invalid.
 
So in fact it is a problem in either the specification or the XML Schema.

Two solutions are possible:

The XML Schema for Validating Responses to OAI-PMH Requests can be fixed
by just requiring any string and not an oai:identifierType.

OR

fix the file oaidp-util.php with this patch:

oai2-1.5/oai2/oaidp-util.php
--- phpoai2-1.6/oai2/oaidp-util.php     2005-02-25 11:43:47.155125000 
+0100
+++ phpoai2-1.5/oai2/oaidp-util.php     2004-07-02 17:14:44.000000000 
+0200
@@ -113,7 +113,7 @@
                        $code = 'badArgument';
        }

-       if ($code == 'badVerb' || $code == 'badArgument' || $code == 
'idDoesNotExist') {
+       if ($code == 'badVerb' || $code == 'badArgument') {
                $request = $request_err;
        }
        $error .= ' <error code="'.xmlstr($code, 'iso8859-1', 
false).'">'.xmlstr($text, 'iso8859-1', false)."</error>\n";

The last line of 3.2.3 in 
http://www.openarchives.org/OAI/openarchivesprotocol.html
should be changed to 

"In cases where the request that generated this response resulted in a 
badVerb or badArgument or idDoesNotExist error condition, the repository 
must return the base URL of the protocol request only. 
Attributes must not be provided in these cases."

I do not think that the data provider has to check the validity of the 
identifier so returning badArgument does not seem to make sense (and the
text does not suggest something like that.

Greetings, Heinrich






> 
> (30) Testing : GetRecord (invalid_id, oai_dc)
> URL :
> http://www.ifeanet.org/phpoai2-1.5/php_oai/oai2.php?verb=GetRecord&ident
> ifier=invalid\"id&metadataPrefix=oai_dc
> ------ Response from Xerces Schema Validation ------
> [Error] re.wWUN2I:7:81: cvc-datatype-valid.1.2.1: 'invalid"id' is not a
> valid value for 'anyURI'. [Error] re.wWUN2I:7:81: cvc-attribute.3: The
> value 'invalid"id' of attribute 'identifier' on element 'request' is not
> valid with respect to its type, 'identifierType'.
> /tmp/re.wWUN2I: 745;11;0 ms (4 elems, 7 attrs, 0 spaces, 149 chars)
> ------- End of Xerces Schema Validation Report  -------
> ------ Start of XML Response ------
> <?xml version="1.0" encoding="UTF-8"?>
> <OAI-PMH xmlns="http://www.openarchives.org/OAI/2.0/"
>          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>          xsi:schemaLocation="http://www.openarchives.org/OAI/2.0/
>          http://www.openarchives.org/OAI/2.0/OAI-PMH.xsd">
>  <responseDate>2005-02-23T17:38:12Z</responseDate>
>  <request verb="GetRecord" identifier="invalid&quot;id"
> metadataPrefix="oai_dc">http://www.ifeanet.org/phpoai2-1.5/php_oai/oai2.
> php</request>
>  <error code="idDoesNotExist">The value &#039;invalidid&#039; of the
> identifier is illegal for this repository.</error> </OAI-PMH>
> 
> I have been reviewing, but I cannot find the error.



> 
> Could you help me, please?
> 
> Best Regards.
> 
> --
> Daniel Manchego 
> Web Administrator
> http://www.ifeanet.org
> INSTITUT FRANCAIS d'ETUDES ANDINES 
> Tlf. 4476070 Cel. 93569056
> Lima - Perú 
> 
> 
> _______________________________________________
> OAI-implementers mailing list
> List information, archives, preferences and to unsubscribe:
> http://www.openarchives.org/mailman/listinfo/oai-implementers
> 
> 

--
  Dr. Heinrich Stamerjohanns        Tel. +49-441-798-4276
  Institute for Science Networking  stamer at uni-oldenburg.de
  University of Oldenburg           http://isn.uni-oldenburg.de/~stamer


More information about the OAI-implementers mailing list