EPrints Technical Mailing List Archive
See the EPrints wiki for instructions on how to join this mailing list and related information.
Message: #10094
< Previous (by date) | Next (by date) > | < Previous (in thread) | Next (in thread) > | Messages - Most Recent First | Threads - Most Recent First
Re: [EP-tech] report on how many users with ORCIDs in our repository, but limited by year/date.
- To: <eprints-tech@ecs.soton.ac.uk>, Tomasz Neugebauer <Tomasz.Neugebauer@concordia.ca>
- Subject: Re: [EP-tech] report on how many users with ORCIDs in our repository, but limited by year/date.
- From: David R Newman <drn@ecs.soton.ac.uk>
- Date: Tue, 29 Apr 2025 07:48:04 +0100
Hi Tomasz,
Here is a quick bin script that can return the results you want:
#!/usr/bin/perl -I /opt/eprints3/perl_lib
use EPrints;
use strict;
use warnings;
my $repoid = $ARGV[0];
my $repo = new EPrints::Session( 1 , $repoid );
my $ds = $repo->dataset( 'user' );
my $searchexp = $ds->prepare_search();
$searchexp->add_field(
fields => [
$ds->field('orcid_token_expires')
],
value => "-2044",
match => "EQ",
);
my $users = $searchexp->perform_search;
print "users before 2044: ".$users->count."\n";
It should be possible to extract the core of this into however you want to display this. The two critical parts are you just want to refer to to the main name of the field: orcid_token_expires and not the year part. Also, you need to appreciate the syntax of date matching. In the above example, "-2044" is the same as <=2044 in the SQL query example you gave (and also excludes all NULL values). If you only wanted to match before 2044, you would need to use "-2043", if you only want those in 2044 (January 1st to December 31st), you would simply use "2044". Here is the API page section on the wiki that give a bit more detail:
https://wiki.eprints.org/w/API:EPrints/MetaField/Date#Searching
Regards
David Newman
On 29/04/2025 2:04 am, Tomasz
Neugebauer wrote:
CAUTION: This e-mail originated outside the University of Southampton.CAUTION: This e-mail originated outside the University of Southampton.I was able to construct an SQL query that does the job, it's this:
SELECT COUNT(*)FROM userWHERE orcid IS NOT NULLAND orcid != ''AND orcid_token_expires_year IS NOT NULLAND orcid_token_expires_year <= 2044;
Then I spent the rest of the day trying to extract this same info using the EPrints API / Perl script, and I just couldn't get it to work! One error after another after another... defeat after defeat. AI coding bots had equally little success. I think the info is in a field in the user object called orcid_token_expires, but how to extract the info to get that same information proved too much. I will try again, just because now I have to get it, but if anyone can help, it would be greatly appreciated!
Tomasz
From: eprints-tech-request@ecs.soton.ac.uk <eprints-tech-request@ecs.soton.ac.uk> on behalf of Alan.Stiles [He/Him/They] <alan.stiles@open.ac.uk>
Sent: Monday, April 28, 2025 12:27 PM
To: eprints-tech@ecs.soton.ac.uk <eprints-tech@ecs.soton.ac.uk>
Subject: Re: [EP-tech] report on how many users with ORCIDs in our repository, but limited by year/date.Attention This email originates from outside the concordia.ca domain. // Ce courriel provient de l'extérieur du domaine de concordia.ca
CAUTION: This e-mail originated outside the University of Southampton.CAUTION: This e-mail originated outside the University of Southampton.Sorry Tomasz,
To my understanding, the token is valid for 20 years, so it should be before 1/1/2045, (epoch time 2366841600) but my fingers apparently couldn’t type the right date in the email last week…
Alan.
*** Options: https://wiki.eprints.org/w/Eprints-tech_Mailing_List *** Archive: https://www.eprints.org/tech.php/ *** EPrints community wiki: https://wiki.eprints.org/
- Follow-Ups:
- RE: [EP-tech] report on how many users with ORCIDs in our repository, but limited by year/date.
- From: Tomasz Neugebauer <Tomasz.Neugebauer@concordia.ca>
- RE: [EP-tech] report on how many users with ORCIDs in our repository, but limited by year/date.
- References:
- [EP-tech] report on how many users with ORCIDs in our repository, but limited by year/date.
- From: Tomasz Neugebauer <Tomasz.Neugebauer@concordia.ca>
- Re: [EP-tech] report on how many users with ORCIDs in our repository, but limited by year/date.
- From: "Alan.Stiles [He/Him/They]" <alan.stiles@open.ac.uk>
- Re: [EP-tech] report on how many users with ORCIDs in our repository, but limited by year/date.
- From: Tomasz Neugebauer <Tomasz.Neugebauer@concordia.ca>
- Re: [EP-tech] report on how many users with ORCIDs in our repository, but limited by year/date.
- From: "Alan.Stiles [He/Him/They]" <alan.stiles@open.ac.uk>
- Re: [EP-tech] report on how many users with ORCIDs in our repository, but limited by year/date.
- From: Tomasz Neugebauer <Tomasz.Neugebauer@concordia.ca>
- [EP-tech] report on how many users with ORCIDs in our repository, but limited by year/date.
- Prev by Date: Re: [EP-tech] report on how many users with ORCIDs in our repository, but limited by year/date.
- Next by Date: RE: [EP-tech] report on how many users with ORCIDs in our repository, but limited by year/date.
- Previous by thread: Re: [EP-tech] report on how many users with ORCIDs in our repository, but limited by year/date.
- Next by thread: RE: [EP-tech] report on how many users with ORCIDs in our repository, but limited by year/date.
- Index(es):