EPrints Technical Mailing List Archive

Message: #08788


< Previous (by date) | Next (by date) > | < Previous (in thread) | Next (in thread) > | Messages - Most Recent First | Threads - Most Recent First

Re: [EP-tech] non-existent dates and oai-pmh sets


CAUTION: This e-mail originated outside the University of Southampton.

Hi Tomasz,

For the OAI-PMH question, you can add 'from' and 'until' parameters to the request - based on the last_mod date of the record in question e.g.:


https://[YOUR REPO]/cgi/oai2?verb=ListIdentifiers&metadataPrefix=oai_dc&set=[YOUR CUSTOM SET ID]&from=[A TIME JUST BEFORE THE LASTMOD]&until=[A TIME JUST AFTER THE LASTMOD]

The from/until params should be in the format: 2021-11-01T00:00:00Z

 

Automatic sets get listed on the item page* but it appears that the custom sets don't get listed.

I'll have to revisit the OAI-PMH specs to see if this is an allowed behaviour…

 

Cheers,

John

 

 

* e.g. EPrint 631 is part of our 'irus-orcid' set: https://eprints.whiterose.ac.uk/cgi/oai2?verb=ListIdentifiers&metadataPrefix=oai_dc&set=irus-orcid&from=2021-11-01T00:00:00Z&until=2021-11-02T00:00:00Z

but the irus-orcid set isn't listed on https://eprints.whiterose.ac.uk/cgi/oai2?verb=GetRecord&metadataPrefix=oai_dc&identifier=oai:eprints.whiterose.ac.uk:631

 

 

From: eprints-tech-bounces@ecs.soton.ac.uk [mailto:eprints-tech-bounces@ecs.soton.ac.uk] On Behalf Of David R Newman via Eprints-tech
Sent: 03 November 2021 23:46
To: eprints-tech@ecs.soton.ac.uk; Tomasz Neugebauer <Tomasz.Neugebauer@concordia.ca>
Subject: Re: [EP-tech] non-existent dates and oai-pmh sets

 

Hi Tomasz,

 

Validation for dates has been added in EPrints 3.4.3, which prevent invalid dates being set.  Unfortunately, a couple of bugs have been found post release:

 

1. Multiple values not supported by EPrints::MetaField::Date validate function

2. Bespoke validations no longer supported for Date MetaField

 

Both of these issues would not be a problem in a vanilla EPrints archive but if you use the Dates, Dates, Dates Bazaar plugin, you will need to apply a patch to fix this.  If you had your own validation triggers set for individual date fields, then these would have stopped working without a second patch to fix this.  Both these patches can be found at the EPrints 3.4.3 release wiki page [1].

 

A further addition to the Date MetaField in 3.4.3 is the ability to define a bespoke function under $c->{worfklow_datepicker} that defines the HTML markup as a XML::LibXML::DocumentFragment.  This HTML markup could include client-side (i.e. _javascript_) validation/restrictions to prevent invalid dates from being set (e.g. if you change the month to February, its does not allow 30th or 31st to be set for the date).

 

Alternatively there is a Datepicker MetaField available in the daterangepicker ingredient [2].  However, this uses a single text field rather than multiple field separately storing year, month and day in separate database columns.  So it is not ideal if you want to transform an existing Date MetaField into a Datepicker MetaField.

 

On you second question.  There is no URL syntax to test if an item is in a particular OAI-PMH set.  I think that statement is true for all OAI-PMH not just specific to EPrints.  I am not sure there is any straightforward way to perform your test, bar writing your own client script to download just the identifiers for a whole OAI-PMH set, 100 identifiers at a time, as OAI-PMH is designed to work.  After downloading each tranche check whether the item in question is present.   The initial request for identifiers in a set would be a bit like:

 

https://example.eprints.org/cgi/oai2?verb=ListIdentifiers&metadataPrefix=oai_dc&set=7374617475733D707562

 

This will then give you a resumption token to get the next 100 until there are no more identifiers left.

 

Regards

 

David Newman

 

[1] https://wiki.eprints.org/w/EPrints_3.4.3#Known_Issues

[2] https://github.com/eprints/daterangepicker/blob/master/plugins/EPrints/MetaField/Datepicker.pm

 

 

On 03/11/2021 22:44, Tomasz Neugebauer via Eprints-tech wrote:

CAUTION: This e-mail originated outside the University of Southampton.

Hello everyone,

 

I have a couple of questions.

 

First question, it's about setting an embargo expiry date (and choosing other dates).  It was recently brought to my attention that it is possible to set "non-existent" dates, for example, February 31st or April 31st.  I'm not sure if I hadn't thought about this before, or if I didn't really think of this as an issue, but I suppose this raises the question of:

If the embargo expiry date (e.g: April 31st) never happens, then does the embargo ever expire?  🙂   The question is, has anyone thought this issue serious enough to build-in some error checking for this, or attempted to modify the date-picker interface that exists in EPrints to address this issue?

 

Second question, it's about limiting what is inside an OAI-PMH set.  Based on my understanding, we can use something like this in the oai.pl configuration to create a set that is both (1) limited to un-embargoed (open access) items AND (2) items limited by type:

 

$oai->{custom_sets} = [

            {           spec => "openaire", name => "OpenAIRE Set - OA article conference book monograph",

                        filters=> [

                                    {meta_fields=>["full_text_status"], value=>"public"},

                                    {meta_fields =>[qw( type )], merge => "ANY", value => "article conference_item book_section monograph book" }

                        ]

            }

];

How can I confirm if this is working correctly?  In other words, how can I test if an item in the repository is part of an OAI-PMH set?  Is there a URL syntax where I could pass the eprintid and the set name to find out if it is part of the set?

 

Thanks!

 

Tomasz

 

 

________________________________________________

Tomasz Neugebauer
Senior Librarian | Bibliothécaire titulaire
Digital Projects & Systems Development Librarian / Bibliothécaire des Projets Numériques & Développement de Systèmes
Concordia University / Université Concordia

Tel. / Tél. 514-848-2424 ext. / poste 7738
Email / courriel: 
tomasz.neugebauer@concordia.ca

Mailing address / adresse postale: 1455 De Maisonneuve Blvd. W., LB-540-03, Montreal, Quebec H3G 1M8
Street address / adresse municipale: 1400 De Maisonneuve Blvd. W., LB-540-03, Montreal, Quebec H3G 1M8

library.concordia.ca



*** Options: http://mailman.ecs.soton.ac.uk/mailman/listinfo/eprints-tech
*** Archive: http://www.eprints.org/tech.php/
*** EPrints community wiki: http://wiki.eprints.org/

 

!

Virus-free. www.avg.com