blob: 6939e324dc3f28805d8273fc1812f61f5dd86c2e [file] [log] [blame]
Akronc13a1702016-03-15 19:33:14 +01001=pod
2
3=encoding utf8
4
5=head1 NAME
6
Akron42f48c12020-02-14 13:08:13 +01007korapxml2krill - Merge KorAP-XML data and create Krill documents
Akronc13a1702016-03-15 19:33:14 +01008
9
10=head1 SYNOPSIS
11
Akron9cb8c982024-03-22 10:46:56 +010012 $ korapxml2krill [archive|extract] --input <directory|archive> [options]
Akron2fd402b2016-10-27 21:26:48 +020013
Akronc13a1702016-03-15 19:33:14 +010014
15=head1 DESCRIPTION
16
Akron5c71a852016-10-31 16:00:33 +010017L<KorAP::XML::Krill> is a library to convert KorAP-XML documents to files
18compatible with the L<Krill|https://github.com/KorAP/Krill> indexer.
Akron8f69d632020-01-15 16:58:11 +010019The C<korapxml2krill> command line tool is a simple wrapper of this library.
Akronc13a1702016-03-15 19:33:14 +010020
21
Akron5c71a852016-10-31 16:00:33 +010022=head1 INSTALLATION
Akronc13a1702016-03-15 19:33:14 +010023
Akron5c71a852016-10-31 16:00:33 +010024The preferred way to install L<KorAP::XML::Krill> is to use L<cpanm|App::cpanminus>.
Akronc13a1702016-03-15 19:33:14 +010025
Akron5c71a852016-10-31 16:00:33 +010026 $ cpanm https://github.com/KorAP/KorAP-XML-Krill.git
Akronc13a1702016-03-15 19:33:14 +010027
Akron5c71a852016-10-31 16:00:33 +010028In case everything went well, the C<korapxml2krill> tool will
29be available on your command line immediately.
Akron8ce23f72023-12-13 15:48:49 +010030Minimum requirement for L<KorAP::XML::Krill> is Perl 5.32.
Akroneb370a02022-02-24 13:33:40 +010031Optionally installing L<Archive::Tar::Builder> speeds up archive building.
32Optional support for L<Sys::Info> to calculate available cores is available.
Akron5c71a852016-10-31 16:00:33 +010033In addition to work with zip archives, the C<unzip> tool needs to be present.
Akronc13a1702016-03-15 19:33:14 +010034
Akron5c71a852016-10-31 16:00:33 +010035=head1 ARGUMENTS
Akronc13a1702016-03-15 19:33:14 +010036
Akron9cb8c982024-03-22 10:46:56 +010037 $ korapxml2krill -z --input <directory> --output <filename>
Akron5c71a852016-10-31 16:00:33 +010038
39Without arguments, C<korapxml2krill> converts a directory of a single KorAP-XML document.
40It expects the input to point to the text level folder.
41
42=over 2
43
44=item B<archive>
45
Akron9cb8c982024-03-22 10:46:56 +010046 $ korapxml2krill archive -z --input <directory|archive> --output <directory|tar>
Akron5c71a852016-10-31 16:00:33 +010047
48Converts an archive of KorAP-XML documents. It expects a directory
49(pointing to the corpus level folder) or one or more zip files as input.
50
51=item B<extract>
52
53 $ korapxml2krill extract --input <archive> --output <directory> --sigle <SIGLE>
54
55Extracts KorAP-XML documents from a zip file.
56
Akron442c4e92017-04-10 23:41:31 +020057=item B<serial>
58
Akron9cb8c982024-03-22 10:46:56 +010059 $ korapxml2krill serial -i <archive1> -i <archive2> -o <directory> -cfg <config-file>
Akron442c4e92017-04-10 23:41:31 +020060
61Convert archives sequentially. The inputs are not merged but treated
62as they are (so they may be premerged or globs).
63the C<--out> directory is treated as the base directory where subdirectories
Akronf73ffb62018-06-27 12:13:59 +020064are created based on the archive name. In case the C<--to-tar> flag is given,
65the output will be a tar file.
Akron442c4e92017-04-10 23:41:31 +020066
67
Akron9f37ed72022-01-17 12:10:08 +010068=item B<slimlog>
69
Akron9cb8c982024-03-22 10:46:56 +010070 $ korapxml2krill slimlog <logfile> > <logfile-slim>
Akron9f37ed72022-01-17 12:10:08 +010071
72Filters out all useless aka succesfull information from logs, to simplify
73log checks. Expects no further options.
74
75
Akron5c71a852016-10-31 16:00:33 +010076=back
Akrona76d8352016-10-27 16:27:32 +020077
Akron7606afa2016-10-25 16:23:49 +020078
Akron5c71a852016-10-31 16:00:33 +010079=head1 OPTIONS
Akronc13a1702016-03-15 19:33:14 +010080
Akron5c71a852016-10-31 16:00:33 +010081=over 2
Akronc13a1702016-03-15 19:33:14 +010082
Akron5c71a852016-10-31 16:00:33 +010083=item B<--input|-i> <directory|zip file>
Akrona76d8352016-10-27 16:27:32 +020084
Akron5c71a852016-10-31 16:00:33 +010085Directory or zip file(s) of documents to convert.
Akronc13a1702016-03-15 19:33:14 +010086
Akron5c71a852016-10-31 16:00:33 +010087Without arguments, C<korapxml2krill> expects a folder of a single KorAP-XML
Akronf1a1de92016-11-02 17:32:12 +010088document, while C<archive> expects a KorAP-XML corpus folder or a zip
89file to batch process multiple files.
90C<extract> expects zip files only.
Akronc13a1702016-03-15 19:33:14 +010091
Akrondee3cf62024-06-14 18:14:48 +020092C<archive> supports multiple input zip files with the constraint
Akron5c71a852016-10-31 16:00:33 +010093that the first archive listed contains all primary data files
94and all meta data files.
Akrona76d8352016-10-27 16:27:32 +020095
Akron5c71a852016-10-31 16:00:33 +010096 -i file/news.zip -i file/news.malt.zip -i "#file/news.tt.zip"
Akronc13a1702016-03-15 19:33:14 +010097
Akron821db3d2017-04-06 21:19:31 +020098Input may also be defined using BSD glob wildcards.
99
100 -i 'file/news*.zip'
101
102The extended input array will be sorted in length order, so the shortest
103path needs to contain all primary data files and all meta data files.
104
Akrondee3cf62024-06-14 18:14:48 +0200105(The directory structure follows the base directory format
Akron5c71a852016-10-31 16:00:33 +0100106that may include a C<.> root folder.
107In this case further archives lacking a C<.> root folder
108need to be passed with a hash sign in front of the archive's name.
109This may require to quote the parameter.)
Akronc13a1702016-03-15 19:33:14 +0100110
Akron5c71a852016-10-31 16:00:33 +0100111To support zip files, a version of C<unzip> needs to be installed that is
112compatible with the archive file.
Akronc13a1702016-03-15 19:33:14 +0100113
Akron5c71a852016-10-31 16:00:33 +0100114B<The root folder switch using the hash sign is experimental and
115may vanish in future versions.>
Akronc13a1702016-03-15 19:33:14 +0100116
Akronf73ffb62018-06-27 12:13:59 +0200117
Akron442c4e92017-04-10 23:41:31 +0200118=item B<--input-base|-ib> <directory>
119
120The base directory for inputs.
121
122
Akron5c71a852016-10-31 16:00:33 +0100123=item B<--output|-o> <directory|file>
Akronc13a1702016-03-15 19:33:14 +0100124
Akron5c71a852016-10-31 16:00:33 +0100125Output folder for archive processing or
126document name for single output (optional),
127writes to C<STDOUT> by default
128(in case C<output> is not mandatory due to further options).
Akronc13a1702016-03-15 19:33:14 +0100129
Akron5c71a852016-10-31 16:00:33 +0100130=item B<--overwrite|-w>
Akronc13a1702016-03-15 19:33:14 +0100131
Akron5c71a852016-10-31 16:00:33 +0100132Overwrite files that already exist.
Akron7606afa2016-10-25 16:23:49 +0200133
Akronf73ffb62018-06-27 12:13:59 +0200134
Akron3741f8b2016-12-21 19:55:21 +0100135=item B<--token|-t> <foundry>#<file>
Akrona5920b12016-06-29 18:51:21 +0200136
Akron5c71a852016-10-31 16:00:33 +0100137Define the default tokenization by specifying
138the name of the foundry and optionally the name
139of the layer-file. Defaults to C<OpenNLP#tokens>.
Akronf1849aa2019-12-16 23:35:33 +0100140This will directly take the file instead of running
141the layer implementation!
Akron3741f8b2016-12-21 19:55:21 +0100142
Akron8f69d632020-01-15 16:58:11 +0100143
Akron3741f8b2016-12-21 19:55:21 +0100144=item B<--base-sentences|-bs> <foundry>#<layer>
145
146Define the layer for base sentences.
147If given, this will be used instead of using C<Base#Sentences>.
Akronc29b8e12019-12-16 14:28:09 +0100148Currently C<DeReKo#Structure> and C<DGD#Structure> are the only additional
149layers supported.
Akron3741f8b2016-12-21 19:55:21 +0100150
151 Defaults to unset.
152
153
154=item B<--base-paragraphs|-bp> <foundry>#<layer>
155
156Define the layer for base paragraphs.
157If given, this will be used instead of using C<Base#Paragraphs>.
Akron9f37ed72022-01-17 12:10:08 +0100158Currently C<DeReKo#Structure> and C<DGD#Structure> are the only additional
159layer supported.
Akron3741f8b2016-12-21 19:55:21 +0100160
161 Defaults to unset.
162
163
Akron821db3d2017-04-06 21:19:31 +0200164=item B<--base-pagebreaks|-bpb> <foundry>#<layer>
165
166Define the layer for base pagebreaks.
167Currently C<DeReKo#Structure> is the only layer supported.
168
169 Defaults to unset.
170
171
Akron5c71a852016-10-31 16:00:33 +0100172=item B<--skip|-s> <foundry>[#<layer>]
173
174Skip specific annotations by specifying the foundry
175(and optionally the layer with a C<#>-prefix),
176e.g. C<Mate> or C<Mate#Morpho>. Alternatively you can skip C<#ALL>.
177Can be set multiple times.
178
Akronf73ffb62018-06-27 12:13:59 +0200179
Akron5c71a852016-10-31 16:00:33 +0100180=item B<--anno|-a> <foundry>#<layer>
181
182Convert specific annotations by specifying the foundry
183(and optionally the layer with a C<#>-prefix),
184e.g. C<Mate> or C<Mate#Morpho>.
185Can be set multiple times.
186
Akronf73ffb62018-06-27 12:13:59 +0200187
Akroned9baf02019-01-22 17:03:25 +0100188=item B<--non-word-tokens|-nwt>
189
190Tokenize non-word tokens like word tokens (defined as matching
191C</[\d\w]/>). Useful to treat punctuations as tokens.
192
193 Defaults to unset.
194
Akronf1849aa2019-12-16 23:35:33 +0100195
196=item B<--non-verbal-tokens|-nvt>
197
198Tokenize non-verbal tokens marked as in the primary data as
199the unicode symbol 'Black Vertical Rectangle' aka \x25ae.
200
201 Defaults to unset.
202
203
Akron5c71a852016-10-31 16:00:33 +0100204=item B<--jobs|-j>
205
Akron29128262024-04-17 15:50:36 +0200206Define the number of spawned forks for concurrent jobs
207of archive processing.
Akron5c71a852016-10-31 16:00:33 +0100208Defaults to C<0> (everything runs in a single process).
Akronf73ffb62018-06-27 12:13:59 +0200209
Akrona472a242023-02-13 13:46:30 +0100210If C<sequential-extraction> is not set to true, this will
Akronf73ffb62018-06-27 12:13:59 +0200211also apply to extraction.
212
Akronebbac2e2024-03-22 10:31:23 +0100213Pass C<-1>, and the value will be set automatically to 5
Akron0b04b312020-10-30 17:39:18 +0100214times the number of available cores, in case L<Sys::Info>
Akronebbac2e2024-03-22 10:31:23 +0100215is available and can read CPU count (see C<--job-count>).
216Be aware, that the report of available cores
Akron29128262024-04-17 15:50:36 +0200217may not work in certain conditions. Benchmarking the processing
218speed based on the number of jobs may be valuable.
Akronebbac2e2024-03-22 10:31:23 +0100219
Akron5c71a852016-10-31 16:00:33 +0100220This is I<experimental>.
221
Akronf73ffb62018-06-27 12:13:59 +0200222
Akronebbac2e2024-03-22 10:31:23 +0100223=item B<--job-count|-jc>
224
225Print job and core information that would be used if
226C<-1> was passed to C<--jobs>.
227
228
Akron263274c2019-02-07 09:48:30 +0100229=item B<--koral|-k>
230
231Version of the output format. Supported versions are:
232C<0> for legacy serialization, C<0.03> for serialization
233with metadata fields as key-values on the root object,
234C<0.4> for serialization with metadata fields as a list
235of C<"@type":"koral:field"> objects.
236
237Currently defaults to C<0.03>.
238
239
Akronf73ffb62018-06-27 12:13:59 +0200240=item B<--sequential-extraction|-se>
241
242Flag to indicate, if the C<jobs> value also applies to extraction.
243Some systems may have problems with extracting multiple archives
244to the same folder at the same time.
245Can be flagged using C<--no-sequential-extraction> as well.
246Defaults to C<false>.
247
248
Akron5c71a852016-10-31 16:00:33 +0100249=item B<--meta|-m>
250
251Define the metadata parser to use. Defaults to C<I5>.
252Metadata parsers can be defined in the C<KorAP::XML::Meta> namespace.
253This is I<experimental>.
254
Akronf73ffb62018-06-27 12:13:59 +0200255
Akron5c71a852016-10-31 16:00:33 +0100256=item B<--gzip|-z>
257
258Compress the output.
259Expects a defined C<output> file in single processing.
260
Akronf73ffb62018-06-27 12:13:59 +0200261
Akron5c71a852016-10-31 16:00:33 +0100262=item B<--cache|-c>
263
264File to mmap a cache (using L<Cache::FastMmap>).
265Defaults to C<korapxml2krill.cache> in the calling directory.
266
Akronf73ffb62018-06-27 12:13:59 +0200267
Akron5c71a852016-10-31 16:00:33 +0100268=item B<--cache-size|-cs>
269
270Size of the cache. Defaults to C<50m>.
271
Akronf73ffb62018-06-27 12:13:59 +0200272
Akron5c71a852016-10-31 16:00:33 +0100273=item B<--cache-init|-ci>
274
275Initialize cache file.
276Can be flagged using C<--no-cache-init> as well.
277Defaults to C<true>.
278
Akronf73ffb62018-06-27 12:13:59 +0200279
Akron5c71a852016-10-31 16:00:33 +0100280=item B<--cache-delete|-cd>
281
282Delete cache file after processing.
283Can be flagged using C<--no-cache-delete> as well.
284Defaults to C<true>.
285
Akronf73ffb62018-06-27 12:13:59 +0200286
Akron636aa112017-04-07 18:48:56 +0200287=item B<--config|-cfg>
288
289Configure the parameters of your call in a file
290of key-value pairs with whitespace separator
291
292 overwrite 1
293 token DeReKo#Structure
294 ...
295
296Supported parameters are:
Akron442c4e92017-04-10 23:41:31 +0200297C<overwrite>, C<gzip>, C<jobs>, C<input-base>,
Akron29128262024-04-17 15:50:36 +0200298C<token>, C<log>,
299C<cache>, C<cache-size>, C<cache-init>, C<cache-delete>, C<meta>,
Akron57510c12019-01-04 14:58:53 +0100300C<output>, C<koral>,
Akron9a2545e2022-01-16 15:15:50 +0100301C<temporary-extract>, C<sequential-extraction>,
Akronf73ffb62018-06-27 12:13:59 +0200302C<base-sentences>, C<base-paragraphs>,
303C<base-pagebreaks>,
304C<skip> (semicolon separated), C<sigle>
Akron636aa112017-04-07 18:48:56 +0200305(semicolon separated), C<anno> (semicolon separated).
306
Akronf73ffb62018-06-27 12:13:59 +0200307Configuration parameters will always be overwritten by
308passed parameters.
309
310
Akron81500102017-04-07 20:45:44 +0200311=item B<--temporary-extract|-te>
312
Akrona472a242023-02-13 13:46:30 +0100313Only valid for the C<archive> and C<serial>
314commands.
Akron81500102017-04-07 20:45:44 +0200315
316This will first extract all files into a
317directory and then will archive.
318If the directory is given as C<:temp:>,
319a temporary directory is used.
320This is especially useful to avoid
321massive unzipping and potential
322network latency.
Akron636aa112017-04-07 18:48:56 +0200323
Akronf73ffb62018-06-27 12:13:59 +0200324
Akronc93a0802019-07-11 15:48:34 +0200325=item B<--to-tar>
326
327Only valid for the C<archive> command.
328
329Writes the output into a tar archive.
330
331
Akron5c71a852016-10-31 16:00:33 +0100332=item B<--sigle|-sg>
333
334Extract the given texts.
335Can be set multiple times.
336I<Currently only supported on C<extract>.>
337Sigles have the structure C<Corpus>/C<Document>/C<Text>.
338In case the C<Text> path is omitted, the whole document will be extracted.
339On the document level, the postfix wildcard C<*> is supported.
340
Akron55fc2122022-07-27 13:24:39 +0200341=item B<--lang>
342
343Preferred language for metadata fields. In case multiple titles are
344given (on any level) with different C<xml:lang> attributes,
345the language given is preferred.
346Because titles may have different sources and different priorities,
347non-specific language titles may still be preferred in case the title
348source has a higher priority.
349
Akronf73ffb62018-06-27 12:13:59 +0200350
Akron5c71a852016-10-31 16:00:33 +0100351=item B<--log|-l>
352
Akron6882d7d2021-02-08 09:43:57 +0100353The L<Log::Any> log level, defaults to C<ERROR>.
Akron5c71a852016-10-31 16:00:33 +0100354
Akronf73ffb62018-06-27 12:13:59 +0200355
Akrona3518372024-01-22 23:29:00 +0100356=item B<--quiet>
357
358Silence all information (non-log) outputs.
359
360
Akron5c71a852016-10-31 16:00:33 +0100361=item B<--help|-h>
362
Akron42f48c12020-02-14 13:08:13 +0100363Print help information.
Akron5c71a852016-10-31 16:00:33 +0100364
Akronf73ffb62018-06-27 12:13:59 +0200365
Akron5c71a852016-10-31 16:00:33 +0100366=item B<--version|-v>
367
368Print version information.
369
370=back
371
Akron311e29b2024-09-11 11:46:09 +0200372=head1 PERFORMANCE
373
374There are some ways to improve performance for large tasks:
375
376=item First unpack
377
378Using the archive or serial command on one or multiple zip files
379can be very slow, as it needs to unpack small portions every time.
380It's better to use C<--temporary-extract> to unpack the whole archive
381first into a temprary directory and then read the extracted files.
382This is especially important for remote archives
383
384=item Limit annotations
385
386Per default, all supported annotation layers are sought. This can be limited
387by adding C<--skip '#ALL'> and only listing the expected annotations with C<--anno>.
388
389=item Checking the parallel job count
390
391By providing the number of parallel jobs using C<--jobs>, the execution can be tailored to specific
392hardware environments.
393
Akronf73ffb62018-06-27 12:13:59 +0200394
Akron5c71a852016-10-31 16:00:33 +0100395=head1 ANNOTATION SUPPORT
396
397L<KorAP::XML::Krill> has built-in importer for some annotation foundries and layers
398developed in the KorAP project that are part of the KorAP preprocessing pipeline.
399The base foundry with paragraphs, sentences, and the text element are mandatory for
400L<Krill|https://github.com/KorAP/Krill>.
401
Akron821db3d2017-04-06 21:19:31 +0200402 Base
403 #Paragraphs
404 #Sentences
Akron5c71a852016-10-31 16:00:33 +0100405
Akron821db3d2017-04-06 21:19:31 +0200406 Connexor
407 #Morpho
408 #Phrase
409 #Sentences
410 #Syntax
Akron5c71a852016-10-31 16:00:33 +0100411
Akron821db3d2017-04-06 21:19:31 +0200412 CoreNLP
413 #Constituency
414 #Morpho
415 #NamedEntities
416 #Sentences
Akron5c71a852016-10-31 16:00:33 +0100417
Akron5530a552022-02-17 17:53:15 +0100418 CorpusExplorer
419 #Morpho
420
Akronf73ffb62018-06-27 12:13:59 +0200421 CMC
422 #Morpho
423
Akron821db3d2017-04-06 21:19:31 +0200424 DeReKo
425 #Structure
Akron5c71a852016-10-31 16:00:33 +0100426
Akron57510c12019-01-04 14:58:53 +0100427 DGD
428 #Morpho
Akronc29b8e12019-12-16 14:28:09 +0100429 #Structure
Akron57510c12019-01-04 14:58:53 +0100430
Akron821db3d2017-04-06 21:19:31 +0200431 DRuKoLa
432 #Morpho
Akron5c71a852016-10-31 16:00:33 +0100433
Akron9f37ed72022-01-17 12:10:08 +0100434 Glemm
Akronabb36902021-10-11 15:51:06 +0200435 #Morpho
436
Akron9f37ed72022-01-17 12:10:08 +0100437 Gingko
Akron821db3d2017-04-06 21:19:31 +0200438 #Morpho
Akron5c71a852016-10-31 16:00:33 +0100439
Akroned9baf02019-01-22 17:03:25 +0100440 HNC
441 #Morpho
442
Akronf73ffb62018-06-27 12:13:59 +0200443 LWC
444 #Dependency
445
Akron821db3d2017-04-06 21:19:31 +0200446 Malt
447 #Dependency
Akron5c71a852016-10-31 16:00:33 +0100448
Akron821db3d2017-04-06 21:19:31 +0200449 MarMoT
450 #Morpho
Akron5c71a852016-10-31 16:00:33 +0100451
Akron821db3d2017-04-06 21:19:31 +0200452 Mate
453 #Dependency
454 #Morpho
Akron5c71a852016-10-31 16:00:33 +0100455
Akron821db3d2017-04-06 21:19:31 +0200456 MDParser
457 #Dependency
Akron5c71a852016-10-31 16:00:33 +0100458
Akrone85a7762022-07-22 08:05:03 +0200459 NKJP
460 #Morpho
461 #NamedEntities
462
Akron821db3d2017-04-06 21:19:31 +0200463 OpenNLP
464 #Morpho
465 #Sentences
Akron5c71a852016-10-31 16:00:33 +0100466
Akron0b04b312020-10-30 17:39:18 +0100467 RWK
468 #Morpho
469 #Structure
470
Akron821db3d2017-04-06 21:19:31 +0200471 Sgbr
472 #Lemma
473 #Morpho
Akron5c71a852016-10-31 16:00:33 +0100474
Marc Kupietzb8c53822024-03-16 18:54:08 +0100475 Spacy
476 #Morpho
477
Akron7d5e6382019-08-08 16:36:27 +0200478 Talismane
479 #Dependency
480 #Morpho
481
Akron821db3d2017-04-06 21:19:31 +0200482 TreeTagger
483 #Morpho
484 #Sentences
Akron5c71a852016-10-31 16:00:33 +0100485
Akron83aedd32023-02-07 10:57:41 +0100486 UDPipe
487 #Dependency
488 #Morpho
489
Akron821db3d2017-04-06 21:19:31 +0200490 XIP
491 #Constituency
492 #Morpho
493 #Sentences
Akron5c71a852016-10-31 16:00:33 +0100494
Akron5c71a852016-10-31 16:00:33 +0100495
496More importers are in preparation.
497New annotation importers can be defined in the C<KorAP::XML::Annotation> namespace.
498See the built-in annotation importers as examples.
Akronc13a1702016-03-15 19:33:14 +0100499
Akronf73ffb62018-06-27 12:13:59 +0200500
Akron41e6c8b2021-10-14 20:22:18 +0200501=head1 METADATA SUPPORT
502
503L<KorAP::XML::Krill> has built-in importer for some meta data variants
Akron4b001ce2024-06-06 12:32:11 +0200504that are part of the KorAP preprocessing pipeline.
Akron41e6c8b2021-10-14 20:22:18 +0200505
506=over 2
507
Akron1d101492024-06-06 12:47:35 +0200508=item B<I5>
Akron41e6c8b2021-10-14 20:22:18 +0200509
Akron1d101492024-06-06 12:47:35 +0200510Meta data for all I5 files
Akron41e6c8b2021-10-14 20:22:18 +0200511
Akron1d101492024-06-06 12:47:35 +0200512=item B<Sgbr>
Akron41e6c8b2021-10-14 20:22:18 +0200513
Akron1d101492024-06-06 12:47:35 +0200514Meta data from the Schreibgebrauch project
Akron2532f1b2023-05-15 13:41:24 +0200515
Akron1d101492024-06-06 12:47:35 +0200516=item B<Gingko>
517
518Meta data from the Gingko project in addition to I5
519
520=item B<ICC>
521
522Meta data for the ICC in addition to I5
523
524=item B<NKJP>
525
526Meta data for the NKJP corpora
Akron24ad3c02024-06-03 12:38:20 +0200527
Akron41e6c8b2021-10-14 20:22:18 +0200528=back
529
Akron41e6c8b2021-10-14 20:22:18 +0200530New meta data importers can be defined in the C<KorAP::XML::Meta> namespace.
531See the built-in meta data importers as examples.
532
Akron4b001ce2024-06-06 12:32:11 +0200533The I5 metadata definition is based on TEI-P5 and supports C<E<lt>xenoDataE<gt>>
Akron82064bb2024-06-17 12:53:23 +0200534with C<E<lt>metaE<gt>> elements like
Akron4b001ce2024-06-06 12:32:11 +0200535
536 <meta type="..." name="..." project="..." desc="...">...</meta>
537
538that are directly translated to Krill objects. The supported values are:
539
540=over 2
541
Akron1d101492024-06-06 12:47:35 +0200542=item C<type>
Akron4b001ce2024-06-06 12:32:11 +0200543
544=over 4
545
Akron1d101492024-06-06 12:47:35 +0200546=item C<string>
Akron4b001ce2024-06-06 12:32:11 +0200547
Akron1d101492024-06-06 12:47:35 +0200548String meta data value
Akron4b001ce2024-06-06 12:32:11 +0200549
Akron1d101492024-06-06 12:47:35 +0200550=item C<keyword>
Akron4b001ce2024-06-06 12:32:11 +0200551
Akrondee3cf62024-06-14 18:14:48 +0200552String meta data value that can be given multiple times
Akron4b001ce2024-06-06 12:32:11 +0200553
Akron1d101492024-06-06 12:47:35 +0200554=item C<text>
Akron4b001ce2024-06-06 12:32:11 +0200555
Akrondee3cf62024-06-14 18:14:48 +0200556String meta data value that is tokenized and can be searched as token sequences
Akron4b001ce2024-06-06 12:32:11 +0200557
Akron1d101492024-06-06 12:47:35 +0200558=item C<date>
559
560Date meta data value (as "yyyy/mm/dd" with optional granularity)
561
562=item C<integer>
563
564Numerical meta data value
565
Akrondee3cf62024-06-14 18:14:48 +0200566=item C<attachment>
Akron1d101492024-06-06 12:47:35 +0200567
568Non-indexed meta data value (only retrievable)
569
570=item C<uri>
571
572Non-indexed attached URI, takes the desc as the title for links
Akron4b001ce2024-06-06 12:32:11 +0200573
574=back
575
Akron1d101492024-06-06 12:47:35 +0200576=item C<name>
Akron4b001ce2024-06-06 12:32:11 +0200577
Akrondee3cf62024-06-14 18:14:48 +0200578The key of the meta object that may be prefixed by C<corpus> or C<doc>, in case the
Akron693f5882024-06-06 12:52:39 +0200579C<E<lt>xenoDataE<gt>> information is located on these levels. The text level introduces
580no prefixes.
Akron4b001ce2024-06-06 12:32:11 +0200581
Akron1d101492024-06-06 12:47:35 +0200582=item C<project> (optional)
Akron4b001ce2024-06-06 12:32:11 +0200583
Akron1d101492024-06-06 12:47:35 +0200584A prefixed namespace of the key
585
586=item C<desc> (optional)
587
588A description of the key
589
590=item text content
591
592The value of the meta object
Akron4b001ce2024-06-06 12:32:11 +0200593
594=back
595
Akron41e6c8b2021-10-14 20:22:18 +0200596
Akron8f69d632020-01-15 16:58:11 +0100597=head1 About KorAP-XML
598
Akrona3518372024-01-22 23:29:00 +0100599KorAP-XML (Bański et al. 2012) is an implementation of the KorAP
600data model (Bański et al. 2013), where text data are stored physically
Akron8f69d632020-01-15 16:58:11 +0100601separated from their interpretations (i.e. annotations).
602A text document in KorAP-XML therefore consists of several files
603containing primary data, metadata and annotations.
604
605The structure of a single KorAP-XML document can be as follows:
606
607 - data.xml
608 - header.xml
609 + base
610 - tokens.xml
611 - ...
612 + struct
613 - structure.xml
614 - ...
615 + corenlp
616 - morpho.xml
617 - constituency.xml
618 - ...
619 + tree_tagger
620 - morpho.xml
621 - ...
622 - ...
623
624The C<data.xml> contains the primary data, the C<header.xml> contains
625the metadata, and the annotation layers are stored in subfolders
626like C<base>, C<struct> or C<corenlp>
Akrona3518372024-01-22 23:29:00 +0100627(so-called "foundries"; Bański et al. 2013).
Akron8f69d632020-01-15 16:58:11 +0100628
629Metadata is available in the TEI-P5 variant I5
Akrond4c5c102020-02-11 11:47:59 +0100630(Lüngen and Sperberg-McQueen 2012). See the documentation in
631L<KorAP::XML::Meta::I5> for translatable fields.
632
633Annotations correspond to a variant of the TEI-P5 feature structures
634(TEI Consortium; Lee et al. 2004).
Akron72bc5222020-02-06 16:00:13 +0100635Annotation feature structures refer to character sequences of the primary text
636inside the C<text> element of the C<data.xml>.
637A single annotation containing the lemma of a token can have the following structure:
638
639 <span from="0" to="3">
640 <fs type="lex" xmlns="http://www.tei-c.org/ns/1.0">
641 <f name="lex">
642 <fs>
643 <f name="lemma">zum</f>
644 </fs>
645 </f>
646 </fs>
647 </span>
648
649The C<from> and C<to> attributes are refering to the character span
650in the primary text.
651Depending on the kind of annotation (e.g. token-based, span-based, relation-based),
652the structure may vary. See L<KorAP::XML::Annotation::*> for various
653annotation preprocessors.
Akron8f69d632020-01-15 16:58:11 +0100654
655Multiple KorAP-XML documents are organized on three levels following
656the "IDS Textmodell" (Lüngen and Sperberg-McQueen 2012):
657corpus E<gt> document E<gt> text. On each level metadata information
658can be stored, that C<korapxml2krill> will merge to a single metadata
659object per text. A corpus is therefore structured as follows:
660
661 + <corpus>
662 - header.xml
663 + <document>
664 - header.xml
665 + <text>
666 - data.xml
667 - header.xml
668 - ...
669 - ...
670
671A single text can be identified by the concatenation of
672the corpus identifier, the document identifier and the text identifier.
673This identifier is called the text sigle
674(e.g. a text with the identifier C<18486> in the document C<060> in the
675corpus C<WPD17> has the text sigle C<WPD17/060/18486>, see C<--sigle>).
676
677These corpora are often stored in zip files, with which C<korapxml2krill>
678can deal with. Corpora may also be split in multiple zip archives
679(e.g. one zip file per foundry), which is also supported (see C<--input>).
680
681Examples for KorAP-XML files are included in L<KorAP::XML::Krill>
682in form of a test suite.
683The resulting JSON format merges all annotation layers
684based on a single token stream.
685
686=head2 References
687
Akrona3518372024-01-22 23:29:00 +0100688Piotr Bański, Cyril Belica, Helge Krause, Marc Kupietz, Carsten Schnober, Oliver Schonefeld, and Andreas Witt (2011):
Akron8f69d632020-01-15 16:58:11 +0100689KorAP data model: first approximation, December.
690
Akrona3518372024-01-22 23:29:00 +0100691Piotr Bański, Peter M. Fischer, Elena Frick, Erik Ketzan, Marc Kupietz, Carsten Schnober, Oliver Schonefeld and Andreas Witt (2012):
Akron8f69d632020-01-15 16:58:11 +0100692"The New IDS Corpus Analysis Platform: Challenges and Prospects",
693Proceedings of the Eighth International Conference on Language Resources and Evaluation (LREC 2012).
694L<PDF|http://www.lrec-conf.org/proceedings/lrec2012/pdf/789_Paper.pdf>
695
Akrona3518372024-01-22 23:29:00 +0100696Piotr Bański, Elena Frick, Michael Hanl, Marc Kupietz, Carsten Schnober and Andreas Witt (2013):
Akron8f69d632020-01-15 16:58:11 +0100697"Robust corpus architecture: a new look at virtual collections and data access",
698Corpus Linguistics 2013. Abstract Book. Lancaster: UCREL, pp. 23-25.
699L<PDF|https://ids-pub.bsz-bw.de/frontdoor/deliver/index/docId/4485/file/Ba%c5%84ski_Frick_Hanl_Robust_corpus_architecture_2013.pdf>
700
701Kiyong Lee, Lou Burnard, Laurent Romary, Eric de la Clergerie, Thierry Declerck,
702Syd Bauman, Harry Bunt, Lionel Clément, Tomaz Erjavec, Azim Roussanaly and Claude Roux (2004):
703"Towards an international standard on featurestructure representation",
704Proceedings of the fourth International Conference on Language Resources and Evaluation (LREC 2004),
705pp. 373-376.
706L<PDF|http://www.lrec-conf.org/proceedings/lrec2004/pdf/687.pdf>
707
708Harald Lüngen and C. M. Sperberg-McQueen (2012):
709"A TEI P5 Document Grammar for the IDS Text Model",
710Journal of the Text Encoding Initiative, Issue 3 | November 2012.
711L<PDF|https://journals.openedition.org/jtei/pdf/508>
712
713TEI Consortium, eds:
714"Feature Structures",
715Guidelines for Electronic Text Encoding and Interchange.
716L<html|https://www.tei-c.org/release/doc/tei-p5-doc/en/html/FS.html>
717
Akronc13a1702016-03-15 19:33:14 +0100718=head1 AVAILABILITY
719
720 https://github.com/KorAP/KorAP-XML-Krill
721
722
723=head1 COPYRIGHT AND LICENSE
724
Akrona3518372024-01-22 23:29:00 +0100725Copyright (C) 2015-2024, L<IDS Mannheim|https://www.ids-mannheim.de/>
Akronc13a1702016-03-15 19:33:14 +0100726
Akron6882d7d2021-02-08 09:43:57 +0100727Author: L<Nils Diewald|https://www.nils-diewald.de/>
Akron81500102017-04-07 20:45:44 +0200728
Marc Kupietzb8c53822024-03-16 18:54:08 +0100729Contributor: Eliza Margaretha, Marc Kupietz
Akron5c71a852016-10-31 16:00:33 +0100730
Akron6882d7d2021-02-08 09:43:57 +0100731L<KorAP::XML::Krill> is developed as part of the L<KorAP|https://korap.ids-mannheim.de/>
Akronc13a1702016-03-15 19:33:14 +0100732Corpus Analysis Platform at the
Akron6882d7d2021-02-08 09:43:57 +0100733L<Leibniz Institute for the German Language (IDS)|https://www.ids-mannheim.de/>,
Akronc13a1702016-03-15 19:33:14 +0100734member of the
Akronf1849aa2019-12-16 23:35:33 +0100735L<Leibniz-Gemeinschaft|http://www.leibniz-gemeinschaft.de/>.
Akronc13a1702016-03-15 19:33:14 +0100736
Akron5c71a852016-10-31 16:00:33 +0100737This program is free software published under the
Akron6882d7d2021-02-08 09:43:57 +0100738L<BSD-2 License|https://opensource.org/licenses/BSD-2-Clause>.
Akronc13a1702016-03-15 19:33:14 +0100739
740=cut