EPrints Technical Mailing List Archive

Message: #06286


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

Re: [EP-tech] Figuring out the highest EPrint ID?


So, while we’re talking about highest EPrint ID and milestone publications and all that, here are some fun facts from QUT ePrints, expressed in SQL since interpretive dance doesn’t carry across very well via email:

 

mysql> select max(eprintid) from eprint \G

max(eprintid): 103687

 

mysql> select count(*) from eprint \G

count(*): 85718

 

mysql> select count(*) from eprint where eprint_status='archive' \G

count(*): 74113

 

mysql> select count(*) from eprint where eprint_status='archive' or eprint_status='buffer' \G

count(*): 74224

 

mysql> -- some manual sleuthing went into these parameters:

mysql> select max(eprintid) from eprint where date_year = 2017 and date_month = 12 and eprint_status = 'archive' \G;

max(eprintid): 102775

 

And that’s without looking at ‘succeeds’ (or replacedby) relationships, etc.

 

So as you can imagine, in our horrible frankensteiny repository, tracking the 100,000th eprint is a lost cause. I do have a cron script that generates a phrase we use on the front page, which makes a very broad (and approximate) summary:

 

“QUT ePrints hosts 74,000 research works with 97,000 downloads in the past week.”

 

I’m happy to share that script, if anyone else is interested.

 

Cheers

--

Matthew Kerwin | ITS-EIS:AS:LS | KG-SYN | QUT

 

From: eprints-tech-bounces@ecs.soton.ac.uk [mailto:eprints-tech-bounces@ecs.soton.ac.uk] On Behalf Of Adam Field
Sent: Thursday, 16 February 2017 19:52
To: eprints-tech@ecs.soton.ac.uk
Subject: Re: [EP-tech] Figuring out the highest EPrint ID?

 

I actually just created this for a tweepository last night:

 

http://websci-tweets.ecs.soton.ac.uk/cgi/tweepository/highest_tweetid

 

Here’s what’s in the cgi scrtipt directory (you’ll just need to globally replace ‘tweet’ with ‘eprint’ in the mysql query):

 

use EPrints;

use strict;

 

my $eprints = EPrints->new;

my $repo = $eprints->current_repository;

exit( 0 ) unless( defined $repo );

 

my $format = $repo->param( "format" );

$format = "default" if( !defined $format );

 

my $sql = 'SELECT MAX(tweetid) FROM tweet';

 

my $sth = $repo->database->prepare($sql);

$sth->execute;

 

my $high_id = $sth->fetchrow_arrayref->[0];

 

 

if ($format eq 'commas')

{

        print scalar reverse join ',', unpack '(A3)*', reverse $high_id;

}

else

{

        print $high_id;

}

 

 

 

 

isc

Adam Field
SHERPA services analyst developer

 

 

From: <eprints-tech-bounces@ecs.soton.ac.uk> on behalf of John Salter <J.Salter@leeds.ac.uk>
Reply-To: "eprints-tech@ecs.soton.ac.uk" <eprints-tech@ecs.soton.ac.uk>
Date: Wednesday, 15 February 2017 11:58
To: "eprints-tech@ecs.soton.ac.uk" <eprints-tech@ecs.soton.ac.uk>
Subject: Re: [EP-tech] Figuring out the highest EPrint ID?

 

Try the database:

mysql> SELECT MAX(eprintid) FROM eprint;

mysql> SELECT counter FROM counters WHERE counterid = 'eprintid';

 

There's probably a way to get this via an EPrints session too if you need that?

 

Cheers,

John

 

 

From: eprints-tech-bounces@ecs.soton.ac.uk [mailto:eprints-tech-bounces@ecs.soton.ac.uk] On Behalf Of Andrew Beeken
Sent: 15 February 2017 11:46
To: eprints-tech@ecs.soton.ac.uk
Subject: [EP-tech] Figuring out the highest EPrint ID?

 

Hello again!

 

New one here, related to a different project! So, I’m trying to find the HIGHEST EPrint ID that we have in our live system. I was doing this by taking the “Latest Additions” atom feed and looking at the topmost entry, however I have now realised this isn’t accurate as this could be representative of an item that has been sat in a work area for a number of weeks or even months. Is there an easy way, via endpoint or API access, that I could use to derive the highest number?

 

Andrew


The University of Lincoln, located in the heart of the city of Lincoln, has established an international reputation based on high student satisfaction, excellent graduate employment and world-class research.


The information in this e-mail and any attachments may be confidential. If you have received this email in error please notify the sender immediately and remove it from your system. Do not disclose the contents to another person or take copies.

Email is not secure and may contain viruses. The University of Lincoln makes every effort to ensure email is sent without viruses, but cannot guarantee this and recommends recipients take appropriate precautions.

The University may monitor email traffic data and content in accordance with its policies and English law. Further information can be found at: http://www.lincoln.ac.uk/legal.


Jisc is a registered charity (number 1149740) and a company limited by guarantee which is registered in England under Company No. 5747339, VAT No. GB 197 0632 86. Jisc’s registered office is: One Castlepark, Tower Hill, Bristol, BS2 0JA. T 0203 697 5800.

Jisc Services Limited is a wholly owned Jisc subsidiary and a company limited by guarantee which is registered in England under company number 2881024, VAT number GB 197 0632 86. The registered office is: One Castle Park, Tower Hill, Bristol BS2 0JA. T 0203 697 5800.

Attachment: smime.p7s
Description: S/MIME cryptographic signature