Skip to content

Commit

Permalink
0.35
Browse files Browse the repository at this point in the history
  • Loading branch information
jorol committed Jan 29, 2018
1 parent 459f6f1 commit f990ef3
Show file tree
Hide file tree
Showing 20 changed files with 44 additions and 39 deletions.
2 changes: 1 addition & 1 deletion Build.PL
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# This Build.PL for PICA-Data was generated by Dist::Zilla::Plugin::ModuleBuildTiny 0.015.
# This Build.PL for PICA-Data-gbv was generated by Dist::Zilla::Plugin::ModuleBuildTiny 0.015.
use strict;
use warnings;

Expand Down
8 changes: 8 additions & 0 deletions Changes
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@ Revision history for PICA::Data

{{$NEXT}}

0.35 2018-01-29 16:29:52 CET
- add PICA::Schema
- add parsers and writers to documentation
- add Generic writer
- check if occurrence is defined
- add PICA::Writer::PPXML to documentation
- fix version number in cpanfile

0.34 2017-11-18 13:04:04 CET
- add dependencies to cpanfile
- use XML::Writer to generate XML files
Expand Down
10 changes: 5 additions & 5 deletions META.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@
"Jakob Vo\u00df"
],
"dynamic_config" : 0,
"generated_by" : "Dist::Milla version v1.0.18, Dist::Zilla version 6.010, CPAN::Meta::Converter version 2.150001",
"generated_by" : "Dist::Milla version v1.0.17, Dist::Zilla version 6.008, CPAN::Meta::Converter version 2.150001",
"license" : [
"perl_5"
],
"meta-spec" : {
"url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec",
"version" : 2
},
"name" : "PICA-Data",
"name" : "PICA-Data-gbv",
"no_index" : {
"directory" : [
"eg",
Expand All @@ -31,7 +31,7 @@
},
"develop" : {
"requires" : {
"Dist::Milla" : "v1.0.18",
"Dist::Milla" : "v1.0.17",
"Test::Pod" : "1.41"
}
},
Expand Down Expand Up @@ -71,7 +71,7 @@
"web" : "https://github.com/gbv/PICA-Data"
}
},
"version" : "0.34",
"version" : "0.35",
"x_contributors" : [
"Carsten Klee <carsten.klee@sbb.spk-berlin.de>",
"Carsten Klee <cKlee@users.noreply.github.com>",
Expand All @@ -80,6 +80,6 @@
"Johann Rolschewski <jorol@cpan.org>",
"Johann Rolschewski <rolschewski@gmail.com>"
],
"x_serialization_backend" : "Cpanel::JSON::XS version 3.0225"
"x_serialization_backend" : "Cpanel::JSON::XS version 3.0221"
}

31 changes: 14 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,8 @@ PICA::Data - PICA record processing
use PICA::Parser::XML;
use PICA::Writer::Plain;
use PICA::Schema;

$parser = PICA::Parser::XML->new( @options );
$writer = PICA::Writer::Plain->new( @options );
$schema = PICA::Schema->new({ fields => { '021A' => { unique => 1 } } });

# parse records
while ( my $record = $parser->next ) {
Expand Down Expand Up @@ -47,10 +44,6 @@ PICA::Data - PICA record processing
# stringify record
my $plain = $record->string;
my $xml = $record->string('xml');

# check 021A exists and is not repeated
my @errors = $schema->check($record, ignore_unknown_fields => 1);
...
}

# parse single record from string
Expand All @@ -68,11 +61,11 @@ Austauschformat fuer Bibliotheken (MAB). In addition to PICA+ in CBS there is
the cataloging format Pica3 which can losslessly be convert to PICA+ and vice
versa.

Records in PICA::Data are encoded either as array of arrays, the inner
arrays representing PICA fields, or as an object with two fields, `_id` and
`record`, the latter holding the record as array of arrays, and the former
holding the record identifier, stored in field `003@`, subfield `0`. For
instance a minimal record with just one field `003@`:
Records in PICA::Data are encoded either as array of arrays, the inner arrays
representing PICA fields, or as an object with two keys, `_id` and `record`,
the latter holding the record as array of arrays, and the former holding the
record identifier, stored in field `003@`, subfield `0`. For instance a
minimal record with just one field (having tag `003@` and no occurrence):

{
_id => '12345X',
Expand All @@ -86,7 +79,7 @@ or in short form:
[ [ '003@', undef, '0' => '12345X' ] ]

PICA path expressions (see [PICA::Path](https://metacpan.org/pod/PICA::Path)) can be used to facilitate processing
PICA+ records.
PICA+ records and [PICA::Schema](https://metacpan.org/pod/PICA::Schema) to validate PICA+ records.

# FUNCTIONS

Expand All @@ -98,8 +91,9 @@ get all of them):
Create a PICA parsers object (see [PICA::Parser::Base](https://metacpan.org/pod/PICA::Parser::Base)). Case of the type is
ignored and additional parameters are passed to the parser's constructor:

- [PICA::Parser::Plus](https://metacpan.org/pod/PICA::Parser::Plus) for type `plus` or `picaplus` (normalized PICA+)
- [PICA::Parser::Binary](https://metacpan.org/pod/PICA::Parser::Binary) for type `binary` (binary PICA+)
- [PICA::Parser::Plain](https://metacpan.org/pod/PICA::Parser::Plain) for type `plain` or `picaplain` (human-readable PICA+)
- [PICA::Parser::Plus](https://metacpan.org/pod/PICA::Parser::Plus) for type `plus` or `picaplus` (normalized PICA+)
- [PICA::Parser::XML](https://metacpan.org/pod/PICA::Parser::XML) for type `xml` or `picaxml` (PICA-XML)
- [PICA::Parser::PPXML](https://metacpan.org/pod/PICA::Parser::PPXML) for type `ppxml` (PicaPlus-XML)

Expand All @@ -113,9 +107,12 @@ blessed) PICA record structure.
Create a PICA writer object (see [PICA::Writer::Base](https://metacpan.org/pod/PICA::Writer::Base)) in the same way as
`pica_parser` with one of

- [PICA::Writer::XML](https://metacpan.org/pod/PICA::Writer::XML) for type `xml` or `picaxml` (PICA-XML)
- [PICA::Writer::Plus](https://metacpan.org/pod/PICA::Writer::Plus) for type `plus` or `picaplus` (normalized PICA+)
- [PICA::Writer::Binary](https://metacpan.org/pod/PICA::Writer::Binary) for type `binary` (binary PICA)
- [PICA::Writer::Generic](https://metacpan.org/pod/PICA::Writer::Generic) for type `generic` (PICA with self defined data separators)
- [PICA::Writer::Plain](https://metacpan.org/pod/PICA::Writer::Plain) for type `plain` or `picaplain` (human-readable PICA+)
- [PICA::Writer::Plus](https://metacpan.org/pod/PICA::Writer::Plus) for type `plus` or `picaplus` (normalized PICA+)
- [PICA::Writer::XML](https://metacpan.org/pod/PICA::Writer::XML) for type `xml` or `picaxml` (PICA-XML)
- [PICA::Writer::PPXML](https://metacpan.org/pod/PICA::Writer::PPXML) for type `ppxml` (PicaPlus-XML)

## pica\_path( $path )

Expand Down Expand Up @@ -170,7 +167,7 @@ Same as `values` but only returns the first value.

## fields( $path )

Returns a PICA record limited to fields specified in a [PICA::path](https://metacpan.org/pod/PICA::path)
Returns a PICA record limited to fields specified in a [PICA::Path](https://metacpan.org/pod/PICA::Path)
expression. Always returns an array reference.

## holdings
Expand Down
2 changes: 1 addition & 1 deletion lib/PICA/Data.pm
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package PICA::Data;
use strict;
use warnings;

our $VERSION = '0.34';
our $VERSION = '0.35';

use Exporter 'import';
our @EXPORT_OK = qw(pica_parser pica_writer pica_path pica_xml_struct
Expand Down
2 changes: 1 addition & 1 deletion lib/PICA/Parser/Base.pm
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package PICA::Parser::Base;
use strict;
use warnings;

our $VERSION = '0.34';
our $VERSION = '0.35';

use Carp qw(croak);

Expand Down
2 changes: 1 addition & 1 deletion lib/PICA/Parser/Binary.pm
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package PICA::Parser::Binary;
use strict;
use warnings;

our $VERSION = '0.34';
our $VERSION = '0.35';

use charnames qw(:full);
use Carp qw(croak);
Expand Down
2 changes: 1 addition & 1 deletion lib/PICA/Parser/PPXML.pm
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package PICA::Parser::PPXML;
use strict;
use warnings;

our $VERSION = '0.34';
our $VERSION = '0.35';

use parent 'PICA::Parser::XML';

Expand Down
2 changes: 1 addition & 1 deletion lib/PICA/Parser/Plain.pm
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package PICA::Parser::Plain;
use strict;
use warnings;

our $VERSION = '0.34';
our $VERSION = '0.35';

use charnames ':full';
use Carp qw(carp croak);
Expand Down
2 changes: 1 addition & 1 deletion lib/PICA/Parser/Plus.pm
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package PICA::Parser::Plus;
use strict;
use warnings;

our $VERSION = '0.34';
our $VERSION = '0.35';

use charnames qw(:full);
use Carp qw(carp croak);
Expand Down
2 changes: 1 addition & 1 deletion lib/PICA/Parser/XML.pm
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package PICA::Parser::XML;
use strict;
use warnings;

our $VERSION = '0.34';
our $VERSION = '0.35';

use Carp qw(croak);
use XML::LibXML::Reader;
Expand Down
2 changes: 1 addition & 1 deletion lib/PICA/Path.pm
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package PICA::Path;
use strict;
use warnings;

our $VERSION = '0.34';
our $VERSION = '0.35';

use Carp qw(confess);
use Scalar::Util qw(reftype);
Expand Down
2 changes: 1 addition & 1 deletion lib/PICA/Schema.pm
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package PICA::Schema;
use strict;
use warnings;

our $VERSION = '0.34';
our $VERSION = '0.35';

use Scalar::Util qw(reftype);

Expand Down
2 changes: 1 addition & 1 deletion lib/PICA/Writer/Base.pm
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package PICA::Writer::Base;
use strict;
use warnings;

our $VERSION = '0.34';
our $VERSION = '0.35';

use Scalar::Util qw(blessed openhandle reftype);
use Carp qw(croak);
Expand Down
2 changes: 1 addition & 1 deletion lib/PICA/Writer/Binary.pm
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package PICA::Writer::Binary;
use strict;
use warnings;

our $VERSION = '0.34';
our $VERSION = '0.35';

use charnames qw(:full);

Expand Down
2 changes: 1 addition & 1 deletion lib/PICA/Writer/Generic.pm
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package PICA::Writer::Generic;
use strict;
use warnings;

our $VERSION = '0.34';
our $VERSION = '0.35';

use charnames qw(:full);

Expand Down
2 changes: 1 addition & 1 deletion lib/PICA/Writer/PPXML.pm
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package PICA::Writer::PPXML;
use strict;
use warnings;

our $VERSION = '0.34';
our $VERSION = '0.35';

use Scalar::Util qw(reftype);
use XML::LibXML;
Expand Down
2 changes: 1 addition & 1 deletion lib/PICA/Writer/Plain.pm
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package PICA::Writer::Plain;
use strict;
use warnings;

our $VERSION = '0.34';
our $VERSION = '0.35';

use charnames qw(:full);

Expand Down
2 changes: 1 addition & 1 deletion lib/PICA/Writer/Plus.pm
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package PICA::Writer::Plus;
use strict;
use warnings;

our $VERSION = '0.34';
our $VERSION = '0.35';

use charnames qw(:full);

Expand Down
2 changes: 1 addition & 1 deletion lib/PICA/Writer/XML.pm
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package PICA::Writer::XML;
use strict;
use warnings;

our $VERSION = '0.34';
our $VERSION = '0.35';

use Scalar::Util qw(reftype);
use XML::Writer;
Expand Down

0 comments on commit f990ef3

Please sign in to comment.