line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package RDF::SKOS::Concept; |
2
|
|
|
|
|
|
|
|
3
|
5
|
|
|
5
|
|
26
|
use strict; |
|
5
|
|
|
|
|
8
|
|
|
5
|
|
|
|
|
166
|
|
4
|
5
|
|
|
5
|
|
35
|
use warnings; |
|
5
|
|
|
|
|
10
|
|
|
5
|
|
|
|
|
4049
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
=head1 NAME |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
RDF::SKOS::Concept - SKOS - Concept Class |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
=head1 SYNOPSIS |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
use RDF::SKOS; |
13
|
|
|
|
|
|
|
my $skos = new RDF::SKOS; |
14
|
|
|
|
|
|
|
my $c = $skos->concept ('aaa'); |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
@labels = $c->prefLabels; |
17
|
|
|
|
|
|
|
# see RDF::SKOS for other concept related methods |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
=head1 DESCRIPTION |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
This class is simply a container for SKOS concepts. Usually, these |
22
|
|
|
|
|
|
|
concepts have various labels, descriptions, etc. And they can be |
23
|
|
|
|
|
|
|
related, generally, or more specifically with a I, |
24
|
|
|
|
|
|
|
I relationship. |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
This class simply gives access to this information. At the moment this |
27
|
|
|
|
|
|
|
is all read only, except the constructor maybe. |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
=head1 INTERFACE |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
=head2 Constructor |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
The constructor expects as first parameter the SKOS object itself, then the ID of the concept. What |
34
|
|
|
|
|
|
|
follows then is a hash reference containing the concept information, such as I, |
35
|
|
|
|
|
|
|
I etc. This information is added in the same way as described in L, namely as |
36
|
|
|
|
|
|
|
list (reference) to tuples. The tuples containing the label itself, then the language tag. |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
=cut |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
sub new { |
41
|
3430
|
|
|
3430
|
0
|
3761
|
my $class = shift; |
42
|
3430
|
|
|
|
|
3436
|
my $skos = shift; |
43
|
3430
|
|
|
|
|
4348
|
my $cid = shift; |
44
|
3430
|
|
|
|
|
16816
|
return bless { @_, skos => $skos, id => $cid }, $class; |
45
|
|
|
|
|
|
|
} |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
=pod |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
=head2 Methods |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
All these methods are effectively passing on onto the underlying L object. Labels |
52
|
|
|
|
|
|
|
are always lists of tuples. |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
=over |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
=item B |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
I<@ls> = I<$c>->prefLabels |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
=cut |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
sub prefLabels { |
63
|
1699
|
|
|
1699
|
1
|
847585
|
my $self = shift; |
64
|
1699
|
|
|
|
|
3054
|
my $skos = $self->{skos}; |
65
|
1699
|
|
|
|
|
14854
|
return $skos->prefLabels ($self->{id}); |
66
|
|
|
|
|
|
|
} |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
=pod |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
=item B |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
I<@ls> = I<$c>->altLabels |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
=cut |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
sub altLabels { |
77
|
1698
|
|
|
1698
|
1
|
1641864
|
my $self = shift; |
78
|
1698
|
|
|
|
|
3258
|
my $skos = $self->{skos}; |
79
|
1698
|
|
|
|
|
6779
|
return $skos->altLabels ($self->{id}); |
80
|
|
|
|
|
|
|
} |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
=pod |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
=item B |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
I<@ls> = I<$c>->hiddenLabels |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
=cut |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
sub hiddenLabels { |
91
|
1698
|
|
|
1698
|
1
|
3089
|
my $self = shift; |
92
|
1698
|
|
|
|
|
2595
|
my $skos = $self->{skos}; |
93
|
1698
|
|
|
|
|
15537
|
return $skos->hiddenLabels ($self->{id}); |
94
|
|
|
|
|
|
|
} |
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
=pod |
97
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
=item B |
99
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
I<@ls> = I<$c>->scopeNotes |
101
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
=cut |
103
|
|
|
|
|
|
|
|
104
|
|
|
|
|
|
|
sub scopeNotes { |
105
|
1
|
|
|
1
|
1
|
5
|
my $self = shift; |
106
|
1
|
|
|
|
|
4
|
my $skos = $self->{skos}; |
107
|
1
|
|
|
|
|
9
|
return $skos->scopeNotes ($self->{id}); |
108
|
|
|
|
|
|
|
} |
109
|
|
|
|
|
|
|
|
110
|
|
|
|
|
|
|
=pod |
111
|
|
|
|
|
|
|
|
112
|
|
|
|
|
|
|
=item B |
113
|
|
|
|
|
|
|
|
114
|
|
|
|
|
|
|
I<@ls> = I<$c>->notes |
115
|
|
|
|
|
|
|
|
116
|
|
|
|
|
|
|
=cut |
117
|
|
|
|
|
|
|
|
118
|
|
|
|
|
|
|
sub notes { |
119
|
1
|
|
|
1
|
1
|
4
|
my $self = shift; |
120
|
1
|
|
|
|
|
3
|
my $skos = $self->{skos}; |
121
|
1
|
|
|
|
|
7
|
return $skos->notes ($self->{id}); |
122
|
|
|
|
|
|
|
} |
123
|
|
|
|
|
|
|
|
124
|
|
|
|
|
|
|
=pod |
125
|
|
|
|
|
|
|
|
126
|
|
|
|
|
|
|
=item B |
127
|
|
|
|
|
|
|
|
128
|
|
|
|
|
|
|
I<@ls> = I<$c>->definitions |
129
|
|
|
|
|
|
|
|
130
|
|
|
|
|
|
|
=cut |
131
|
|
|
|
|
|
|
|
132
|
|
|
|
|
|
|
sub definitions { |
133
|
1
|
|
|
1
|
1
|
3
|
my $self = shift; |
134
|
1
|
|
|
|
|
3
|
my $skos = $self->{skos}; |
135
|
1
|
|
|
|
|
6
|
return $skos->definitions ($self->{id}); |
136
|
|
|
|
|
|
|
} |
137
|
|
|
|
|
|
|
|
138
|
|
|
|
|
|
|
=pod |
139
|
|
|
|
|
|
|
|
140
|
|
|
|
|
|
|
=item B |
141
|
|
|
|
|
|
|
|
142
|
|
|
|
|
|
|
I<@ls> = I<$c>->examples |
143
|
|
|
|
|
|
|
|
144
|
|
|
|
|
|
|
=cut |
145
|
|
|
|
|
|
|
|
146
|
|
|
|
|
|
|
sub examples { |
147
|
1
|
|
|
1
|
1
|
3
|
my $self = shift; |
148
|
1
|
|
|
|
|
2
|
my $skos = $self->{skos}; |
149
|
1
|
|
|
|
|
6
|
return $skos->examples ($self->{id}); |
150
|
|
|
|
|
|
|
} |
151
|
|
|
|
|
|
|
|
152
|
|
|
|
|
|
|
=pod |
153
|
|
|
|
|
|
|
|
154
|
|
|
|
|
|
|
=item B |
155
|
|
|
|
|
|
|
|
156
|
|
|
|
|
|
|
I<@ls> = I<$c>->historyNotes |
157
|
|
|
|
|
|
|
|
158
|
|
|
|
|
|
|
=cut |
159
|
|
|
|
|
|
|
|
160
|
|
|
|
|
|
|
sub historyNotes { |
161
|
1
|
|
|
1
|
1
|
3
|
my $self = shift; |
162
|
1
|
|
|
|
|
2
|
my $skos = $self->{skos}; |
163
|
1
|
|
|
|
|
7
|
return $skos->historyNotes ($self->{id}); |
164
|
|
|
|
|
|
|
} |
165
|
|
|
|
|
|
|
|
166
|
|
|
|
|
|
|
=pod |
167
|
|
|
|
|
|
|
|
168
|
|
|
|
|
|
|
=item B |
169
|
|
|
|
|
|
|
|
170
|
|
|
|
|
|
|
I<@ls> = I<$c>->editorialNotes |
171
|
|
|
|
|
|
|
|
172
|
|
|
|
|
|
|
=cut |
173
|
|
|
|
|
|
|
|
174
|
|
|
|
|
|
|
sub editorialNotes { |
175
|
1
|
|
|
1
|
1
|
3
|
my $self = shift; |
176
|
1
|
|
|
|
|
3
|
my $skos = $self->{skos}; |
177
|
1
|
|
|
|
|
6
|
return $skos->editorialNotes ($self->{id}); |
178
|
|
|
|
|
|
|
} |
179
|
|
|
|
|
|
|
|
180
|
|
|
|
|
|
|
=pod |
181
|
|
|
|
|
|
|
|
182
|
|
|
|
|
|
|
=item B |
183
|
|
|
|
|
|
|
|
184
|
|
|
|
|
|
|
I<@ls> = I<$c>->changeNotes |
185
|
|
|
|
|
|
|
|
186
|
|
|
|
|
|
|
=cut |
187
|
|
|
|
|
|
|
|
188
|
|
|
|
|
|
|
sub changeNotes { |
189
|
1
|
|
|
1
|
1
|
11
|
my $self = shift; |
190
|
1
|
|
|
|
|
12
|
my $skos = $self->{skos}; |
191
|
1
|
|
|
|
|
6
|
return $skos->changeNotes ($self->{id}); |
192
|
|
|
|
|
|
|
} |
193
|
|
|
|
|
|
|
|
194
|
|
|
|
|
|
|
=pod |
195
|
|
|
|
|
|
|
|
196
|
|
|
|
|
|
|
=item B |
197
|
|
|
|
|
|
|
|
198
|
|
|
|
|
|
|
I<@cs> = I<$c>->narrower |
199
|
|
|
|
|
|
|
|
200
|
|
|
|
|
|
|
=cut |
201
|
|
|
|
|
|
|
|
202
|
|
|
|
|
|
|
sub narrower { |
203
|
5
|
|
|
5
|
1
|
14
|
my $self = shift; |
204
|
5
|
|
|
|
|
21
|
return $self->{skos}->narrower ($self->{id}); |
205
|
|
|
|
|
|
|
} |
206
|
|
|
|
|
|
|
|
207
|
|
|
|
|
|
|
=pod |
208
|
|
|
|
|
|
|
|
209
|
|
|
|
|
|
|
=item B |
210
|
|
|
|
|
|
|
|
211
|
|
|
|
|
|
|
I<@cs> = I<$c>->narrowerTransitive |
212
|
|
|
|
|
|
|
|
213
|
|
|
|
|
|
|
=cut |
214
|
|
|
|
|
|
|
|
215
|
|
|
|
|
|
|
sub narrowerTransitive { |
216
|
1
|
|
|
1
|
1
|
2
|
my $self = shift; |
217
|
1
|
|
|
|
|
8
|
return $self->{skos}->narrowerTransitive ($self->{id}); |
218
|
|
|
|
|
|
|
} |
219
|
|
|
|
|
|
|
|
220
|
|
|
|
|
|
|
=pod |
221
|
|
|
|
|
|
|
|
222
|
|
|
|
|
|
|
=item B |
223
|
|
|
|
|
|
|
|
224
|
|
|
|
|
|
|
I<@cs> = I<$c>->broader |
225
|
|
|
|
|
|
|
|
226
|
|
|
|
|
|
|
=cut |
227
|
|
|
|
|
|
|
|
228
|
|
|
|
|
|
|
sub broader { |
229
|
6
|
|
|
6
|
1
|
10
|
my $self = shift; |
230
|
6
|
|
|
|
|
60
|
return $self->{skos}->broader ($self->{id}); |
231
|
|
|
|
|
|
|
} |
232
|
|
|
|
|
|
|
|
233
|
|
|
|
|
|
|
=pod |
234
|
|
|
|
|
|
|
|
235
|
|
|
|
|
|
|
=item B |
236
|
|
|
|
|
|
|
|
237
|
|
|
|
|
|
|
I<@cs> = I<$c>->broaderTransitive |
238
|
|
|
|
|
|
|
|
239
|
|
|
|
|
|
|
=cut |
240
|
|
|
|
|
|
|
|
241
|
|
|
|
|
|
|
sub broaderTransitive { |
242
|
1
|
|
|
1
|
1
|
3
|
my $self = shift; |
243
|
1
|
|
|
|
|
7
|
return $self->{skos}->broaderTransitive ($self->{id}); |
244
|
|
|
|
|
|
|
} |
245
|
|
|
|
|
|
|
|
246
|
|
|
|
|
|
|
=pod |
247
|
|
|
|
|
|
|
|
248
|
|
|
|
|
|
|
=item B |
249
|
|
|
|
|
|
|
|
250
|
|
|
|
|
|
|
I<@cs> = I<$c>->related |
251
|
|
|
|
|
|
|
|
252
|
|
|
|
|
|
|
=cut |
253
|
|
|
|
|
|
|
|
254
|
|
|
|
|
|
|
sub related { |
255
|
1697
|
|
|
1697
|
1
|
1151096
|
my $self = shift; |
256
|
1697
|
|
|
|
|
9526
|
return $self->{skos}->related ($self->{id}) |
257
|
|
|
|
|
|
|
} |
258
|
|
|
|
|
|
|
|
259
|
|
|
|
|
|
|
=pod |
260
|
|
|
|
|
|
|
|
261
|
|
|
|
|
|
|
=item B |
262
|
|
|
|
|
|
|
|
263
|
|
|
|
|
|
|
I<@cs> = I<$c>->relatedTransitive |
264
|
|
|
|
|
|
|
|
265
|
|
|
|
|
|
|
=cut |
266
|
|
|
|
|
|
|
|
267
|
|
|
|
|
|
|
sub relatedTransitive { |
268
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
269
|
0
|
|
|
|
|
|
return $self->{skos}->relatedTransitive ($self->{id}) |
270
|
|
|
|
|
|
|
} |
271
|
|
|
|
|
|
|
|
272
|
|
|
|
|
|
|
=pod |
273
|
|
|
|
|
|
|
|
274
|
|
|
|
|
|
|
=back |
275
|
|
|
|
|
|
|
|
276
|
|
|
|
|
|
|
=head1 AUTHOR |
277
|
|
|
|
|
|
|
|
278
|
|
|
|
|
|
|
Robert Barta, C<< >> |
279
|
|
|
|
|
|
|
|
280
|
|
|
|
|
|
|
=head1 BUGS |
281
|
|
|
|
|
|
|
|
282
|
|
|
|
|
|
|
Please report any bugs or feature requests to C, or through |
283
|
|
|
|
|
|
|
the web interface at L. I will be notified, and then you'll |
284
|
|
|
|
|
|
|
automatically be notified of progress on your bug as I make changes. |
285
|
|
|
|
|
|
|
|
286
|
|
|
|
|
|
|
=head1 COPYRIGHT & LICENSE |
287
|
|
|
|
|
|
|
|
288
|
|
|
|
|
|
|
Copyright 2009 Robert Barta, all rights reserved. |
289
|
|
|
|
|
|
|
|
290
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify it under the same terms as Perl |
291
|
|
|
|
|
|
|
itself. |
292
|
|
|
|
|
|
|
|
293
|
|
|
|
|
|
|
=cut |
294
|
|
|
|
|
|
|
|
295
|
|
|
|
|
|
|
our $VERSION = '0.01'; |
296
|
|
|
|
|
|
|
|
297
|
|
|
|
|
|
|
"against all odds"; |
298
|
|
|
|
|
|
|
|
299
|
|
|
|
|
|
|
__END__ |