[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[EP-tech] Generate abstract by item type
- Subject: [EP-tech] Generate abstract by item type
- From: yurj at alfa.it (Yuri)
- Date: Thu, 7 Jul 2022 08:43:23 +0200
- In-reply-to: <CAANJ=piVFv7cbwL=qc63xgiCVtjGzntbrhDrFSmp8ssj08tNUA@mail.gmail.com>
- References: <CAANJ=pgJq1puWHG7kveTdLSEDeuyvn58oxUGp2GZ-uwVxSKV=Q@mail.gmail.com> <2194c48f-ae30-b05b-4ec4-abe652f7ee82@ecs.soton.ac.uk> <fb77da95-c441-a9d0-da8f-e821d5e5e80d@alfa.it> <EMEW3|a55d3bc5e02e83733c9ee84b4598b799y659me03drn|ecs.soton.ac.uk|2194c48f-ae30-b05b-4ec4-abe652f7ee82@ecs.soton.ac.uk> <fb77da95-c441-a9d0-da8f-e821d5e5e80d@alfa.it> <CAANJ=piVFv7cbwL=qc63xgiCVtjGzntbrhDrFSmp8ssj08tNUA@mail.gmail.com> <a68085ce-4327-2641-87a0-23421bfdfa40@alfa.it>
CAUTION: This e-mail originated outside the University of Southampton.
I would first run:
mysql -u username -p repopassword eprints -e "SELECT eprintid FROM eprint WHERE type = 'cartographic' AND eprint_status = 'archive';" | tail -n +2
to see if the output is ok (should return a list of pids separated by spaces. Then yes, it should be it. Beware that if the password contains some characters interpreted by bash, maybe some escaping could be necessary.
Note: you've to do it because the format of the command output is:
+----------+
| eprintid |
+----------+
| XXXX |
...
+----------+
so you will not get the list separated by a space. Is this correct, David? Here you can find some hint, but you can use a editor to get the list of eprintids to get this format:
XXXX ZZZZ WWWW
adding -N -B remove the extra characters from the output (|, headers) and you can use group_concat to get all in one line:
mysql -u username -p repopassword eprints -N -B -e "SELECT GROUP_CONCAT(eprintid SEPARATOR ' ') FROM eprint WHERE type = 'cartographic' AND eprint_status = 'archive';"
so the command should be
./generate_abstracts digimap `mysql -u username -p repopassword eprints -N -B -e "SELECT GROUP_CONCAT(eprintid SEPARATOR ' ') FROM eprint WHERE type = 'cartographic' AND eprint_status = 'archive';"`
Il 07/07/22 02:36, MOHD.IZWAN SALIM via Eprints-tech ha scritto:
Dear Yuri and David, is this the exact command that I have to run in the terminal?
./generate_abstracts digimap `mysql -u username -p repopassword eprints -e "SELECT eprintid FROM eprint WHERE type = 'cartographic' AND eprint_status = 'archive';" | tail -n +2`
digimap is my repoid
eprints is my database
Izwan
UiTM Institutional Repository
https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fir.uitm.edu.my%2F&data=05%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7C921a089ea1bd493598a608da5fe400f0%7C4a5378f929f44d3ebe89669d03ada9d8%7C0%7C0%7C637927730538614480%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C2000%7C%7C%7C&sdata=y1h9giZxlbjZdPCYcFKi782gUJUhKUgqGxfmT2I5w7M%3D&reserved=0
On Wed, Jul 6, 2022 at 7:50 PM Yuri via Eprints-tech <eprints-tech at ecs.soton.ac.uk<mailto:eprints-tech at ecs.soton.ac.uk>> wrote:
CAUTION: This e-mail originated outside the University of Southampton.
An idea could be to have a generic utils with a query parameter in json
format, so a search is run with that query and the resulting eprintids
used. For example:
bin/find_eprintids <ARCHIVEID> -query '{"type": "conference_item",
"eprint_status": "archive"}' | xargs bin/generate_abstracts <ARCHIVEID>
(dates could be expressed in iso format). The util 'find_eprintids'
would do:
foreach $key (keys %fields)
{
$searchexp->add_field( $ds->get_field( $key ), $fields($key) );
}
my $list = $searchexp->perform_search;
and then return the eprintids from the list.
This could help to combine together multiple search results in a single
file, and cat the file | xargs bin/generate_abstracts <ARCHIVEID>.
I usually use the db as below to get all the eprintids I need to process
but an "eprints" search could be useful/simpler to use.
Il 06/07/22 10:48, David R Newman via Eprints-tech ha scritto:
>
> Hi Izwan,
>
> Unfortunately, there is not currently an easy way to do this bar
> writing your own script. For the next release of EPrints I have
> expanded the epadmin scripts capabilities so all functions where you
> could only provide a single eprint ID, you can now provide multiple
> eprint IDs or even a sequence of eprint IDs (e.g. 1-10 for the first
> 10 eprint IDs). What your email has meant I have realised is that as
> generate_abstracts is a separate script, I have not introduced the
> same functionality to that. I have just been working on fixing that
> oversight and as it is a stand-alone script you should be able to
> download and use the latest version from here:
>
> https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fraw.githubusercontent.com%2Feprints%2Feprints3.4%2Fmaster%2Fbin%2Fgenerate_abstracts&data=05%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7C921a089ea1bd493598a608da5fe400f0%7C4a5378f929f44d3ebe89669d03ada9d8%7C0%7C0%7C637927730538614480%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C2000%7C%7C%7C&sdata=uLYN6nYlNrx3Xy%2BoEMCko8eGUxgNOANuNWWsLmSs%2Bbk%3D&reserved=0
>
> Although the script does not allow you to specify a type option you
> can do a little trick from the command line:
>
> bin/generate_abstracts <ARCHIVEID> `mysql -u <DBUSER> -p<DBPASSWORD>
> <DBNAME> -e "SELECT eprintid FROM eprint WHERE type =
> 'conference_item' AND eprint_status = 'archive';" | tail -n +2`
>
> What this does is queries the database for all live archive items of a
> particular eprint type (in this case conference_item) and prints out
> this list of eprint IDs. the "| tail -n +2" keeps everything from the
> 2nd line onwards (i.e. removes the first line), as this contains the
> name of the column (i.e. eprintid), which is not an eprint ID in itself.
>
> Regards
>
> David Newman
>
> On 06/07/2022 6:15 am, MOHD.IZWAN SALIM via Eprints-tech wrote:
>> *CAUTION:* This e-mail originated outside the University of Southampton.
>> Dear all, can we generate abstract pages by an option item type or
>> other metadata?
>>
>> Regards
>>
>> *Izwan*
>> UiTM Institutional Repository
>> https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fir.uitm.edu.my%2F&data=05%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7C921a089ea1bd493598a608da5fe400f0%7C4a5378f929f44d3ebe89669d03ada9d8%7C0%7C0%7C637927730538614480%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C2000%7C%7C%7C&sdata=y1h9giZxlbjZdPCYcFKi782gUJUhKUgqGxfmT2I5w7M%3D&reserved=0
>> <https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fir.uitm.edu.my%2F&data=05%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7C921a089ea1bd493598a608da5fe400f0%7C4a5378f929f44d3ebe89669d03ada9d8%7C0%7C0%7C637927730538614480%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C2000%7C%7C%7C&sdata=y1h9giZxlbjZdPCYcFKi782gUJUhKUgqGxfmT2I5w7M%3D&reserved=0>
>>
>> *PENAFIAN: *E-mel ini dan apa-apa fail yang dihantar bersama-samanya
>> ("Mesej") adalah dihasratkan hanya untuk kegunaan penerima yang
>> dinyatakan di atas dan mungkin mengandungi maklumat yang tidak umum,
>> bermilik, istimewa, sulit dan dikecualikan dari penzahiran di bawah
>> undang-undang yang terpakai termasuklah Akta Rahsia Rasmi 1972. _BACA
>> SELANJUTNYA..._
>> <https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fmail.uitm.edu.my%2Findex.php%3Foption%3Dcom_content%26view%3Darticle%26id%3D83&data=05%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7C921a089ea1bd493598a608da5fe400f0%7C4a5378f929f44d3ebe89669d03ada9d8%7C0%7C0%7C637927730538614480%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C2000%7C%7C%7C&sdata=tb5yTU%2ByXkrfSoKt3wS%2FXuJVW9l%2BpojDBr4uP8XOUYc%3D&reserved=0>
>>
>> ------------------------------------------------------------------------
>> *DISCLAIMER :*/This e-mail and any files transmitted with it
>> ("Message") is intended only for the use of the recipient(s) named
>> above and may contain information that is non-public, proprietary,
>> privileged, confidential and exempt from disclosure under
>> applicable law including the Official Secrets Act 1972. /_READ
>> MORE..._
>> <https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fmail.uitm.edu.my%2Findex.php%3Foption%3Dcom_content%26view%3Darticle%26id%3D83&data=05%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7C921a089ea1bd493598a608da5fe400f0%7C4a5378f929f44d3ebe89669d03ada9d8%7C0%7C0%7C637927730538614480%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C2000%7C%7C%7C&sdata=tb5yTU%2ByXkrfSoKt3wS%2FXuJVW9l%2BpojDBr4uP8XOUYc%3D&reserved=0>
>>
>> *** Options:http://mailman.ecs.soton.ac.uk/mailman/listinfo/eprints-tech
>> *** Archive:https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.eprints.org%2Ftech.php%2F&data=05%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7C921a089ea1bd493598a608da5fe400f0%7C4a5378f929f44d3ebe89669d03ada9d8%7C0%7C0%7C637927730538614480%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C2000%7C%7C%7C&sdata=hPwOfZ9nVnRIDewH6RULp1fAqd%2BO3HMK%2BBwMgR84YX8%3D&reserved=0
>> *** EPrints community wiki:https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwiki.eprints.org%2F&data=05%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7C921a089ea1bd493598a608da5fe400f0%7C4a5378f929f44d3ebe89669d03ada9d8%7C0%7C0%7C637927730538614480%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C2000%7C%7C%7C&sdata=U9RXLTo1X12iAQGHGfc3%2Bj1ueC%2BV4%2FHGHvGZYASjtPY%3D&reserved=0
>
> *** Options: http://mailman.ecs.soton.ac.uk/mailman/listinfo/eprints-tech
> *** Archive: https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.eprints.org%2Ftech.php%2F&data=05%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7C921a089ea1bd493598a608da5fe400f0%7C4a5378f929f44d3ebe89669d03ada9d8%7C0%7C0%7C637927730538614480%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C2000%7C%7C%7C&sdata=hPwOfZ9nVnRIDewH6RULp1fAqd%2BO3HMK%2BBwMgR84YX8%3D&reserved=0
> *** EPrints community wiki: https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwiki.eprints.org%2F&data=05%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7C921a089ea1bd493598a608da5fe400f0%7C4a5378f929f44d3ebe89669d03ada9d8%7C0%7C0%7C637927730538614480%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C2000%7C%7C%7C&sdata=U9RXLTo1X12iAQGHGfc3%2Bj1ueC%2BV4%2FHGHvGZYASjtPY%3D&reserved=0
*** Options: http://mailman.ecs.soton.ac.uk/mailman/listinfo/eprints-tech
*** Archive: https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.eprints.org%2Ftech.php%2F&data=05%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7C921a089ea1bd493598a608da5fe400f0%7C4a5378f929f44d3ebe89669d03ada9d8%7C0%7C0%7C637927730538614480%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C2000%7C%7C%7C&sdata=hPwOfZ9nVnRIDewH6RULp1fAqd%2BO3HMK%2BBwMgR84YX8%3D&reserved=0
*** EPrints community wiki: https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwiki.eprints.org%2F&data=05%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7C921a089ea1bd493598a608da5fe400f0%7C4a5378f929f44d3ebe89669d03ada9d8%7C0%7C0%7C637927730538614480%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C2000%7C%7C%7C&sdata=U9RXLTo1X12iAQGHGfc3%2Bj1ueC%2BV4%2FHGHvGZYASjtPY%3D&reserved=0
PENAFIAN: E-mel ini dan apa-apa fail yang dihantar bersama-samanya ("Mesej") adalah dihasratkan hanya untuk kegunaan penerima yang dinyatakan di atas dan mungkin mengandungi maklumat yang tidak umum, bermilik, istimewa, sulit dan dikecualikan dari penzahiran di bawah undang-undang yang terpakai termasuklah Akta Rahsia Rasmi 1972. BACA SELANJUTNYA...<https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fmail.uitm.edu.my%2Findex.php%3Foption%3Dcom_content%26view%3Darticle%26id%3D83&data=05%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7C921a089ea1bd493598a608da5fe400f0%7C4a5378f929f44d3ebe89669d03ada9d8%7C0%7C0%7C637927730538614480%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C2000%7C%7C%7C&sdata=tb5yTU%2ByXkrfSoKt3wS%2FXuJVW9l%2BpojDBr4uP8XOUYc%3D&reserved=0>
________________________________
DISCLAIMER : This e-mail and any files transmitted with it ("Message") is intended only for the use of the recipient(s) named above and may contain information that is non-public, proprietary, privileged, confidential and exempt from disclosure under applicable law including the Official Secrets Act 1972. READ MORE...<https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fmail.uitm.edu.my%2Findex.php%3Foption%3Dcom_content%26view%3Darticle%26id%3D83&data=05%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7C921a089ea1bd493598a608da5fe400f0%7C4a5378f929f44d3ebe89669d03ada9d8%7C0%7C0%7C637927730538614480%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C2000%7C%7C%7C&sdata=tb5yTU%2ByXkrfSoKt3wS%2FXuJVW9l%2BpojDBr4uP8XOUYc%3D&reserved=0>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ecs.soton.ac.uk/pipermail/eprints-tech/attachments/20220707/ca5714d2/attachment-0001.html