deutsche-nationalbibliothek / pica-rs

Tools to work with bibliographic records encoded in PICA+.
https://deutsche-nationalbibliothek.github.io/pica-rs/
European Union Public License 1.2
31 stars 5 forks source link

How to reference fields of a given copy #770

Closed jaohbib closed 1 month ago

jaohbib commented 7 months ago

I have a pica record with multiple copys

101@ $a 20 101U $0 utf8 201B/01 $0 15-04-13 $t 16:54:12.000 201U/01 $0 utf8 202D/01 $0 15-04-13 $b 1008 $a 0084 203@/01 $0 653124287 208@/01 $a 22-06-04 $b x 209R/01 $S 1 $u http://d-nb.info/962721840 101@ $a 21 101U $0 utf8 201B/01 $0 14-01-14 $t 19:41:03.000 201U/01 $0 utf8 202D/01 $0 14-01-14 $b 6277 $a 0046 203@/01 $0 659550679 208@/01 $a 12-08-04 $b z 209C/01 $a OLRD $x 00 209R/01 $u http://d-nb.info/962721840/34 101@ $a 22 101U $0 utf8 201B/01 $0 25-02-11 $t 06:48:41.000 201U/01 $0 utf8 202D/01 $0 25-02-11 $b cbs_97 $a 1999 203@/01 $0 554825236 208@/01 $a 07-05-02 $b xu 209O/01 $a SUBolrd $x 00 209R/01 $S 1 $u http://deposit.ddb.de/cgi-bin/dokserv?idn=962721840 101@ $a 30 101U $0 utf8 201B/01 $0 12-06-05 $t 12:54:47.000 201U/01 $0 utf8 202D/01 $0 12-06-05 $b touchtitle $a 0104 203@/01 $0 719589916 208@/01 $a 14-05-05 $b z 209C/01 $a OLRD $x 00 209R/01 $S 1 $u http://deposit.ddb.de/cgi-bin/dokserv?idn=962721840 101@ $a 40 101U $0 utf8 201B/01 $0 25-01-11 $t 11:16:26.000 201U/01 $0 utf8 202D/01 $0 25-01-11 $b r40sel4 $a 1999 203@/01 $0 578429039 208@/01 $a 31-03-03 $b xsn 209R/01 $S 1 $u http://webdoc.sub.gwdg.de/ebook/w/2002/pub/bio/01H004/of_index.htm

I only want to export or filter fields of copy belonging to a given iln
is this possible ?

thanks

nwagner84 commented 7 months ago

Hi @jaohbib,

it's not possible to filter for specific fields which belongs to a copy of an ILN. You have to split the record first: Please take a look at the experimental explode[^1] command.

Regarding your example: You have to split the record first and filter for records which belongs the a given ILN:

$ pica explode -s local DUMP.dat --where '010@.a == "20"' -o out.dat
$ pica explode -s copy DUMP.dat --where '010@.a == "20"' -o out.dat

The first command creates a new dump, containing only records with all copies of ILN 20. The second command creates a new dump, containing records for each copy of an ILN-20 section; all other records/copies will be discarded.

NB: There is a known bug, that fields (except 101@) of the local level are not processed correctly. This bugfix is still on the TODO-list. This could affect your use case.

[^1]: See https://deutsche-nationalbibliothek.github.io/pica-rs/book/docs/kommandos/explode/

nwagner84 commented 5 months ago

Hi @jaohbib,

can I close this issue? Do you need more help?

// nico

jaohbib commented 5 months ago

I am still working on it

jaohbib commented 5 months ago

I use pica explode -s copy DUMP.dat --where '101@.a == "20"' -o out2.dat

to get only my copies but I receive only an empty file . Is this another bug or is there a Problem with my data

I Added a minimal Dump file containing a single record.

DUMP.txt

nwagner84 commented 5 months ago

Ok, this is releated to the bug I mentioned. I took a look into the code, and I think I can fix this soon.

nwagner84 commented 4 months ago

The bugfix #784 will be part of the next pica version.

jaohbib commented 4 months ago

The next Version of Pica or the next Version of Pica rs ist there a timeframe i can expect


Von: Nico Wagner @.***> Gesendet: Mittwoch, 29. Mai 2024 10:31:25 An: deutsche-nationalbibliothek/pica-rs Cc: jaohbib; Mention Betreff: Re: [deutsche-nationalbibliothek/pica-rs] How to reference fields of a given copy (Issue #770)

The bugfix #784https://github.com/deutsche-nationalbibliothek/pica-rs/pull/784 will be part of the next pica version.

— Reply to this email directly, view it on GitHubhttps://github.com/deutsche-nationalbibliothek/pica-rs/issues/770#issuecomment-2136844567, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ARHJMIL2PNRWSWPAY2RJSYDZEWG53AVCNFSM6AAAAABEE27KMGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMZWHA2DINJWG4. You are receiving this because you were mentioned.Message ID: @.***>

nwagner84 commented 4 months ago

I think the new release will be ready by the end of the week.

nwagner84 commented 1 month ago

Hi @jaohbib, is this issue still relevant or can I close the issue?

jaohbib commented 1 month ago

This can be closed

Von: Nico Wagner @.> Gesendet: Sonntag, 1. September 2024 09:43 An: deutsche-nationalbibliothek/pica-rs @.> Cc: jaohbib @.>; Mention @.> Betreff: Re: [deutsche-nationalbibliothek/pica-rs] How to reference fields of a given copy (Issue #770)

Hi @jaohbibhttps://github.com/jaohbib, is this issue still relevant or can I close the issue?

- Reply to this email directly, view it on GitHubhttps://github.com/deutsche-nationalbibliothek/pica-rs/issues/770#issuecomment-2323214438, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ARHJMIJIQGA57NNWOXNIJRDZULAOXAVCNFSM6AAAAABEE27KMGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMRTGIYTINBTHA. You are receiving this because you were mentioned.Message ID: @.***>