line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Catmandu::Store::VIAF; |
2
|
|
|
|
|
|
|
|
3
|
2
|
|
|
2
|
|
229807
|
use Catmandu::Sane; |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
13
|
|
4
|
2
|
|
|
2
|
|
857
|
use Moo; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
9
|
|
5
|
|
|
|
|
|
|
|
6
|
2
|
|
|
2
|
|
1062
|
use Catmandu::Store::VIAF::Bag; |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
with 'Catmandu::Store'; |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
has lang => (is => 'ro', default => 'nl-NL'); |
11
|
|
|
|
|
|
|
has fallback_lang => (is => 'ro', default => 'en-US'); |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
1; |
14
|
|
|
|
|
|
|
__END__ |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
=encoding utf-8 |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
=head1 NAME |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
=for html <a href="https://travis-ci.org/thedatahub/Catmandu-VIAF"><img src="https://travis-ci.org/thedatahub/Catmandu-VIAF.svg?branch=master"></a> |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
Catmandu::Store::VIAF - Retrieve items from VIAF |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
=head1 SYNOPSIS |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
This module contains a L<store|Catmandu::Store::VIAF> to lookup a I<viaf_id> in L<VIAF|https://www.viaf.org>. |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
lookup_in_store(authortName, VIAF, lang:'nl-NL', fallback_lang:'en-US') |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
=head1 DESCRIPTION |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
lookup_in_store( |
33
|
|
|
|
|
|
|
authorName, |
34
|
|
|
|
|
|
|
AAT, |
35
|
|
|
|
|
|
|
lang: 'nl-NL', |
36
|
|
|
|
|
|
|
fallback_lang: 'en-US' |
37
|
|
|
|
|
|
|
) |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
The C<lang> parameter is optional and defaults to I<nl-NL>. It sets |
40
|
|
|
|
|
|
|
the language of the returned I<prefLabel>. If no I<prefLabel> for the |
41
|
|
|
|
|
|
|
I<viaf_id> in provided I<lang> exists, the I<prefLabel> for the |
42
|
|
|
|
|
|
|
I<fallback_lang> is used. |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
The store takes the C<dc:identifier> of a I<Person> from VIAF and returns the following data: |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
{ |
47
|
|
|
|
|
|
|
'dcterms:identifier' => 'The identifier', |
48
|
|
|
|
|
|
|
'guid' => 'The VIAF URL', |
49
|
|
|
|
|
|
|
'schema:birthDate' => 'Birth date, if provided', |
50
|
|
|
|
|
|
|
'schema:deathDate' => 'Death date, if provided', |
51
|
|
|
|
|
|
|
'schema:description' => 'Description, if provided', |
52
|
|
|
|
|
|
|
'skos:prefLabel' => 'prefLabel, in lang or fallback_lang' |
53
|
|
|
|
|
|
|
} |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
=head2 PARAMETERS |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
=head3 Optional parameters |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
=over |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
=item C<lang> |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
Language of the returned C<skos:prefLabel>. Falls back to |
64
|
|
|
|
|
|
|
C<fallback_lang> if none was found. Use L<IETF language tags|https://en.wikipedia.org/wiki/IETF_language_tag>. |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
=item C<fallback_lang> |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
Fallback language. |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
=back |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
=head1 AUTHOR |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
Pieter De Praetere E<lt>pieter at packed.be E<gt> |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
=head1 COPYRIGHT |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
Copyright 2017- PACKED vzw |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
=head1 LICENSE |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
This library is free software; you can redistribute it and/or modify |
83
|
|
|
|
|
|
|
it under the same terms as Perl itself. |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
=head1 SEE ALSO |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
L<Catmandu> |
88
|
|
|
|
|
|
|
L<Catmandu::VIAF> |
89
|
|
|
|
|
|
|
L<Catmandu::Fix::viaf_search> |
90
|
|
|
|
|
|
|
L<Catmandu::Fix::viaf_match> |
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
=cut |