EPrints Technical Mailing List Archive
See the EPrints wiki for instructions on how to join this mailing list and related information.
Message: #05476
< Previous (by date) | Next (by date) > | < Previous (in thread) | Next (in thread) > | Messages - Most Recent First | Threads - Most Recent First
Re: [EP-tech] subject dataset - removing subjectid from eprint
- To: "eprints-tech@ecs.soton.ac.uk" <eprints-tech@ecs.soton.ac.uk>
- Subject: Re: [EP-tech] subject dataset - removing subjectid from eprint
- From: John Salter <J.Salter@leeds.ac.uk>
- Date: Wed, 9 Mar 2016 06:36:25 +0000
Interesting... You could try adding the subject back into the tree temporarily to see if it works that way? Using this script should cause any affected EPrints' summary pages to be regenerated - if you alter the database directly, you'd have to do this by running bin/generate_abstracts. Cheers, John From: eprints-tech-bounces@ecs.soton.ac.uk <eprints-tech-bounces@ecs.soton.ac.uk> on behalf of Monica Wood <monica.wood@utas.edu.au>
Sent: 09 March 2016 04:33:34 To: 'eprints-tech@ecs.soton.ac.uk' Subject: Re: [EP-tech] subject dataset - removing subjectid from eprint
Hi John,
Thanks for linking me to this script.
I’ve had a look through it and tried it out, but it’s not working. I believe this is because I’ve already removed the node from the subject tree (Unlinked it from the tree).
Putting the noise level up on the script to 3 gives me some feedback on a query it’s doing at I believe this line?
my $list = $session->get_repository->dataset( 'eprint' )->search( filters => [ { meta_fields => [ $fieldname ], value => $subjectid } This query is (with filename set to collections and subjectid set to theses)
Database execute debug: SELECT `eprint`.`eprintid` FROM `eprint`, `eprint_collections` AS `eprint_collections`, `subject_ancestors` AS `127395456subject_ancestors` WHERE `eprint`.`eprintid`=`eprint_collections`.`eprintid` AND `eprint_collections`.`collections`=`127395456subject_ancestors`.`subjectid` AND `127395456subject_ancestors`.`ancestors` = 'theses' GROUP BY `eprint`.`printed`
This is returning an empty list, as the theses subjectid no longer exists in subject_ancestors, but it does still exist in eprint_collections. I’ll have a go at bulk changing the records from the GUI, if that doesn’t work out, I’ll do a bulk change directly in the database by removing the entries in eprint_collections that point to the theses subjectid. Cheers, Monica Wood
Library Systems Officer
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: Tuesday, 8 March 2016 at 10:06 PM To: "'eprints-tech@ecs.soton.ac.uk'" <eprints-tech@ecs.soton.ac.uk> Subject: Re: [EP-tech] subject dataset - remove_field Hi Monica, I think your suggestion will remove the field itself, rather than a specific value stored in that field. I’ve done something similar – just added it to the wiki for you: https://wiki.eprints.org/w/Remove_subjectid_script Let me know if it doesn’t work for you. Cheers, John From:
eprints-tech-bounces@ecs.soton.ac.uk [mailto:eprints-tech-bounces@ecs.soton.ac.uk]
On Behalf Of Monica Wood Hi there, In our repository we have a root subject called ‘Collections’ Under this I have unlinked(deleted) a child of Collections. I now have the issue that all items that were connected to this collection still have the metadata saying so and on our summary page we display the collection an
item belongs to. So it’s now showing ‘??colllectionName??’ as a link and that link is now dead. Is there a way to delete these connections without needing to do it directly through the database? I was wondering if the epadmin remove_field might do the job on the subject dataset? Something like: ~/bin/epadmin remove_field repoid subject collectionid ?? Thanks in advanced
Monica Wood Available Times Tues: 9am – 5pm Wed: 1pm – 5pm Fri: 9am – 5pm
|
- References:
- Re: [EP-tech] subject dataset - removing subjectid from eprint
- From: Monica Wood <monica.wood@utas.edu.au>
- Re: [EP-tech] subject dataset - removing subjectid from eprint
- Prev by Date: Re: [EP-tech] subject dataset - removing subjectid from eprint
- Next by Date: Re: [EP-tech] Delete Eprints_ID
- Previous by thread: Re: [EP-tech] subject dataset - removing subjectid from eprint
- Next by thread: Re: [EP-tech] subject dataset - removing subjectid from eprint
- Index(es):