File Coverage

blib/lib/SKOS/Simple.pm
Criterion Covered Total %
statement 220 303 72.6
branch 119 212 56.1
condition 53 104 50.9
subroutine 24 26 92.3
pod 18 18 100.0
total 434 663 65.4


line stmt bran cond sub pod time code
1             package SKOS::Simple;
2             {
3             $SKOS::Simple::VERSION = '0.09_01';
4             }
5             #ABSTRACT: Create simple SKOS data with entailment
6              
7 5     5   65924 use strict;
  5         13  
  5         212  
8 5     5   28 use warnings;
  5         11  
  5         171  
9              
10 5     5   31 use Scalar::Util qw(blessed reftype);
  5         25  
  5         532  
11 5     5   4500 use Turtle::Writer;
  5         5067  
  5         353  
12 5     5   32 use Carp;
  5         13  
  5         271  
13              
14             =head1 DESCRIPTION
15              
16             This module provides a simple class to create and handle classifications,
17             thesauri and similar systems in Simple Knowledge Organization System (SKOS)
18             data model. Most features of SKOS, as specified at
19             L, are supported. In addition there
20             are some useful constraints, which mostly derive from best-practice.
21              
22             In contrast to other RDF-related modules, SKOS::Simple does not depend on
23             any non-core Perl modules, so you can install it by just copying one file.
24             The module implements basic entailment rules of the SKOS standard without
25             the burden of a full RDF reasoning engine. Actually, you can use this
26             module without having to deal with any details of RDF.
27              
28             The current version of this class is optimized form creating and serializing
29             valid SKOS schemes, but not for reading and modifying them. A common use case
30             of SKOS::Simple is to transform a given terminology from some custom format
31             to SKOS, which is then L in Terse RDF
32             Triple language (Turtle). You can then publish the Turtle data and/or process
33             them with general RDF and SKOS tools.
34              
35             =head1 SYNOPSIS
36              
37             my $skos = SKOS::Simple->new(
38             base => 'http://example.com/kos/',
39             title => 'My little Knowledge Organization System',
40             hierarchy => 'tree' # check classification constraints
41             );
42              
43             $skos->addConcept( pref => { en => 'foo', ru => 'baz' } );
44             $skos->addConcept( notation => '42.X-23' );
45              
46             print $skos->turtle;
47              
48             =cut
49              
50 5     5   26 use base 'Exporter';
  5         9  
  5         29191  
51             our @EXPORT_OK = qw(skos);
52              
53             our %NAMESPACES = (
54             rdf => 'http://www.w3.org/1999/02/22-rdf-syntax-ns#',
55             skos => 'http://www.w3.org/2004/02/skos/core#',
56             dc => 'http://purl.org/dc/elements/1.1/',
57             foaf => 'http://xmlns.com/foaf/0.1/',
58             void => 'http://rdfs.org/ns/void#',
59             dct => 'http://purl.org/dc/terms/',
60             xsd => 'http://www.w3.org/2001/XMLSchema#',
61             skosxl => 'http://www.w3.org/2008/05/skos-xl#',
62             owl => 'http://www.w3.org/2002/07/owl#',
63             );
64              
65             =head1 SKOS CONFORMANCE
66              
67             The following classes and properties from the SKOS vocabulary are supported.
68             The numbers in brackets (B<[Sxx]>) refer to integrity conditions from the
69             SKOS specification. Additional constraints are marked by numbers like B<[Cxx]>.
70              
71             =over 4
72              
73             =item L
74              
75             Instances of C B<[S1]> are not represented as objects but as
76             parts of a SKOS::Simple object, so every Concepts must belong to a Concept
77             Scheme B<[C1]>. You can attach Concepts to a scheme with L.
78              
79             =item L
80              
81             Instances of C are implemented as objects of type
82             SKOS::Simple B<[S2]>. Concepts added to a scheme are automatically connected
83             to the scheme via C B<[S3-S4]> (only serialized if requested).
84             Concepts can be selected as top concepts (C /
85             C B<[S5-S8]>). In contrast to the SKOS specification,
86             (L) the top concepts
87             of a scheme cannot have broader concepts in the same scheme B<[C2]>.
88              
89             Concepts and concept schemes must be disjoint B<[S9]>. This is ensured only
90             if you do not use a C but a C parameter.
91              
92             =item L
93              
94             The label types C, C, and C
95             are supported. In addition this module supports the label properties
96             C and C, which are not explicitly included in the
97             SKOS reference.
98              
99             C as super-property of C, C,
100             and C will be supported in a later version.
101              
102             =item L
103              
104             Notations (C) must be unique per concept and scheme
105             B<[C3]>.
106              
107             =cut
108              
109             our %LABEL_PROPERTIES = map { $_ => 1 } qw(prefLabel altLabel hiddenLabel);
110              
111             our %LABEL_TYPES = (
112             pref => 'skos:prefLabel', # TODO: sub-property of rdfs:label
113             alt => 'skos:altLabel', # dito
114             hidden => 'skos:hiddenLabel', # dito
115             title => 'dc:title'
116             );
117              
118             =item L
119              
120             So called "semantic" relations (C) include
121             C, C, and C.
122              
123             The C and C are currently
124             not supported.
125              
126             With this module you can only model semantic relations between concepts
127             in the same scheme.
128              
129             =cut
130              
131             our %RELATION_PROPERTIES = map { $_ => 1 } qw(semanticRelation
132             broader narrower related broaderTransitive narrowerTransitive);
133              
134             =item L
135              
136             C, C, C, C,
137             C, C and C can be used to
138             document concepts. In contrast to the SKOS specification their range is
139             limited to literal values B<[C4]>.
140              
141             =cut
142              
143             our %NOTE_PROPERTIES = map { $_ => 1 } qw(note
144             changeNote definition editorialNote example historyNote scopeNote);
145              
146             =back
147              
148             Concept Collections (C, C,
149             C, C) and SKOS extension for labels
150             (C etc.) are not supported. Mapping Properties
151             (C, C, C,
152             C, C, C) will
153             probably be implemented in another module.
154              
155             =cut
156              
157             our %MAPPING_PROPERTIES = map { $_ => 1 } qw(mappingRelation
158             closeMatch exactMatch broadMatch narrowMatch relatedMatch);
159              
160             # dublin core elements
161             our %DC_PROPERTIES = map { $_ => "dc:$_" }
162             qw(contributor coverage creator date description format identifier
163             language publisher relation rights source subject title type);
164              
165             # To add RDF data beyond the SKOS data model, you can use the
166             # L.
167              
168             =head1 ADDITIONAL CONSTRAINTS
169              
170             The current version of this module aims at classifications.
171             Support for thesauri will be implemented later.
172              
173             An instance of SKOS::Simple holds exactely one skos:ConceptScheme with
174             the following properties:
175              
176             =over 4
177              
178             =item *
179              
180             All concepts share a common URI base. By default this common prefix is
181             also the URI of the concept scheme as whole.
182              
183             =item *
184              
185             All concepts must be identifyable by a unique string, that is refered
186             to as the concept identifier. The URI of a concept is build of the
187             common URI prefix and the concept's identifier. The identifier must
188             either be the skos:notation (so every concept must have one), or the
189             skos:prefLabel in one fixed language for all concepts. The only exception
190             to this rule are filters, for instance to uri-encode the prefLabel/notation.
191              
192             =item *
193              
194             Empty strings as literal values are ignored. In most cases you can use
195             C and C<""> interchangeably.
196              
197             =item *
198              
199             All notations have the same Datatype URI (this may be changed).
200              
201             =item *
202              
203             The range of all documentation properties (C, C,
204             C etc.) is the plain literals instead of any resource.
205              
206             =item *
207              
208             I<...sure there are some more limitations...>
209              
210             =back
211              
212             =head1 METHODS
213              
214             =head2 new( [ %properties ] )
215              
216             Creates a new concept scheme with the following properties:
217              
218             =over 4
219              
220             =item base
221              
222             The URI prefix that is used for all concepts (not required but recommended).
223              
224             =item scheme
225              
226             The URI of the whole concept scheme (C).
227             By default the C property is used as concept scheme URI.
228              
229             =item title
230              
231             Title(s) of the concept scheme. Must be either a string or a
232             hash that maps language tags to strings.
233              
234             =item namespaces
235              
236             An optional hash with additional namespaces. You can also override standard
237             namespaces (e.g. C). All namespaces explicitly specified by this
238             parameter are always included as C<< @prefix >> in the Turtle output.
239              
240             =item language
241              
242             Language tag of the default language. By default set to C.
243              
244             =item hierarchy
245              
246             Either C or C or the empty string for no hierarchy check
247             (default). At the moment only C is supported.
248              
249             =item identity
250              
251             Specifies which property is used as concept identifier. Possible
252             values are C
253             and C (C). If no value is given, you must
254             either specify C
255              
256             =item label
257              
258             Specifies how to encode concept labels. Possible values are C
259             (C), which is the default value and implied if
260             C<< identify => 'label' >>, C (C,
261             C (C) and C (C<dc:title>). </td> </tr> <tr> <td class="h" > <a name="262">262</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="263">263</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> =item notation </td> </tr> <tr> <td class="h" > <a name="264">264</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="265">265</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> Specifies whether to check notations to be unique (C<unique>) and/or </td> </tr> <tr> <td class="h" > <a name="266">266</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> mandatory (C<mandatory>) per concept. C<< identity => 'notation' >> </td> </tr> <tr> <td class="h" > <a name="267">267</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> implies C<< notation => 'unique' >>. </td> </tr> <tr> <td class="h" > <a name="268">268</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="269">269</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> =item properties </td> </tr> <tr> <td class="h" > <a name="270">270</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="271">271</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> Additional properties as structured Turtle. Triples with predicates </td> </tr> <tr> <td class="h" > <a name="272">272</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> C<a>, C<dc:title>, and C<skos:...> are not allowed but removed. </td> </tr> <tr> <td class="h" > <a name="273">273</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="274">274</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> =item description </td> </tr> <tr> <td class="h" > <a name="275">275</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="276">276</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> not supported yet. </td> </tr> <tr> <td class="h" > <a name="277">277</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="278">278</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> =back </td> </tr> <tr> <td class="h" > <a name="279">279</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="280">280</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> =cut </td> </tr> <tr> <td class="h" > <a name="281">281</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="282">282</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> sub new { </td> </tr> <tr> <td class="h" > <a name="283">283</a> </td> <td class="c3" > 15 </td> <td >   </td> <td >   </td> <td class="c3" > <a href="blib-lib-SKOS-Simple-pm--subroutine.html#283-1"> 15 </a> </td> <td class="c3" > <a href="blib-lib-SKOS-Simple-pm--subroutine.html#283-1"> 1 </a> </td> <td > 12780 </td> <td class="s"> my $class = shift; </td> </tr> <tr> <td class="h" > <a name="284">284</a> </td> <td class="c3" > 15 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 54 </td> <td class="s"> my (%arg) = @_; </td> </tr> <tr> <td class="h" > <a name="285">285</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="286">286</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> my $self = bless( { </td> </tr> <tr> <td class="h" > <a name="287">287</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> concepts => { }, </td> </tr> <tr> <td class="h" > <a name="288">288</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="289">289</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> prop => { }, </td> </tr> <tr> <td class="h" > <a name="290">290</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> related => { }, </td> </tr> <tr> <td class="h" > <a name="291">291</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> top => { }, # ids of top concepts </td> </tr> <tr> <td class="h" > <a name="292">292</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="293">293</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> u_notation => { }, </td> </tr> <tr> <td class="h" > <a name="294">294</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> u_label => { }, </td> </tr> <tr> <td class="h" > <a name="295">295</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="296">296</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> hierarchy => ($arg{hierarchy} || ""), # tree|thesaurus| </td> </tr> <tr> <td class="h" > <a name="297">297</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> base => ($arg{base} || ""), </td> </tr> <tr> <td class="h" > <a name="298">298</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> scheme => ($arg{scheme} || ""), </td> </tr> <tr> <td class="h" > <a name="299">299</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> title => ($arg{title} || ""), </td> </tr> <tr> <td class="h" > <a name="300">300</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> namespaces => ($arg{namespaces} || { }), # TODO: count usage (?) </td> </tr> <tr> <td class="h" > <a name="301">301</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> language => ($arg{language} || "en"), # TODO: check tag </td> </tr> <tr> <td class="h" > <a name="302">302</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> description => ($arg{description} || ""), # TODO: add </td> </tr> <tr> <td class="h" > <a name="303">303</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="304">304</a> </td> <td class="c3" > 12 </td> <td >   </td> <td >   </td> <td class="c3" > <a href="blib-lib-SKOS-Simple-pm--subroutine.html#304-1"> 12 </a> </td> <td >   </td> <td > 33 </td> <td class="s"> idescape => $arg{idescape} || sub { $_[0]; }, # TODO: uri-escape </td> </tr> <tr> <td class="h" > <a name="305">305</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="306">306</a> </td> <td class="c3" > 15 </td> <td >   </td> <td class="c0" > <a href="blib-lib-SKOS-Simple-pm--condition.html#306-1"> 50 </a> </td> <td >   </td> <td >   </td> <td > 2232 </td> <td class="s"> identity => ($arg{identity} || ""), </td> </tr> <tr> <td class="h" > <a > </a> </td> <td >   </td> <td >   </td> <td class="c3" > <a href="blib-lib-SKOS-Simple-pm--condition.html#-2"> 100 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a > </a> </td> <td >   </td> <td >   </td> <td class="c3" > <a href="blib-lib-SKOS-Simple-pm--condition.html#-3"> 100 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a > </a> </td> <td >   </td> <td >   </td> <td class="c3" > <a href="blib-lib-SKOS-Simple-pm--condition.html#-4"> 100 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a > </a> </td> <td >   </td> <td >   </td> <td class="c3" > <a href="blib-lib-SKOS-Simple-pm--condition.html#-5"> 100 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a > </a> </td> <td >   </td> <td >   </td> <td class="c3" > <a href="blib-lib-SKOS-Simple-pm--condition.html#-6"> 100 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a > </a> </td> <td >   </td> <td >   </td> <td class="c0" > <a href="blib-lib-SKOS-Simple-pm--condition.html#-7"> 50 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a > </a> </td> <td >   </td> <td >   </td> <td class="c0" > <a href="blib-lib-SKOS-Simple-pm--condition.html#-8"> 50 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a > </a> </td> <td >   </td> <td >   </td> <td class="c3" > <a href="blib-lib-SKOS-Simple-pm--condition.html#-9"> 100 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a > </a> </td> <td >   </td> <td >   </td> <td class="c0" > <a href="blib-lib-SKOS-Simple-pm--condition.html#-10"> 50 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a > </a> </td> <td >   </td> <td >   </td> <td class="c3" > <a href="blib-lib-SKOS-Simple-pm--condition.html#-11"> 100 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="307">307</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> label => ($arg{label} || ""), # label type </td> </tr> <tr> <td class="h" > <a name="308">308</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> notation => ($arg{notation} || ""), </td> </tr> <tr> <td class="h" > <a name="309">309</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="310">310</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> }, $class ); </td> </tr> <tr> <td class="h" > <a name="311">311</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="312">312</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # TODO: croak "base of scheme missing" unless $self->{base}; </td> </tr> <tr> <td class="h" > <a name="313">313</a> </td> <td class="c3" > 15 </td> <td class="c0" > <a href="blib-lib-SKOS-Simple-pm--branch.html#313-1"> 50 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td > 73 </td> <td class="s"> croak "base must be an URI" unless uri_or_empty($self->{base}); </td> </tr> <tr> <td class="h" > <a name="314">314</a> </td> <td class="c3" > 15 </td> <td class="c0" > <a href="blib-lib-SKOS-Simple-pm--branch.html#314-1"> 50 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td > 48 </td> <td class="s"> croak "scheme must be an URI" unless uri_or_empty($self->{scheme}); </td> </tr> <tr> <td class="h" > <a name="315">315</a> </td> <td class="c3" > 15 </td> <td class="c3" > <a href="blib-lib-SKOS-Simple-pm--branch.html#315-1"> 100 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td > 64 </td> <td class="s"> $self->{scheme} = "" if $self->{scheme} eq $self->{base}; </td> </tr> <tr> <td class="h" > <a name="316">316</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="317">317</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> #### identifier, label, notation </td> </tr> <tr> <td class="h" > <a name="318">318</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="319">319</a> </td> <td class="c3" > 15 </td> <td class="c3" > <a href="blib-lib-SKOS-Simple-pm--branch.html#319-1"> 100 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td > 46 </td> <td class="s"> if ( !$self->{identity} ) { </td> </tr> <tr> <td class="h" > <a > </a> </td> <td class="c3" > 3 </td> <td class="c0" > <a href="blib-lib-SKOS-Simple-pm--branch.html#-2"> 50 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td > 14 </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="320">320</a> </td> <td class="c3" > 14 </td> <td class="c0" > <a href="blib-lib-SKOS-Simple-pm--branch.html#320-1"> 50 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td > 55 </td> <td class="s"> if ( $self->{label} eq 'unique' ) { </td> </tr> <tr> <td class="h" > <a > </a> </td> <td >   </td> <td class="c3" > <a href="blib-lib-SKOS-Simple-pm--branch.html#-2"> 100 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="321">321</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 0 </td> <td class="s"> $self->{identity} = 'label'; </td> </tr> <tr> <td class="h" > <a name="322">322</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } elsif ( $self->{notation} eq 'unique' ) { </td> </tr> <tr> <td class="h" > <a name="323">323</a> </td> <td class="c3" > 2 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 7 </td> <td class="s"> $self->{identity} = 'notation'; </td> </tr> <tr> <td class="h" > <a name="324">324</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } else { </td> </tr> <tr> <td class="h" > <a name="325">325</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # TODO: do we want this? </td> </tr> <tr> <td class="h" > <a name="326">326</a> </td> <td class="c3" > 12 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 28 </td> <td class="s"> $self->{identity} = 'label'; </td> </tr> <tr> <td class="h" > <a name="327">327</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # croak "concept identification not specified"; </td> </tr> <tr> <td class="h" > <a name="328">328</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="329">329</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } elsif ( !(grep { $self->{identity} eq $_ } qw(label notation identifier)) ) { </td> </tr> <tr> <td class="h" > <a name="330">330</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 0 </td> <td class="s"> croak "concept identification must be 'label', 'notation', or 'identifier'"; </td> </tr> <tr> <td class="h" > <a name="331">331</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } # NOTE: we may add 'id' (internal id) as another method </td> </tr> <tr> <td class="h" > <a name="332">332</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="333">333</a> </td> <td class="c3" > 15 </td> <td class="c0" > <a href="blib-lib-SKOS-Simple-pm--branch.html#333-1"> 50 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td > 38 </td> <td class="s"> if ( $self->{label} ) { </td> </tr> <tr> <td class="h" > <a name="334">334</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 0 </td> <td class="s"> croak "label type must be one of " . join(", ", keys %LABEL_TYPES) </td> </tr> <tr> <td class="h" > <a name="335">335</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-SKOS-Simple-pm--branch.html#335-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td > 0 </td> <td class="s"> unless ( grep { $self->{label} eq $_ } keys %LABEL_TYPES ); </td> </tr> <tr> <td class="h" > <a name="336">336</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } else { </td> </tr> <tr> <td class="h" > <a name="337">337</a> </td> <td class="c3" > 15 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 34 </td> <td class="s"> $self->{label} = 'pref'; </td> </tr> <tr> <td class="h" > <a name="338">338</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="339">339</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="340">340</a> </td> <td class="c3" > 15 </td> <td class="c3" > <a href="blib-lib-SKOS-Simple-pm--branch.html#340-1"> 100 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td > 40 </td> <td class="s"> if ( $self->{notation} ) { </td> </tr> <tr> <td class="h" > <a name="341">341</a> </td> <td class="c3" > 4 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 16 </td> <td class="s"> croak "notation type can only be 'unique' or 'mandatory'" </td> </tr> <tr> <td class="h" > <a name="342">342</a> </td> <td class="c3" > 2 </td> <td class="c0" > <a href="blib-lib-SKOS-Simple-pm--branch.html#342-1"> 50 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td > 5 </td> <td class="s"> unless ( grep { $self->{notation} eq $_ } qw(unique mandatory) ); </td> </tr> <tr> <td class="h" > <a name="343">343</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="344">344</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="345">345</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # mandatory namespaces </td> </tr> <tr> <td class="h" > <a name="346">346</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="347">347</a> </td> <td class="c3" > 15 </td> <td class="c3" > <a href="blib-lib-SKOS-Simple-pm--branch.html#347-1"> 100 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td > 74 </td> <td class="s"> $self->{namespaces}->{skos} = $NAMESPACES{skos} </td> </tr> <tr> <td class="h" > <a name="348">348</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> unless $self->{namespaces}->{skos}; </td> </tr> <tr> <td class="h" > <a name="349">349</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="350">350</a> </td> <td class="c3" > 15 </td> <td class="c0" > <a href="blib-lib-SKOS-Simple-pm--branch.html#350-1"> 50 </a> </td> <td class="c0" > <a href="blib-lib-SKOS-Simple-pm--condition.html#350-1"> 33 </a> </td> <td >   </td> <td >   </td> <td > 54 </td> <td class="s"> $self->{namespaces}->{void} = $NAMESPACES{void} </td> </tr> <tr> <td class="h" > <a name="351">351</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> if ( $arg{void} and not $self->{namespaces}->{void} ); </td> </tr> <tr> <td class="h" > <a name="352">352</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="353">353</a> </td> <td class="c3" > 15 </td> <td class="c3" > <a href="blib-lib-SKOS-Simple-pm--branch.html#353-1"> 100 </a> </td> <td class="c0" > <a href="blib-lib-SKOS-Simple-pm--condition.html#353-1"> 66 </a> </td> <td >   </td> <td >   </td> <td > 106 </td> <td class="s"> $self->{namespaces}->{dc} = $NAMESPACES{dc} </td> </tr> <tr> <td class="h" > <a > </a> </td> <td >   </td> <td >   </td> <td class="c3" > <a href="blib-lib-SKOS-Simple-pm--condition.html#-2"> 100 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="354">354</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> if ( ($self->{title} || $self->{description}) && not $self->{namespaces}->{dc}); </td> </tr> <tr> <td class="h" > <a name="355">355</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="356">356</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # Add default language, if title without language given </td> </tr> <tr> <td class="h" > <a name="357">357</a> </td> <td class="c3" > 15 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 25 </td> <td class="s"> my $lang = $self->{language}; </td> </tr> <tr> <td class="h" > <a name="358">358</a> </td> <td class="c3" > 15 </td> <td class="c3" > <a href="blib-lib-SKOS-Simple-pm--branch.html#358-1"> 100 </a> </td> <td class="c0" > <a href="blib-lib-SKOS-Simple-pm--condition.html#358-1"> 66 </a> </td> <td >   </td> <td >   </td> <td > 63 </td> <td class="s"> if ($self->{title} && not ref($self->{title}) && $lang) { </td> </tr> <tr> <td class="h" > <a > </a> </td> <td >   </td> <td >   </td> <td class="c3" > <a href="blib-lib-SKOS-Simple-pm--condition.html#-2"> 100 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="359">359</a> </td> <td class="c3" > 2 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 7 </td> <td class="s"> $self->{title} = { $lang => $self->{title} }; </td> </tr> <tr> <td class="h" > <a name="360">360</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="361">361</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="362">362</a> </td> <td class="c3" > 15 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 41 </td> <td class="s"> my @types = ('skos:ConceptScheme'); </td> </tr> <tr> <td class="h" > <a name="363">363</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="364">364</a> </td> <td class="c3" > 15 </td> <td class="c0" > <a href="blib-lib-SKOS-Simple-pm--branch.html#364-1"> 50 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td > 48 </td> <td class="s"> if ( my $pattern = delete $arg{idpattern} ) { </td> </tr> <tr> <td class="h" > <a name="365">365</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 0 </td> <td class="s"> $self->{idregexp} = qr/^$pattern$/; </td> </tr> <tr> <td class="h" > <a name="366">366</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 0 </td> <td class="s"> my $basepattern = $self->{base}; </td> </tr> <tr> <td class="h" > <a name="367">367</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 0 </td> <td class="s"> $basepattern =~ s/[.]/\\./g; </td> </tr> <tr> <td class="h" > <a name="368">368</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 0 </td> <td class="s"> $basepattern =~ s/[?]/\\?/g; # TODO: escape more nasty stuff in base URI </td> </tr> <tr> <td class="h" > <a name="369">369</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 0 </td> <td class="s"> $self->{idpattern} = "^$basepattern$pattern\$"; </td> </tr> <tr> <td class="h" > <a name="370">370</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="371">371</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="372">372</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # TODO: license (dct:license) </td> </tr> <tr> <td class="h" > <a name="373">373</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="374">374</a> </td> <td class="c3" > 15 </td> <td class="c0" > <a href="blib-lib-SKOS-Simple-pm--branch.html#374-1"> 50 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td > 39 </td> <td class="s"> if ( $arg{void} ) { </td> </tr> <tr> <td class="h" > <a name="375">375</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 0 </td> <td class="s"> $self->{void} = 1; # TODO: document this </td> </tr> <tr> <td class="h" > <a name="376">376</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-SKOS-Simple-pm--branch.html#376-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td > 0 </td> <td class="s"> push @types, 'void:Dataset' if $arg{void}; </td> </tr> <tr> <td class="h" > <a name="377">377</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 0 </td> <td class="s"> $self->{prop}->{'void:uriSpace'} = turtle_uri($self->{base}); </td> </tr> <tr> <td class="h" > <a name="378">378</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 0 </td> <td class="s"> $self->{prop}->{'void:rootResource'} = turtle_uri($self->{base}); </td> </tr> <tr> <td class="h" > <a name="379">379</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-SKOS-Simple-pm--branch.html#379-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td > 0 </td> <td class="s"> if ( $self->{idpattern} ) { </td> </tr> <tr> <td class="h" > <a name="380">380</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 0 </td> <td class="s"> $self->{prop}->{'void:uriRegexPattern'} = turtle_literal($self->{idpattern}); </td> </tr> <tr> <td class="h" > <a name="381">381</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="382">382</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="383">383</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="384">384</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # TODO: allow additional types </td> </tr> <tr> <td class="h" > <a name="385">385</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="386">386</a> </td> <td class="c3" > 15 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 47 </td> <td class="s"> $self->{prop}->{a} = \@types; </td> </tr> <tr> <td class="h" > <a name="387">387</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="388">388</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # additional properties </td> </tr> <tr> <td class="h" > <a name="389">389</a> </td> <td class="c3" > 15 </td> <td class="c3" > <a href="blib-lib-SKOS-Simple-pm--branch.html#389-1"> 100 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td > 56 </td> <td class="s"> if ( $arg{properties} ) { </td> </tr> <tr> <td class="h" > <a name="390">390</a> </td> <td class="c3" > 1 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 3 </td> <td class="s"> my $p = $arg{properties}; </td> </tr> <tr> <td class="h" > <a name="391">391</a> </td> <td class="c3" > 1 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 3 </td> <td class="s"> my $a = delete $p->{a}; </td> </tr> <tr> <td class="h" > <a name="392">392</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="393">393</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # TODO: also filter other namespaces and full URI forms </td> </tr> <tr> <td class="h" > <a name="394">394</a> </td> <td class="c3" > 1 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 4 </td> <td class="s"> my @s = grep { $_ =~ /skos:/ } keys %$p; </td> </tr> <tr> <td class="h" > <a > </a> </td> <td class="c3" > 2 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 9 </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="395">395</a> </td> <td class="c3" > 1 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 5 </td> <td class="s"> delete $p->{$_} for @s; </td> </tr> <tr> <td class="h" > <a name="396">396</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="397">397</a> </td> <td class="c3" > 1 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 7 </td> <td class="s"> while ( my ($key, $value) = each %$p ) { </td> </tr> <tr> <td class="h" > <a name="398">398</a> </td> <td class="c3" > 1 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 6 </td> <td class="s"> $self->{prop}->{$key} = $value; </td> </tr> <tr> <td class="h" > <a name="399">399</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="400">400</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="401">401</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="402">402</a> </td> <td class="c3" > 15 </td> <td class="c3" > <a href="blib-lib-SKOS-Simple-pm--branch.html#402-1"> 100 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td > 80 </td> <td class="s"> $self->{prop}->{'dc:title'} = </td> </tr> <tr> <td class="h" > <a name="403">403</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $self->{title} eq '' ? '' : turtle_literal_list( $self->{title} ); </td> </tr> <tr> <td class="h" > <a name="404">404</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="405">405</a> </td> <td class="c3" > 15 </td> <td >   </td> <td class="c0" > <a href="blib-lib-SKOS-Simple-pm--condition.html#405-1"> 50 </a> </td> <td >   </td> <td >   </td> <td > 205 </td> <td class="s"> my $page = (delete $arg{page} || ""); </td> </tr> <tr> <td class="h" > <a name="406">406</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="407">407</a> </td> <td class="c3" > 15 </td> <td class="c0" > <a href="blib-lib-SKOS-Simple-pm--branch.html#407-1"> 50 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td > 63 </td> <td class="s"> $self->{prop}->{'foaf:page'} = </td> </tr> <tr> <td class="h" > <a name="408">408</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $page eq '' ? '' : turtle_uri( $page ); </td> </tr> <tr> <td class="h" > <a name="409">409</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="410">410</a> </td> <td class="c3" > 15 </td> <td class="c0" > <a href="blib-lib-SKOS-Simple-pm--branch.html#410-1"> 50 </a> </td> <td class="c0" > <a href="blib-lib-SKOS-Simple-pm--condition.html#410-1"> 33 </a> </td> <td >   </td> <td >   </td> <td > 46 </td> <td class="s"> $self->{namespaces}->{foaf} = $NAMESPACES{foaf} </td> </tr> <tr> <td class="h" > <a name="411">411</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> if ( $page ne "" and not $self->{namespaces}->{foaf} ); </td> </tr> <tr> <td class="h" > <a name="412">412</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="413">413</a> </td> <td class="c3" > 15 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 86 </td> <td class="s"> return $self; </td> </tr> <tr> <td class="h" > <a name="414">414</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="415">415</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="416">416</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> sub _values { </td> </tr> <tr> <td class="h" > <a name="417">417</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # TODO: also allow hashref (?) </td> </tr> <tr> <td class="h" > <a name="418">418</a> </td> <td class="c3" > 70 </td> <td class="c0" > <a href="blib-lib-SKOS-Simple-pm--branch.html#418-1"> 50 </a> </td> <td class="c0" > <a href="blib-lib-SKOS-Simple-pm--condition.html#418-1"> 33 </a> </td> <td class="c3" > <a href="blib-lib-SKOS-Simple-pm--subroutine.html#418-1"> 70 </a> </td> <td >   </td> <td > 108 </td> <td class="s"> my @values = map { (reftype($_) && reftype($_) eq 'ARRAY') ? @$_ : $_ } @_; </td> </tr> <tr> <td class="h" > <a > </a> </td> <td class="c3" > 70 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 321 </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="419">419</a> </td> <td class="c3" > 70 </td> <td class="c3" > <a href="blib-lib-SKOS-Simple-pm--branch.html#419-1"> 100 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td > 109 </td> <td class="s"> @values = grep { $_ and $_ ne '' } @values; </td> </tr> <tr> <td class="h" > <a > </a> </td> <td class="c3" > 70 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 825 </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="420">420</a> </td> <td class="c3" > 70 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 134 </td> <td class="s"> return @values; </td> </tr> <tr> <td class="h" > <a name="421">421</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="422">422</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="423">423</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> =head2 addConcept ( %properties ) </td> </tr> <tr> <td class="h" > <a name="424">424</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="425">425</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> Adds a concept with given properties. Only the identifying property to be </td> </tr> <tr> <td class="h" > <a name="426">426</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> used as concept id (C<notation>, C<label>, C<identifier>, or C<id> ) is </td> </tr> <tr> <td class="h" > <a name="427">427</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> mandatory. If there already is a concept with the same id, both are merged! </td> </tr> <tr> <td class="h" > <a name="428">428</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="429">429</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> Returns the id of the added or modfied concept. </td> </tr> <tr> <td class="h" > <a name="430">430</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="431">431</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> =cut </td> </tr> <tr> <td class="h" > <a name="432">432</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="433">433</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> sub addConcept { </td> </tr> <tr> <td class="h" > <a name="434">434</a> </td> <td class="c3" > 7 </td> <td >   </td> <td >   </td> <td class="c3" > <a href="blib-lib-SKOS-Simple-pm--subroutine.html#434-1"> 7 </a> </td> <td class="c3" > <a href="blib-lib-SKOS-Simple-pm--subroutine.html#434-1"> 1 </a> </td> <td > 2180 </td> <td class="s"> my $self = shift; </td> </tr> <tr> <td class="h" > <a name="435">435</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="436">436</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # ensures we have an 'id' and 'label' is a hashref </td> </tr> <tr> <td class="h" > <a name="437">437</a> </td> <td class="c3" > 7 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 29 </td> <td class="s"> my $arg = $self->conceptentification( @_ ); </td> </tr> <tr> <td class="h" > <a name="438">438</a> </td> <td class="c3" > 7 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 15 </td> <td class="s"> my $id = $arg->{id}; </td> </tr> <tr> <td class="h" > <a name="439">439</a> </td> <td class="c3" > 7 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 15 </td> <td class="s"> my $lang = $self->{language}; </td> </tr> <tr> <td class="h" > <a name="440">440</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="441">441</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # TODO: check: Concepts and concept schemes must be disjoint [S9]. </td> </tr> <tr> <td class="h" > <a name="442">442</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="443">443</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # only for internal use </td> </tr> <tr> <td class="h" > <a name="444">444</a> </td> <td class="c3" > 7 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 14 </td> <td class="s"> my $nocheck = delete $arg->{_nocheck}; </td> </tr> <tr> <td class="h" > <a name="445">445</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="446">446</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # connections to other concepts </td> </tr> <tr> <td class="h" > <a name="447">447</a> </td> <td class="c3" > 7 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 26 </td> <td class="s"> my @related = _values( delete $arg->{related} ); </td> </tr> <tr> <td class="h" > <a name="448">448</a> </td> <td class="c3" > 7 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 20 </td> <td class="s"> my @broader = _values( delete $arg->{broader} ); </td> </tr> <tr> <td class="h" > <a name="449">449</a> </td> <td class="c3" > 7 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 22 </td> <td class="s"> my @narrower = _values( delete $arg->{narrower} ); </td> </tr> <tr> <td class="h" > <a name="450">450</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> </td> </tr> <tr> <td class="h" > <a name="451">451</a> </td> <td class="c3" > 7 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 19 </td> <td class="s"> my $concept = $self->{concepts}->{$id}; </td> </tr> <tr> <td class="h" > <a name="452">452</a> </td> <td class="c3" > 7 </td> <td class="c3" > <a href="blib-lib-SKOS-Simple-pm--branch.html#452-1"> 100 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td > 28 </td> <td class="s"> unless ($self->{concepts}->{$id}) { </td> </tr> <tr> <td class="h" > <a name="453">453</a> </td> <td class="c3" > 5 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 38 </td> <td class="s"> $concept = $self->{concepts}->{$id} = { </td> </tr> <tr> <td class="h" > <a name="454">454</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> notation => "", </td> </tr> <tr> <td class="h" > <a name="455">455</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> broader => { }, </td> </tr> <tr> <td class="h" > <a name="456">456</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> narrower => { }, </td> </tr> <tr> <td class="h" > <a name="457">457</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> related => { }, </td> </tr> <tr> <td class="h" > <a name="458">458</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> }; </td> </tr> <tr> <td class="h" > <a name="459">459</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="460">460</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="461">461</a> </td> <td class="c3" > 7 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 19 </td> <td class="s"> my $notation = delete $arg->{notation}; </td> </tr> <tr> <td class="h" > <a name="462">462</a> </td> <td class="c3" > 7 </td> <td class="c3" > <a href="blib-lib-SKOS-Simple-pm--branch.html#462-1"> 100 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td > 26 </td> <td class="s"> $notation = "" unless defined $notation; </td> </tr> <tr> <td class="h" > <a name="463">463</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="464">464</a> </td> <td class="c3" > 7 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 16 </td> <td class="s"> my $identifier = delete $arg->{identifier}; </td> </tr> <tr> <td class="h" > <a name="465">465</a> </td> <td class="c3" > 7 </td> <td class="c0" > <a href="blib-lib-SKOS-Simple-pm--branch.html#465-1"> 50 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td > 35 </td> <td class="s"> if ( defined $identifier ) { </td> </tr> <tr> <td class="h" > <a name="466">466</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 0 </td> <td class="s"> $concept->{identifier} = $identifier; </td> </tr> <tr> <td class="h" > <a name="467">467</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 0 </td> <td class="s"> $self->{uses_dc} = 1; </td> </tr> <tr> <td class="h" > <a name="468">468</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="469">469</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="470">470</a> </td> <td class="c3" > 7 </td> <td class="c3" > <a href="blib-lib-SKOS-Simple-pm--branch.html#470-1"> 100 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td > 22 </td> <td class="s"> if ( $self->{notation} ) { # 'mandatory' or 'unique' </td> </tr> <tr> <td class="h" > <a name="471">471</a> </td> <td class="c3" > 6 </td> <td class="c0" > <a href="blib-lib-SKOS-Simple-pm--branch.html#471-1"> 50 </a> </td> <td class="c0" > <a href="blib-lib-SKOS-Simple-pm--condition.html#471-1"> 33 </a> </td> <td >   </td> <td >   </td> <td > 37 </td> <td class="s"> $concept->{notation} = $notation </td> </tr> <tr> <td class="h" > <a name="472">472</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> if ( defined $notation and $notation ne '' ); </td> </tr> <tr> <td class="h" > <a name="473">473</a> </td> <td class="c3" > 6 </td> <td class="c0" > <a href="blib-lib-SKOS-Simple-pm--branch.html#473-1"> 50 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td > 16 </td> <td class="s"> croak 'Concepts must have a notation' </td> </tr> <tr> <td class="h" > <a name="474">474</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> if $concept->{notation} eq ''; </td> </tr> <tr> <td class="h" > <a name="475">475</a> </td> <td class="c3" > 6 </td> <td class="c0" > <a href="blib-lib-SKOS-Simple-pm--branch.html#475-1"> 50 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td > 21 </td> <td class="s"> if ( $self->{notation} eq 'unique' ) { </td> </tr> <tr> <td class="h" > <a name="476">476</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # TODO: check uniqueness, if notation is not already the idtype </td> </tr> <tr> <td class="h" > <a name="477">477</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # croak 'Concepts must be unique per notation' </td> </tr> <tr> <td class="h" > <a name="478">478</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # if $self->{u_notation}->{ $notation }; </td> </tr> <tr> <td class="h" > <a name="479">479</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # $self->{u_notation}->{ $notation } = $id; </td> </tr> <tr> <td class="h" > <a name="480">480</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="481">481</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="482">482</a> </td> <td class="c3" > 7 </td> <td class="c3" > <a href="blib-lib-SKOS-Simple-pm--branch.html#482-1"> 100 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td > 32 </td> <td class="s"> $concept->{notation} = $notation unless $notation eq ""; </td> </tr> <tr> <td class="h" > <a name="483">483</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="484">484</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # add label properties </td> </tr> <tr> <td class="h" > <a name="485">485</a> </td> <td class="c3" > 7 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 26 </td> <td class="s"> foreach my $type ( keys %LABEL_TYPES ) { </td> </tr> <tr> <td class="h" > <a name="486">486</a> </td> <td class="c3" > 28 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 45 </td> <td class="s"> my $label = delete $arg->{$type}; </td> </tr> <tr> <td class="h" > <a name="487">487</a> </td> <td class="c3" > 28 </td> <td class="c3" > <a href="blib-lib-SKOS-Simple-pm--branch.html#487-1"> 100 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td > 139 </td> <td class="s"> next unless defined $label; </td> </tr> <tr> <td class="h" > <a name="488">488</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # TODO: add to existing labels, check for unqiueness, mandatory etc. </td> </tr> <tr> <td class="h" > <a name="489">489</a> </td> <td class="c3" > 1 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 4 </td> <td class="s"> $concept->{$type} = $label; </td> </tr> <tr> <td class="h" > <a name="490">490</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="491">491</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="492">492</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # add documentation/note properties </td> </tr> <tr> <td class="h" > <a name="493">493</a> </td> <td class="c3" > 7 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 37 </td> <td class="s"> foreach my $name ( keys %NOTE_PROPERTIES ) { </td> </tr> <tr> <td class="h" > <a name="494">494</a> </td> <td class="c3" > 49 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 94 </td> <td class="s"> my @values = _values( delete $arg->{$name} ); </td> </tr> <tr> <td class="h" > <a name="495">495</a> </td> <td class="c3" > 49 </td> <td class="c0" > <a href="blib-lib-SKOS-Simple-pm--branch.html#495-1"> 50 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td > 154 </td> <td class="s"> if ( @values ) { </td> </tr> <tr> <td class="h" > <a name="496">496</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 0 </td> <td class="s"> push @{ $concept->{$name} }, @values; </td> </tr> <tr> <td class="h" > <a > </a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 0 </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="497">497</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="498">498</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # TODO: entail skos:note </td> </tr> <tr> <td class="h" > <a name="499">499</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="500">500</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="501">501</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # additional constraint of SKOS::Simple </td> </tr> <tr> <td class="h" > <a name="502">502</a> </td> <td class="c3" > 7 </td> <td class="c0" > <a href="blib-lib-SKOS-Simple-pm--branch.html#502-1"> 50 </a> </td> <td class="c0" > <a href="blib-lib-SKOS-Simple-pm--condition.html#502-1"> 66 </a> </td> <td >   </td> <td >   </td> <td > 42 </td> <td class="s"> croak "concept <$id> cannot have broader if it is top concept!" </td> </tr> <tr> <td class="h" > <a name="503">503</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> if ( @broader && $self->{top}->{$id} ); </td> </tr> <tr> <td class="h" > <a name="504">504</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="505">505</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # add inverse relations </td> </tr> <tr> <td class="h" > <a name="506">506</a> </td> <td class="c3" > 7 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 19 </td> <td class="s"> foreach my $i (@related) { </td> </tr> <tr> <td class="h" > <a name="507">507</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-SKOS-Simple-pm--branch.html#507-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td > 0 </td> <td class="s"> next if $concept->{related}->{$i}; </td> </tr> <tr> <td class="h" > <a name="508">508</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-SKOS-Simple-pm--branch.html#508-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td > 0 </td> <td class="s"> $self->addConcept( related => $id, _nocheck => 1, id => $i ) </td> </tr> <tr> <td class="h" > <a name="509">509</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> unless $nocheck; </td> </tr> <tr> <td class="h" > <a name="510">510</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 0 </td> <td class="s"> $concept->{related}->{$i} = 1; </td> </tr> <tr> <td class="h" > <a name="511">511</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="512">512</a> </td> <td class="c3" > 7 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 17 </td> <td class="s"> foreach my $i (@broader) { </td> </tr> <tr> <td class="h" > <a name="513">513</a> </td> <td class="c3" > 2 </td> <td class="c0" > <a href="blib-lib-SKOS-Simple-pm--branch.html#513-1"> 50 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td > 10 </td> <td class="s"> next if $concept->{broader}->{$i}; </td> </tr> <tr> <td class="h" > <a name="514">514</a> </td> <td class="c3" > 2 </td> <td class="c0" > <a href="blib-lib-SKOS-Simple-pm--branch.html#514-1"> 50 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td > 9 </td> <td class="s"> if ( $self->{hierarchy} eq 'tree' ) { </td> </tr> <tr> <td class="h" > <a name="515">515</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 0 </td> <td class="s"> croak "tree property violated by <$id> skos:broader <$i>" </td> </tr> <tr> <td class="h" > <a name="516">516</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-SKOS-Simple-pm--branch.html#516-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td > 0 </td> <td class="s"> if %{$concept->{broader}}; </td> </tr> <tr> <td class="h" > <a name="517">517</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } # TODO: if 'multi[tree]': detect loops </td> </tr> <tr> <td class="h" > <a name="518">518</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> </td> </tr> <tr> <td class="h" > <a name="519">519</a> </td> <td class="c3" > 2 </td> <td class="c0" > <a href="blib-lib-SKOS-Simple-pm--branch.html#519-1"> 50 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td > 16 </td> <td class="s"> $self->addConcept( narrower => $id, _nocheck => 1, id => $i ) </td> </tr> <tr> <td class="h" > <a name="520">520</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> unless $nocheck; </td> </tr> <tr> <td class="h" > <a name="521">521</a> </td> <td class="c3" > 2 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 8 </td> <td class="s"> $concept->{broader}->{$i} = 1; </td> </tr> <tr> <td class="h" > <a name="522">522</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="523">523</a> </td> <td class="c3" > 7 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 16 </td> <td class="s"> foreach my $i (@narrower) { </td> </tr> <tr> <td class="h" > <a name="524">524</a> </td> <td class="c3" > 2 </td> <td class="c0" > <a href="blib-lib-SKOS-Simple-pm--branch.html#524-1"> 50 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td > 10 </td> <td class="s"> next if $concept->{narrower}->{$i}; </td> </tr> <tr> <td class="h" > <a name="525">525</a> </td> <td class="c3" > 2 </td> <td class="c0" > <a href="blib-lib-SKOS-Simple-pm--branch.html#525-1"> 50 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td > 6 </td> <td class="s"> $self->addConcept( broader => $id, _nocheck => 1, id => $i ) </td> </tr> <tr> <td class="h" > <a name="526">526</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> unless $nocheck; </td> </tr> <tr> <td class="h" > <a name="527">527</a> </td> <td class="c3" > 2 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 11 </td> <td class="s"> $concept->{narrower}->{$i} = 1; </td> </tr> <tr> <td class="h" > <a name="528">528</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="529">529</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="530">530</a> </td> <td class="c3" > 7 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 37 </td> <td class="s"> return $id; </td> </tr> <tr> <td class="h" > <a name="531">531</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="532">532</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="533">533</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> =head2 topConcepts ( [ @ids ] ) </td> </tr> <tr> <td class="h" > <a name="534">534</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="535">535</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> Marks one or more concepts as top concepts. The given concepts must </td> </tr> <tr> <td class="h" > <a name="536">536</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> already exist and must not have any broader concepts. Without parameters, </td> </tr> <tr> <td class="h" > <a name="537">537</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> this methods returns a list of all top concept identifiers. Unless you </td> </tr> <tr> <td class="h" > <a name="538">538</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> explicitly specify top concepts, a list of I<all> concepts without broader </td> </tr> <tr> <td class="h" > <a name="539">539</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> concepts is returned. As soon as you explicitly set some top concepts, </td> </tr> <tr> <td class="h" > <a name="540">540</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> they will be the I<only> top concepts. You can reset the top concepts </td> </tr> <tr> <td class="h" > <a name="541">541</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> to all concepts without broader concepts, provide C<undef> as only argument. </td> </tr> <tr> <td class="h" > <a name="542">542</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="543">543</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> =cut </td> </tr> <tr> <td class="h" > <a name="544">544</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="545">545</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> sub topConcepts { </td> </tr> <tr> <td class="h" > <a name="546">546</a> </td> <td class="c3" > 13 </td> <td >   </td> <td >   </td> <td class="c3" > <a href="blib-lib-SKOS-Simple-pm--subroutine.html#546-1"> 13 </a> </td> <td class="c3" > <a href="blib-lib-SKOS-Simple-pm--subroutine.html#546-1"> 1 </a> </td> <td > 18 </td> <td class="s"> my $self = shift; </td> </tr> <tr> <td class="h" > <a name="547">547</a> </td> <td class="c3" > 13 </td> <td class="c0" > <a href="blib-lib-SKOS-Simple-pm--branch.html#547-1"> 50 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td > 36 </td> <td class="s"> unless ( @_ ) { </td> </tr> <tr> <td class="h" > <a name="548">548</a> </td> <td class="c3" > 13 </td> <td class="c0" > <a href="blib-lib-SKOS-Simple-pm--branch.html#548-1"> 50 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td > 17 </td> <td class="s"> return keys %{ $self->{top} } if %{ $self->{top} }; </td> </tr> <tr> <td class="h" > <a > </a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 0 </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a > </a> </td> <td class="c3" > 13 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 47 </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="549">549</a> </td> <td class="c3" > 5 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 42 </td> <td class="s"> return grep { </td> </tr> <tr> <td class="h" > <a name="550">550</a> </td> <td class="c3" > 5 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 8 </td> <td class="s"> not %{$self->{concepts}->{$_}->{broader}} </td> </tr> <tr> <td class="h" > <a > </a> </td> <td class="c3" > 13 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 51 </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="551">551</a> </td> <td class="c3" > 13 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 22 </td> <td class="s"> } keys %{$self->{concepts}}; </td> </tr> <tr> <td class="h" > <a name="552">552</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="553">553</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-SKOS-Simple-pm--branch.html#553-1"> 0 </a> </td> <td class="c0" > <a href="blib-lib-SKOS-Simple-pm--condition.html#553-1"> 0 </a> </td> <td >   </td> <td >   </td> <td > 0 </td> <td class="s"> if ( @_ == 1 && not defined $_[0] ) { </td> </tr> <tr> <td class="h" > <a name="554">554</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 0 </td> <td class="s"> $self->{top} = { }; </td> </tr> <tr> <td class="h" > <a name="555">555</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 0 </td> <td class="s"> return; </td> </tr> <tr> <td class="h" > <a name="556">556</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="557">557</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 0 </td> <td class="s"> foreach my $id ( @_ ) { </td> </tr> <tr> <td class="h" > <a name="558">558</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-SKOS-Simple-pm--branch.html#558-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td > 0 </td> <td class="s"> croak "Unknown concept <$id>" unless $self->{concepts}->{$id}; </td> </tr> <tr> <td class="h" > <a name="559">559</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-SKOS-Simple-pm--branch.html#559-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td > 0 </td> <td class="s"> next if $self->{top}->{$id}; </td> </tr> <tr> <td class="h" > <a name="560">560</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 0 </td> <td class="s"> croak "Concept <$id> must not have broader to be top concept" </td> </tr> <tr> <td class="h" > <a name="561">561</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-SKOS-Simple-pm--branch.html#561-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td > 0 </td> <td class="s"> if keys %{ $self->{concepts}->{broader} }; </td> </tr> <tr> <td class="h" > <a name="562">562</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 0 </td> <td class="s"> $self->{top}->{$id} = 1; </td> </tr> <tr> <td class="h" > <a name="563">563</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="564">564</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="565">565</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="566">566</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> =head2 concept ( %properties ) </td> </tr> <tr> <td class="h" > <a name="567">567</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="568">568</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> Returns the identifier of a concept with given notation and/or label. </td> </tr> <tr> <td class="h" > <a name="569">569</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> It is not checked whether the given concept exists in this scheme. </td> </tr> <tr> <td class="h" > <a name="570">570</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> Returns either a string or an empty string if no identifier is given. </td> </tr> <tr> <td class="h" > <a name="571">571</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="572">572</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> =cut </td> </tr> <tr> <td class="h" > <a name="573">573</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="574">574</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> sub concept { </td> </tr> <tr> <td class="h" > <a name="575">575</a> </td> <td class="c3" > 5 </td> <td >   </td> <td >   </td> <td class="c3" > <a href="blib-lib-SKOS-Simple-pm--subroutine.html#575-1"> 5 </a> </td> <td class="c3" > <a href="blib-lib-SKOS-Simple-pm--subroutine.html#575-1"> 1 </a> </td> <td > 28 </td> <td class="s"> my $id = ""; </td> </tr> <tr> <td class="h" > <a name="576">576</a> </td> <td class="c3" > 5 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 9 </td> <td class="s"> eval { </td> </tr> <tr> <td class="h" > <a name="577">577</a> </td> <td class="c3" > 5 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 15 </td> <td class="s"> my $arg = shift->conceptentification( @_ ); </td> </tr> <tr> <td class="h" > <a name="578">578</a> </td> <td class="c3" > 4 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 18 </td> <td class="s"> $id = $arg->{id}; </td> </tr> <tr> <td class="h" > <a name="579">579</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> }; </td> </tr> <tr> <td class="h" > <a name="580">580</a> </td> <td class="c3" > 5 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 87 </td> <td class="s"> return $id; </td> </tr> <tr> <td class="h" > <a name="581">581</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="582">582</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="583">583</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> =head2 hasConcept ( $id | %properties ) </td> </tr> <tr> <td class="h" > <a name="584">584</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="585">585</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> Returns whether there is a concept of a given id. Instead of providing </td> </tr> <tr> <td class="h" > <a name="586">586</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> a specific concept C<id> you can also use unique properties (C<notation>, </td> </tr> <tr> <td class="h" > <a name="587">587</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> C<label>, C<identifier>) depending on the scheme's settings. </td> </tr> <tr> <td class="h" > <a name="588">588</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="589">589</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> =cut </td> </tr> <tr> <td class="h" > <a name="590">590</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="591">591</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> sub hasConcept { </td> </tr> <tr> <td class="h" > <a name="592">592</a> </td> <td class="c3" > 3 </td> <td >   </td> <td >   </td> <td class="c3" > <a href="blib-lib-SKOS-Simple-pm--subroutine.html#592-1"> 3 </a> </td> <td class="c3" > <a href="blib-lib-SKOS-Simple-pm--subroutine.html#592-1"> 1 </a> </td> <td > 9 </td> <td class="s"> my $self = shift; </td> </tr> <tr> <td class="h" > <a name="593">593</a> </td> <td class="c3" > 3 </td> <td class="c3" > <a href="blib-lib-SKOS-Simple-pm--branch.html#593-1"> 100 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td > 14 </td> <td class="s"> my $id = (@_ == 1) ? $_[0] : $self->concept( @_ ); </td> </tr> <tr> <td class="h" > <a name="594">594</a> </td> <td class="c3" > 3 </td> <td class="c0" > <a href="blib-lib-SKOS-Simple-pm--branch.html#594-1"> 50 </a> </td> <td class="c0" > <a href="blib-lib-SKOS-Simple-pm--condition.html#594-1"> 33 </a> </td> <td >   </td> <td >   </td> <td > 44 </td> <td class="s"> return exists $self->{concepts}->{$id} </td> </tr> <tr> <td class="h" > <a name="595">595</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> if defined $id and $id ne ""; </td> </tr> <tr> <td class="h" > <a name="596">596</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="597">597</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 0 </td> <td class="s"> return 0; </td> </tr> <tr> <td class="h" > <a name="598">598</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="599">599</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="600">600</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> =head2 concepts </td> </tr> <tr> <td class="h" > <a name="601">601</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="602">602</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> Returns a list of all concept's ids. </td> </tr> <tr> <td class="h" > <a name="603">603</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="604">604</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> =cut </td> </tr> <tr> <td class="h" > <a name="605">605</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="606">606</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> sub concepts { </td> </tr> <tr> <td class="h" > <a name="607">607</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td class="c0" > <a href="blib-lib-SKOS-Simple-pm--subroutine.html#607-1"> 0 </a> </td> <td class="c3" > <a href="blib-lib-SKOS-Simple-pm--subroutine.html#607-1"> 1 </a> </td> <td > 0 </td> <td class="s"> my $self = shift; </td> </tr> <tr> <td class="h" > <a name="608">608</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 0 </td> <td class="s"> return keys %{ $self->{concepts} }; </td> </tr> <tr> <td class="h" > <a > </a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 0 </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="609">609</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="610">610</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="611">611</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> =head2 size </td> </tr> <tr> <td class="h" > <a name="612">612</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="613">613</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> Returns the total number of concepts. </td> </tr> <tr> <td class="h" > <a name="614">614</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="615">615</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> =cut </td> </tr> <tr> <td class="h" > <a name="616">616</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="617">617</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> sub size { </td> </tr> <tr> <td class="h" > <a name="618">618</a> </td> <td class="c3" > 3 </td> <td >   </td> <td >   </td> <td class="c3" > <a href="blib-lib-SKOS-Simple-pm--subroutine.html#618-1"> 3 </a> </td> <td class="c3" > <a href="blib-lib-SKOS-Simple-pm--subroutine.html#618-1"> 1 </a> </td> <td > 488 </td> <td class="s"> my $self = shift; </td> </tr> <tr> <td class="h" > <a name="619">619</a> </td> <td class="c3" > 3 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 15 </td> <td class="s"> return scalar keys %{ $self->{concepts} }; </td> </tr> <tr> <td class="h" > <a > </a> </td> <td class="c3" > 3 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 20 </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="620">620</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="621">621</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="622">622</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> =head2 conceptentification ( %properties ) </td> </tr> <tr> <td class="h" > <a name="623">623</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="624">624</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> Checks and possibly expands some given concept properties to ensure that </td> </tr> <tr> <td class="h" > <a name="625">625</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> there is a valid concept id. Returns a hashref that contains the concept </td> </tr> <tr> <td class="h" > <a name="626">626</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> id (field C<id>) or croaks. Depending on the identification settings of </td> </tr> <tr> <td class="h" > <a name="627">627</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> this scheme you must pass at least one of C<notation>, C<label>, </td> </tr> <tr> <td class="h" > <a name="628">628</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> C<identifier>, C<id>. </td> </tr> <tr> <td class="h" > <a name="629">629</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="630">630</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> =cut </td> </tr> <tr> <td class="h" > <a name="631">631</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="632">632</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> sub conceptentification { </td> </tr> <tr> <td class="h" > <a name="633">633</a> </td> <td class="c3" > 12 </td> <td >   </td> <td >   </td> <td class="c3" > <a href="blib-lib-SKOS-Simple-pm--subroutine.html#633-1"> 12 </a> </td> <td class="c3" > <a href="blib-lib-SKOS-Simple-pm--subroutine.html#633-1"> 1 </a> </td> <td > 52 </td> <td class="s"> my ($self, %arg) = @_; </td> </tr> <tr> <td class="h" > <a name="634">634</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="635">635</a> </td> <td class="c3" > 12 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 29 </td> <td class="s"> my $idtype = $self->{identity}; </td> </tr> <tr> <td class="h" > <a name="636">636</a> </td> <td class="c3" > 12 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 25 </td> <td class="s"> my $labeltype = $self->{label}; </td> </tr> <tr> <td class="h" > <a name="637">637</a> </td> <td class="c3" > 12 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 24 </td> <td class="s"> my $lang = $self->{language}; </td> </tr> <tr> <td class="h" > <a name="638">638</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="639">639</a> </td> <td class="c3" > 12 </td> <td class="c3" > <a href="blib-lib-SKOS-Simple-pm--branch.html#639-1"> 100 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td > 49 </td> <td class="s"> $arg{label} = '' unless defined $arg{label}; </td> </tr> <tr> <td class="h" > <a name="640">640</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="641">641</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # rename 'label' parameter if given </td> </tr> <tr> <td class="h" > <a name="642">642</a> </td> <td class="c3" > 12 </td> <td class="c3" > <a href="blib-lib-SKOS-Simple-pm--branch.html#642-1"> 100 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td > 39 </td> <td class="s"> if ( $arg{label} ne '' ) { </td> </tr> <tr> <td class="h" > <a name="643">643</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # TODO: what if arg{labeltype} is also given? better croak </td> </tr> <tr> <td class="h" > <a name="644">644</a> </td> <td class="c3" > 3 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 10 </td> <td class="s"> $arg{$labeltype} = $arg{label}; </td> </tr> <tr> <td class="h" > <a name="645">645</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="646">646</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="647">647</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # set a label's default language if only a string was given </td> </tr> <tr> <td class="h" > <a name="648">648</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # expand label property to be a hashref on undef </td> </tr> <tr> <td class="h" > <a name="649">649</a> </td> <td class="c3" > 12 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 45 </td> <td class="s"> foreach my $type ( 'label', keys %LABEL_TYPES ) { </td> </tr> <tr> <td class="h" > <a name="650">650</a> </td> <td class="c3" > 60 </td> <td class="c3" > <a href="blib-lib-SKOS-Simple-pm--branch.html#650-1"> 100 </a> </td> <td class="c3" > <a href="blib-lib-SKOS-Simple-pm--condition.html#650-1"> 100 </a> </td> <td >   </td> <td >   </td> <td > 1356 </td> <td class="s"> next unless defined $arg{$type} and $arg{$type} ne ''; </td> </tr> <tr> <td class="h" > <a name="651">651</a> </td> <td class="c3" > 6 </td> <td class="c0" > <a href="blib-lib-SKOS-Simple-pm--branch.html#651-1"> 50 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td > 19 </td> <td class="s"> unless ( ref($arg{$type}) ) { # HASH </td> </tr> <tr> <td class="h" > <a name="652">652</a> </td> <td class="c3" > 6 </td> <td class="c0" > <a href="blib-lib-SKOS-Simple-pm--branch.html#652-1"> 50 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td > 22 </td> <td class="s"> if ( $arg{$type} eq "" ) { </td> </tr> <tr> <td class="h" > <a name="653">653</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 0 </td> <td class="s"> delete $arg{$type}; </td> </tr> <tr> <td class="h" > <a name="654">654</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } else { </td> </tr> <tr> <td class="h" > <a name="655">655</a> </td> <td class="c3" > 6 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 31 </td> <td class="s"> $arg{$type} = { $lang => $arg{$type} }; </td> </tr> <tr> <td class="h" > <a name="656">656</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="657">657</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="658">658</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="659">659</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="660">660</a> </td> <td class="c3" > 12 </td> <td class="c3" > <a href="blib-lib-SKOS-Simple-pm--branch.html#660-1"> 100 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td > 71 </td> <td class="s"> $arg{id} = "" unless defined $arg{id}; </td> </tr> <tr> <td class="h" > <a name="661">661</a> </td> <td class="c3" > 12 </td> <td class="c3" > <a href="blib-lib-SKOS-Simple-pm--branch.html#661-1"> 100 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td > 48 </td> <td class="s"> $arg{$idtype} = "" unless defined $arg{$idtype}; </td> </tr> <tr> <td class="h" > <a name="662">662</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="663">663</a> </td> <td class="c3" > 12 </td> <td class="c3" > <a href="blib-lib-SKOS-Simple-pm--branch.html#663-1"> 100 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td > 40 </td> <td class="s"> if ( $arg{id} ne "" ) { </td> </tr> <tr> <td class="h" > <a name="664">664</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # derive property from id </td> </tr> <tr> <td class="h" > <a name="665">665</a> </td> <td class="c3" > 3 </td> <td class="c0" > <a href="blib-lib-SKOS-Simple-pm--branch.html#665-1"> 50 </a> </td> <td class="c0" > <a href="blib-lib-SKOS-Simple-pm--condition.html#665-1"> 33 </a> </td> <td >   </td> <td >   </td> <td > 15 </td> <td class="s"> if ( $idtype eq 'notation' or $idtype eq 'identifier' ) { </td> </tr> <tr> <td class="h" > <a name="666">666</a> </td> <td class="c3" > 3 </td> <td class="c0" > <a href="blib-lib-SKOS-Simple-pm--branch.html#666-1"> 50 </a> </td> <td class="c0" > <a href="blib-lib-SKOS-Simple-pm--condition.html#666-1"> 33 </a> </td> <td >   </td> <td >   </td> <td > 12 </td> <td class="s"> if ( $arg{$idtype} ne "" and $arg{$idtype} ne $arg{id} ) { </td> </tr> <tr> <td class="h" > <a name="667">667</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 0 </td> <td class="s"> croak "concept id cannot be both '" . $arg{id} </td> </tr> <tr> <td class="h" > <a name="668">668</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> . "' and '" . $arg{$idtype} . "'"; </td> </tr> <tr> <td class="h" > <a name="669">669</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="670">670</a> </td> <td class="c3" > 3 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 10 </td> <td class="s"> $arg{$idtype} = $arg{id}; </td> </tr> <tr> <td class="h" > <a name="671">671</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } else { # $idtype eq 'label' </td> </tr> <tr> <td class="h" > <a name="672">672</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-SKOS-Simple-pm--branch.html#672-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td > 0 </td> <td class="s"> $arg{label} = { } if $arg{label} eq ''; </td> </tr> <tr> <td class="h" > <a name="673">673</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 0 </td> <td class="s"> my $l = $arg{label}->{$lang}; </td> </tr> <tr> <td class="h" > <a name="674">674</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-SKOS-Simple-pm--branch.html#674-1"> 0 </a> </td> <td class="c0" > <a href="blib-lib-SKOS-Simple-pm--condition.html#674-1"> 0 </a> </td> <td >   </td> <td >   </td> <td > 0 </td> <td class="s"> croak "concept id cannot be both '" . $arg{id} . "' and label '$l'" </td> </tr> <tr> <td class="h" > <a > </a> </td> <td >   </td> <td >   </td> <td class="c0" > <a href="blib-lib-SKOS-Simple-pm--condition.html#-2"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="675">675</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> if ( defined $l and $l ne "" and $l ne $arg{id} ); </td> </tr> <tr> <td class="h" > <a name="676">676</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="677">677</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 0 </td> <td class="s"> $arg{label}->{$lang} = $arg{id}; </td> </tr> <tr> <td class="h" > <a name="678">678</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="679">679</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } else { </td> </tr> <tr> <td class="h" > <a name="680">680</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # derive id from property (TODO: url-encode if needed) </td> </tr> <tr> <td class="h" > <a name="681">681</a> </td> <td class="c3" > 9 </td> <td class="c3" > <a href="blib-lib-SKOS-Simple-pm--branch.html#681-1"> 100 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td > 29 </td> <td class="s"> if ( $idtype eq 'notation' ) { </td> </tr> <tr> <td class="h" > <a > </a> </td> <td >   </td> <td class="c0" > <a href="blib-lib-SKOS-Simple-pm--branch.html#-2"> 50 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="682">682</a> </td> <td class="c3" > 5 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 17 </td> <td class="s"> $arg{id} = $arg{notation}; </td> </tr> <tr> <td class="h" > <a name="683">683</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } elsif ( $idtype eq 'identifier' ) { </td> </tr> <tr> <td class="h" > <a name="684">684</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 0 </td> <td class="s"> $arg{id} = $arg{identifier}; </td> </tr> <tr> <td class="h" > <a name="685">685</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } else { # $idtype eq 'label' </td> </tr> <tr> <td class="h" > <a name="686">686</a> </td> <td class="c3" > 4 </td> <td class="c3" > <a href="blib-lib-SKOS-Simple-pm--branch.html#686-1"> 100 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td > 18 </td> <td class="s"> $arg{id} = $arg{$labeltype}->{ $lang } if $arg{$labeltype}; </td> </tr> <tr> <td class="h" > <a name="687">687</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="688">688</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="689">689</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="690">690</a> </td> <td class="c3" > 12 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 41 </td> <td class="s"> $arg{id} = $self->{idescape}->( $arg{id} ); </td> </tr> <tr> <td class="h" > <a name="691">691</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="692">692</a> </td> <td class="c3" > 12 </td> <td class="c0" > <a href="blib-lib-SKOS-Simple-pm--branch.html#692-1"> 50 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td > 39 </td> <td class="s"> if ( $self->{idregexp} ) { </td> </tr> <tr> <td class="h" > <a name="693">693</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-SKOS-Simple-pm--branch.html#693-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td > 0 </td> <td class="s"> croak "identifier " . $arg{id} . " does not fit to pattern" </td> </tr> <tr> <td class="h" > <a name="694">694</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> unless $arg{id} =~ $self->{idregexp}; </td> </tr> <tr> <td class="h" > <a name="695">695</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="696">696</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="697">697</a> </td> <td class="c3" > 12 </td> <td class="c3" > <a href="blib-lib-SKOS-Simple-pm--branch.html#697-1"> 100 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td > 287 </td> <td class="s"> croak "Missing $idtype as concept identifier" if $arg{id} eq ""; </td> </tr> <tr> <td class="h" > <a name="698">698</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="699">699</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # TODO: check $arg{id} for well-formedness as URI part </td> </tr> <tr> <td class="h" > <a name="700">700</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="701">701</a> </td> <td class="c3" > 11 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 39 </td> <td class="s"> return \%arg; </td> </tr> <tr> <td class="h" > <a name="702">702</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="703">703</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="704">704</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> =head2 addHashref ( $hashref ) </td> </tr> <tr> <td class="h" > <a name="705">705</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="706">706</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> experimental. </td> </tr> <tr> <td class="h" > <a name="707">707</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="708">708</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> =cut </td> </tr> <tr> <td class="h" > <a name="709">709</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="710">710</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> sub addHashref { </td> </tr> <tr> <td class="h" > <a name="711">711</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td class="c0" > <a href="blib-lib-SKOS-Simple-pm--subroutine.html#711-1"> 0 </a> </td> <td class="c3" > <a href="blib-lib-SKOS-Simple-pm--subroutine.html#711-1"> 1 </a> </td> <td > 0 </td> <td class="s"> my ($self, $hash) = @_; </td> </tr> <tr> <td class="h" > <a name="712">712</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="713">713</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 0 </td> <td class="s"> my $base = $self->{base}; # may be "" </td> </tr> <tr> <td class="h" > <a name="714">714</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="715">715</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # ignores all but the following predicates </td> </tr> <tr> <td class="h" > <a name="716">716</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 0 </td> <td class="s"> my %predicates = ( </td> </tr> <tr> <td class="h" > <a name="717">717</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $NAMESPACES{rdf}.'type' => 'a', </td> </tr> <tr> <td class="h" > <a name="718">718</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $NAMESPACES{dc}.'identifier' => 'id' </td> </tr> <tr> <td class="h" > <a name="719">719</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> ); </td> </tr> <tr> <td class="h" > <a name="720">720</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="721">721</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 0 </td> <td class="s"> my @pnames = ( </td> </tr> <tr> <td class="h" > <a name="722">722</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> keys %NOTE_PROPERTIES, </td> </tr> <tr> <td class="h" > <a name="723">723</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> keys %RELATION_PROPERTIES, </td> </tr> <tr> <td class="h" > <a name="724">724</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> keys %LABEL_PROPERTIES, 'notation' ); </td> </tr> <tr> <td class="h" > <a name="725">725</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="726">726</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 0 </td> <td class="s"> foreach my $p (@pnames) { </td> </tr> <tr> <td class="h" > <a name="727">727</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 0 </td> <td class="s"> $predicates{ $NAMESPACES{skos}.$p } = $p; </td> </tr> <tr> <td class="h" > <a name="728">728</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="729">729</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="730">730</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 0 </td> <td class="s"> foreach my $subject ( keys %$hash ) { </td> </tr> <tr> <td class="h" > <a name="731">731</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 0 </td> <td class="s"> my $subj = $subject; </td> </tr> <tr> <td class="h" > <a name="732">732</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-SKOS-Simple-pm--branch.html#732-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td > 0 </td> <td class="s"> next unless ($subj =~ s/^$base//); </td> </tr> <tr> <td class="h" > <a name="733">733</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="734">734</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # TODO: $self->{scheme} as subject </td> </tr> <tr> <td class="h" > <a name="735">735</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="736">736</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 0 </td> <td class="s"> my %concept = (); # => $subj ); </td> </tr> <tr> <td class="h" > <a name="737">737</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 0 </td> <td class="s"> $concept{notation} = $subj; # TODO: remove </td> </tr> <tr> <td class="h" > <a name="738">738</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 0 </td> <td class="s"> my $is_concept = 0; # TODO: check </td> </tr> <tr> <td class="h" > <a name="739">739</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="740">740</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 0 </td> <td class="s"> foreach my $predicate ( keys %{$hash->{$subject}} ) { </td> </tr> <tr> <td class="h" > <a > </a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 0 </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="741">741</a> </td> <td class="c0" > 0 </td> <td >   </td> <td class="c0" > <a href="blib-lib-SKOS-Simple-pm--condition.html#741-1"> 0 </a> </td> <td >   </td> <td >   </td> <td > 0 </td> <td class="s"> my $p = $predicates{ $predicate } || next; </td> </tr> <tr> <td class="h" > <a name="742">742</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="743">743</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 0 </td> <td class="s"> foreach my $object ( @{ $hash->{$subject}->{$predicate} } ) { </td> </tr> <tr> <td class="h" > <a > </a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 0 </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="744">744</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 0 </td> <td class="s"> my $obj; </td> </tr> <tr> <td class="h" > <a name="745">745</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> </td> </tr> <tr> <td class="h" > <a name="746">746</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-SKOS-Simple-pm--branch.html#746-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td > 0 </td> <td class="s"> if ( $p =~ /^(narrower|broader)$/ ) { </td> </tr> <tr> <td class="h" > <a > </a> </td> <td >   </td> <td class="c0" > <a href="blib-lib-SKOS-Simple-pm--branch.html#-2"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a > </a> </td> <td >   </td> <td class="c0" > <a href="blib-lib-SKOS-Simple-pm--branch.html#-3"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="747">747</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-SKOS-Simple-pm--branch.html#747-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td > 0 </td> <td class="s"> next unless $object->{type} eq 'uri'; </td> </tr> <tr> <td class="h" > <a name="748">748</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 0 </td> <td class="s"> $obj = $object->{value}; </td> </tr> <tr> <td class="h" > <a name="749">749</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> #print "$obj\n"; </td> </tr> <tr> <td class="h" > <a name="750">750</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-SKOS-Simple-pm--branch.html#750-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td > 0 </td> <td class="s"> next unless ($obj =~ s/^$base//); </td> </tr> <tr> <td class="h" > <a name="751">751</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 0 </td> <td class="s"> push @{$concept{$p}}, $obj; </td> </tr> <tr> <td class="h" > <a > </a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 0 </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="752">752</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } elsif ( $p =~ /^(prefLabel)/ ) { </td> </tr> <tr> <td class="h" > <a name="753">753</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 0 </td> <td class="s"> $obj = $object->{value}; # TODO: language </td> </tr> <tr> <td class="h" > <a name="754">754</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 0 </td> <td class="s"> $concept{label} = $obj; # TODO: unique </td> </tr> <tr> <td class="h" > <a name="755">755</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } elsif ( $p eq 'definition' ) { </td> </tr> <tr> <td class="h" > <a name="756">756</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="757">757</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="758">758</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # TODO: map </td> </tr> <tr> <td class="h" > <a name="759">759</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> #print "$subj $p\n"; </td> </tr> <tr> <td class="h" > <a name="760">760</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="761">761</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="762">762</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-SKOS-Simple-pm--branch.html#762-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td > 0 </td> <td class="s"> if ( %concept ) { </td> </tr> <tr> <td class="h" > <a name="763">763</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 0 </td> <td class="s"> $self->addConcept( %concept ); </td> </tr> <tr> <td class="h" > <a name="764">764</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="765">765</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="766">766</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="767">767</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="768">768</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> =head1 SERIALIZATION METHODS </td> </tr> <tr> <td class="h" > <a name="769">769</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="770">770</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> The following methods serialize the concept scheme or parts of it in </td> </tr> <tr> <td class="h" > <a name="771">771</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> L<Terse RDF Triple language|http://www.w3.org/TeamSubmission/turtle/> </td> </tr> <tr> <td class="h" > <a name="772">772</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> (RDF/Turtle). A valid serialization must start with some namespace </td> </tr> <tr> <td class="h" > <a name="773">773</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> declarations, and a base declaration. Both are only included by the </td> </tr> <tr> <td class="h" > <a name="774">774</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> C<turtle> method, but they can also be requested independently. </td> </tr> <tr> <td class="h" > <a name="775">775</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> All return values end with a newline unless it is the empty string. </td> </tr> <tr> <td class="h" > <a name="776">776</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="777">777</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> A later version may also support 'hashref' format for serializing. </td> </tr> <tr> <td class="h" > <a name="778">778</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="779">779</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> =head2 turtle ( [ %options ] ) </td> </tr> <tr> <td class="h" > <a name="780">780</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="781">781</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> Returns a full Turtle serialization of this concept scheme. </td> </tr> <tr> <td class="h" > <a name="782">782</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> The return value is equivalent to calling C<turtleNamespaces>, </td> </tr> <tr> <td class="h" > <a name="783">783</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> C<turtleBase>, C<turtleScheme>, and C<turtleConcepts>. </td> </tr> <tr> <td class="h" > <a name="784">784</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="785">785</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> The parameter C<< lean => 1 >> enables a lean serialization, which </td> </tr> <tr> <td class="h" > <a name="786">786</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> does not include infereable RDF statements. Other parameters are </td> </tr> <tr> <td class="h" > <a name="787">787</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> passed to C<turtleScheme> and C<turtleConcepts> as well. </td> </tr> <tr> <td class="h" > <a name="788">788</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="789">789</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> =cut </td> </tr> <tr> <td class="h" > <a name="790">790</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="791">791</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> sub turtle { </td> </tr> <tr> <td class="h" > <a name="792">792</a> </td> <td class="c3" > 8 </td> <td >   </td> <td >   </td> <td class="c3" > <a href="blib-lib-SKOS-Simple-pm--subroutine.html#792-1"> 8 </a> </td> <td class="c3" > <a href="blib-lib-SKOS-Simple-pm--subroutine.html#792-1"> 1 </a> </td> <td > 1126 </td> <td class="s"> my ($self,%opt) = @_; </td> </tr> <tr> <td class="h" > <a name="793">793</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="794">794</a> </td> <td class="c3" > 8 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 23 </td> <td class="s"> return join( "\n", </td> </tr> <tr> <td class="h" > <a name="795">795</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $self->turtleNamespaces, </td> </tr> <tr> <td class="h" > <a name="796">796</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $self->turtleBase , </td> </tr> <tr> <td class="h" > <a name="797">797</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $self->turtleScheme( %opt ) , </td> </tr> <tr> <td class="h" > <a name="798">798</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $self->turtleConcepts( %opt ) ); </td> </tr> <tr> <td class="h" > <a name="799">799</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="800">800</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="801">801</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> =head2 turtleNamespaces </td> </tr> <tr> <td class="h" > <a name="802">802</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="803">803</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> Returns Turtle syntax namespace declarations for this scheme. </td> </tr> <tr> <td class="h" > <a name="804">804</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="805">805</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> =cut </td> </tr> <tr> <td class="h" > <a name="806">806</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="807">807</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> sub turtleNamespaces { </td> </tr> <tr> <td class="h" > <a name="808">808</a> </td> <td class="c3" > 8 </td> <td >   </td> <td >   </td> <td class="c3" > <a href="blib-lib-SKOS-Simple-pm--subroutine.html#808-1"> 8 </a> </td> <td class="c3" > <a href="blib-lib-SKOS-Simple-pm--subroutine.html#808-1"> 1 </a> </td> <td > 10 </td> <td class="s"> my $self = shift; </td> </tr> <tr> <td class="h" > <a name="809">809</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="810">810</a> </td> <td class="c3" > 8 </td> <td class="c0" > <a href="blib-lib-SKOS-Simple-pm--branch.html#810-1"> 50 </a> </td> <td class="c0" > <a href="blib-lib-SKOS-Simple-pm--condition.html#810-1"> 33 </a> </td> <td >   </td> <td >   </td> <td > 28 </td> <td class="s"> if ( $self->{uses_dc} and not $self->{namespaces}->{dc} ) { </td> </tr> <tr> <td class="h" > <a name="811">811</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 0 </td> <td class="s"> $self->{namespaces}->{dc} = $NAMESPACES{dc}; </td> </tr> <tr> <td class="h" > <a name="812">812</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="813">813</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="814">814</a> </td> <td class="c3" > 8 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 11 </td> <td class="s"> my @lines; </td> </tr> <tr> <td class="h" > <a name="815">815</a> </td> <td class="c3" > 8 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 10 </td> <td class="s"> foreach my $name (keys %{$self->{namespaces}}) { </td> </tr> <tr> <td class="h" > <a > </a> </td> <td class="c3" > 8 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 31 </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="816">816</a> </td> <td class="c3" > 16 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 63 </td> <td class="s"> push @lines, "\@prefix $name: <" . $self->{namespaces}->{$name} . "> ."; </td> </tr> <tr> <td class="h" > <a name="817">817</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="818">818</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="819">819</a> </td> <td class="c3" > 8 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 48 </td> <td class="s"> return join("\n", @lines) . "\n"; </td> </tr> <tr> <td class="h" > <a name="820">820</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="821">821</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="822">822</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> =head2 turtleBase </td> </tr> <tr> <td class="h" > <a name="823">823</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="824">824</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> Returns a Turtle URI base declaration for this scheme. </td> </tr> <tr> <td class="h" > <a name="825">825</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> An empty string is returned if no URI base is set. </td> </tr> <tr> <td class="h" > <a name="826">826</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="827">827</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> =cut </td> </tr> <tr> <td class="h" > <a name="828">828</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="829">829</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> sub turtleBase { </td> </tr> <tr> <td class="h" > <a name="830">830</a> </td> <td class="c3" > 8 </td> <td >   </td> <td >   </td> <td class="c3" > <a href="blib-lib-SKOS-Simple-pm--subroutine.html#830-1"> 8 </a> </td> <td class="c3" > <a href="blib-lib-SKOS-Simple-pm--subroutine.html#830-1"> 1 </a> </td> <td > 14 </td> <td class="s"> my $self = shift; </td> </tr> <tr> <td class="h" > <a name="831">831</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="832">832</a> </td> <td class="c3" > 8 </td> <td class="c0" > <a href="blib-lib-SKOS-Simple-pm--branch.html#832-1"> 50 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td > 44 </td> <td class="s"> return "" if $self->{base} eq ""; </td> </tr> <tr> <td class="h" > <a name="833">833</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 0 </td> <td class="s"> return "\@base <" . $self->{base} . "> .\n" </td> </tr> <tr> <td class="h" > <a name="834">834</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="835">835</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="836">836</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="837">837</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> =head2 turtleScheme ( [ top => 0 ] ) </td> </tr> <tr> <td class="h" > <a name="838">838</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="839">839</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> Returns RDF statements about the concept scheme in Turtle syntax. </td> </tr> <tr> <td class="h" > <a name="840">840</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> Details about concepts or namespace/base declarations are not included. </td> </tr> <tr> <td class="h" > <a name="841">841</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> The option C<< top => 0 >> (enabled by default) can be used to supress </td> </tr> <tr> <td class="h" > <a name="842">842</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> serializing the C<skos:hasTopConcept> property. </td> </tr> <tr> <td class="h" > <a name="843">843</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="844">844</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> =cut </td> </tr> <tr> <td class="h" > <a name="845">845</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="846">846</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> sub turtleScheme { </td> </tr> <tr> <td class="h" > <a name="847">847</a> </td> <td class="c3" > 14 </td> <td >   </td> <td >   </td> <td class="c3" > <a href="blib-lib-SKOS-Simple-pm--subroutine.html#847-1"> 14 </a> </td> <td class="c3" > <a href="blib-lib-SKOS-Simple-pm--subroutine.html#847-1"> 1 </a> </td> <td > 94 </td> <td class="s"> my ($self,%opt) = @_; </td> </tr> <tr> <td class="h" > <a name="848">848</a> </td> <td class="c3" > 14 </td> <td class="c3" > <a href="blib-lib-SKOS-Simple-pm--branch.html#848-1"> 100 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td > 48 </td> <td class="s"> $opt{top} = 1 unless exists $opt{top}; </td> </tr> <tr> <td class="h" > <a name="849">849</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="850">850</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # note that lean => 1 does not imply top => 0 ! </td> </tr> <tr> <td class="h" > <a name="851">851</a> </td> <td class="c3" > 14 </td> <td class="c3" > <a href="blib-lib-SKOS-Simple-pm--branch.html#851-1"> 100 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td > 36 </td> <td class="s"> if ( $opt{top} ) { </td> </tr> <tr> <td class="h" > <a name="852">852</a> </td> <td class="c3" > 10 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 29 </td> <td class="s"> my @top = $self->topConcepts(); </td> </tr> <tr> <td class="h" > <a name="853">853</a> </td> <td class="c3" > 10 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 36 </td> <td class="s"> $self->{prop}->{'skos:hasTopConcept'} = [ map { "<$_>" } @top ]; </td> </tr> <tr> <td class="h" > <a > </a> </td> <td class="c3" > 1 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 10 </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="854">854</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } else { </td> </tr> <tr> <td class="h" > <a name="855">855</a> </td> <td class="c3" > 4 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 12 </td> <td class="s"> delete $self->{prop}->{'skos:hasTopConcept'} </td> </tr> <tr> <td class="h" > <a name="856">856</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="857">857</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="858">858</a> </td> <td class="c3" > 14 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 38 </td> <td class="s"> return turtle_statement( "<" . $self->{scheme} . ">", %{$self->{prop}} ); </td> </tr> <tr> <td class="h" > <a > </a> </td> <td class="c3" > 14 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 82 </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="859">859</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="860">860</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="861">861</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> =head2 turtleConcept ( $id [, %options ] ) </td> </tr> <tr> <td class="h" > <a name="862">862</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="863">863</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> Returns a concept in Turtle syntax. With option C<< top => 0 >> you can disable </td> </tr> <tr> <td class="h" > <a name="864">864</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> serializing the C<skos:topConceptOf> property. By default, each concept is </td> </tr> <tr> <td class="h" > <a name="865">865</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> connected to its concept scheme with either C<skos:topConceptOf>, or with </td> </tr> <tr> <td class="h" > <a name="866">866</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> C<skos:inScheme>. With option C<< scheme => 0 >> you can disable serializing </td> </tr> <tr> <td class="h" > <a name="867">867</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> the latter property. With C<< scheme => 2 >> the property C<skos:inScheme> </td> </tr> <tr> <td class="h" > <a name="868">868</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> is also included in the serialization if C<skos:topConceptOf> is given, </td> </tr> <tr> <td class="h" > <a name="869">869</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> although the former can be derived as super-property of the latter. </td> </tr> <tr> <td class="h" > <a name="870">870</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="871">871</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> =cut </td> </tr> <tr> <td class="h" > <a name="872">872</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="873">873</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> sub turtleConcept { </td> </tr> <tr> <td class="h" > <a name="874">874</a> </td> <td class="c3" > 8 </td> <td >   </td> <td >   </td> <td class="c3" > <a href="blib-lib-SKOS-Simple-pm--subroutine.html#874-1"> 8 </a> </td> <td class="c3" > <a href="blib-lib-SKOS-Simple-pm--subroutine.html#874-1"> 1 </a> </td> <td > 21 </td> <td class="s"> my ($self,$id,%opt) = @_; </td> </tr> <tr> <td class="h" > <a name="875">875</a> </td> <td class="c3" > 8 </td> <td class="c3" > <a href="blib-lib-SKOS-Simple-pm--branch.html#875-1"> 100 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td > 32 </td> <td class="s"> $opt{top} = 1 unless exists $opt{top}; </td> </tr> <tr> <td class="h" > <a name="876">876</a> </td> <td class="c3" > 8 </td> <td class="c3" > <a href="blib-lib-SKOS-Simple-pm--branch.html#876-1"> 100 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td > 25 </td> <td class="s"> $opt{top} = 0 if $opt{lean}; </td> </tr> <tr> <td class="h" > <a name="877">877</a> </td> <td class="c3" > 8 </td> <td class="c3" > <a href="blib-lib-SKOS-Simple-pm--branch.html#877-1"> 100 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td > 23 </td> <td class="s"> $opt{scheme} = 1 unless exists $opt{scheme}; </td> </tr> <tr> <td class="h" > <a name="878">878</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="879">879</a> </td> <td class="c3" > 8 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 20 </td> <td class="s"> my $c = $self->{concepts}->{$id}; </td> </tr> <tr> <td class="h" > <a name="880">880</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="881">881</a> </td> <td class="c3" > 8 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 17 </td> <td class="s"> my %stm = ( 'a' => 'skos:Concept' ); </td> </tr> <tr> <td class="h" > <a name="882">882</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="883">883</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # TODO: Support multiple notations </td> </tr> <tr> <td class="h" > <a name="884">884</a> </td> <td class="c3" > 8 </td> <td class="c0" > <a href="blib-lib-SKOS-Simple-pm--branch.html#884-1"> 50 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td > 33 </td> <td class="s"> if ( $c->{notation} ne '' ) { </td> </tr> <tr> <td class="h" > <a name="885">885</a> </td> <td class="c3" > 8 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 29 </td> <td class="s"> $stm{'skos:notation'} = turtle_literal( $c->{notation} ); </td> </tr> <tr> <td class="h" > <a name="886">886</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="887">887</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="888">888</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # Concept Labels: pref, alt, hidden, title </td> </tr> <tr> <td class="h" > <a name="889">889</a> </td> <td class="c3" > 8 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 233 </td> <td class="s"> while ( my ($type,$property) = each %LABEL_TYPES ) { </td> </tr> <tr> <td class="h" > <a name="890">890</a> </td> <td class="c3" > 32 </td> <td class="c0" > <a href="blib-lib-SKOS-Simple-pm--branch.html#890-1"> 50 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td > 154 </td> <td class="s"> next unless $c->{$type}; </td> </tr> <tr> <td class="h" > <a name="891">891</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 0 </td> <td class="s"> my $label = turtle_literal_list( $c->{$type} ); </td> </tr> <tr> <td class="h" > <a name="892">892</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 0 </td> <td class="s"> $stm{$property} = $label; </td> </tr> <tr> <td class="h" > <a name="893">893</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # TODO: entail rdfs:label if requested (pref, alt, hidden) </td> </tr> <tr> <td class="h" > <a name="894">894</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="895">895</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="896">896</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="897">897</a> </td> <td class="c3" > 8 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 21 </td> <td class="s"> foreach my $rel (qw(broader narrower related)) { </td> </tr> <tr> <td class="h" > <a name="898">898</a> </td> <td class="c3" > 24 </td> <td class="c3" > <a href="blib-lib-SKOS-Simple-pm--branch.html#898-1"> 100 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td > 27 </td> <td class="s"> next unless %{$c->{$rel}}; </td> </tr> <tr> <td class="h" > <a > </a> </td> <td class="c3" > 24 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 160 </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="899">899</a> </td> <td class="c3" > 2 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 3 </td> <td class="s"> $stm{"skos:$rel"} = [ map { "<$_>" } keys %{$c->{$rel}} ]; </td> </tr> <tr> <td class="h" > <a > </a> </td> <td class="c3" > 2 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 13 </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a > </a> </td> <td class="c3" > 2 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 8 </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="900">900</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="901">901</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="902">902</a> </td> <td class="c3" > 8 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 15 </td> <td class="s"> my $is_top = 0; </td> </tr> <tr> <td class="h" > <a name="903">903</a> </td> <td class="c3" > 8 </td> <td class="c3" > <a href="blib-lib-SKOS-Simple-pm--branch.html#903-1"> 100 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td > 23 </td> <td class="s"> if ( $opt{top} ) { </td> </tr> <tr> <td class="h" > <a name="904">904</a> </td> <td class="c3" > 4 </td> <td class="c0" > <a href="blib-lib-SKOS-Simple-pm--branch.html#904-1"> 50 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td > 7 </td> <td class="s"> if ( (keys %{ $self->{top} }) ? $self->{top}->{$id} : not %{$c->{broader}} ) { </td> </tr> <tr> <td class="h" > <a > </a> </td> <td class="c3" > 4 </td> <td class="c3" > <a href="blib-lib-SKOS-Simple-pm--branch.html#-2"> 100 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td > 17 </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a > </a> </td> <td class="c3" > 4 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 14 </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="905">905</a> </td> <td class="c3" > 3 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 13 </td> <td class="s"> $stm{"skos:topConceptOf"} = "<" . $self->{scheme} . ">"; </td> </tr> <tr> <td class="h" > <a name="906">906</a> </td> <td class="c3" > 3 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 6 </td> <td class="s"> $is_top = 1; </td> </tr> <tr> <td class="h" > <a name="907">907</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="908">908</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="909">909</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="910">910</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # [S7] skos:topConceptOf is a sub-property of skos:inScheme </td> </tr> <tr> <td class="h" > <a name="911">911</a> </td> <td class="c3" > 8 </td> <td class="c3" > <a href="blib-lib-SKOS-Simple-pm--branch.html#911-1"> 100 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td > 26 </td> <td class="s"> if ( $opt{scheme} - $is_top > 0 ) { </td> </tr> <tr> <td class="h" > <a name="912">912</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # TODO: with 'lean' => 1 and not top => 0 </td> </tr> <tr> <td class="h" > <a name="913">913</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # this is implied if the concept is topConcept </td> </tr> <tr> <td class="h" > <a name="914">914</a> </td> <td class="c3" > 5 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 23 </td> <td class="s"> $stm{'skos:inScheme'} = '<' . $self->{scheme} . '>'; </td> </tr> <tr> <td class="h" > <a name="915">915</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="916">916</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="917">917</a> </td> <td class="c3" > 8 </td> <td class="c0" > <a href="blib-lib-SKOS-Simple-pm--branch.html#917-1"> 50 </a> </td> <td class="c0" > <a href="blib-lib-SKOS-Simple-pm--condition.html#917-1"> 33 </a> </td> <td >   </td> <td >   </td> <td > 29 </td> <td class="s"> if ( defined $c->{identifier} and $c->{identifier} ne "" ) { </td> </tr> <tr> <td class="h" > <a name="918">918</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 0 </td> <td class="s"> $stm{'dc:identifier'} = turtle_literal( $c->{identifier} ); </td> </tr> <tr> <td class="h" > <a name="919">919</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="920">920</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="921">921</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # TODO: S17 - infer skos:note only if requested </td> </tr> <tr> <td class="h" > <a name="922">922</a> </td> <td class="c3" > 8 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 49 </td> <td class="s"> foreach my $name ( keys %NOTE_PROPERTIES ) { </td> </tr> <tr> <td class="h" > <a name="923">923</a> </td> <td class="c3" > 56 </td> <td class="c0" > <a href="blib-lib-SKOS-Simple-pm--branch.html#923-1"> 50 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td > 162 </td> <td class="s"> next unless $c->{$name}; </td> </tr> <tr> <td class="h" > <a name="924">924</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 0 </td> <td class="s"> $stm{"skos:$name"} = turtle_literal_list( $c->{$name} ); </td> </tr> <tr> <td class="h" > <a name="925">925</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="926">926</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="927">927</a> </td> <td class="c3" > 8 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 48 </td> <td class="s"> return turtle_statement( "<$id>", %stm ); </td> </tr> <tr> <td class="h" > <a name="928">928</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="929">929</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="930">930</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> =head2 turtleConcepts ( [ %options ] ) </td> </tr> <tr> <td class="h" > <a name="931">931</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="932">932</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> Returns all concepts in Turtle syntax. </td> </tr> <tr> <td class="h" > <a name="933">933</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="934">934</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> =cut </td> </tr> <tr> <td class="h" > <a name="935">935</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="936">936</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> sub turtleConcepts { </td> </tr> <tr> <td class="h" > <a name="937">937</a> </td> <td class="c3" > 15 </td> <td >   </td> <td >   </td> <td class="c3" > <a href="blib-lib-SKOS-Simple-pm--subroutine.html#937-1"> 15 </a> </td> <td class="c3" > <a href="blib-lib-SKOS-Simple-pm--subroutine.html#937-1"> 1 </a> </td> <td > 6291 </td> <td class="s"> my ($self,%opt) = @_; </td> </tr> <tr> <td class="h" > <a name="938">938</a> </td> <td class="c3" > 15 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 23 </td> <td class="s"> delete $opt{id}; </td> </tr> <tr> <td class="h" > <a name="939">939</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="940">940</a> </td> <td class="c3" > 8 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 100 </td> <td class="s"> return join( "\n", </td> </tr> <tr> <td class="h" > <a name="941">941</a> </td> <td class="c3" > 15 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 108 </td> <td class="s"> map { $self->turtleConcept( $_, %opt ) } </td> </tr> <tr> <td class="h" > <a name="942">942</a> </td> <td class="c3" > 15 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 23 </td> <td class="s"> keys %{ $self->{concepts} } ); </td> </tr> <tr> <td class="h" > <a name="943">943</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="944">944</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="945">945</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> =head1 EXPORTABLE FUNCTIONS </td> </tr> <tr> <td class="h" > <a name="946">946</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="947">947</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> =head2 skos </td> </tr> <tr> <td class="h" > <a name="948">948</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="949">949</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> This is just a shortcut for C<< SKOS::Simple->new >>. </td> </tr> <tr> <td class="h" > <a name="950">950</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="951">951</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> =cut </td> </tr> <tr> <td class="h" > <a name="952">952</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="953">953</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> sub skos { </td> </tr> <tr> <td class="h" > <a name="954">954</a> </td> <td class="c3" > 1 </td> <td >   </td> <td >   </td> <td class="c3" > <a href="blib-lib-SKOS-Simple-pm--subroutine.html#954-1"> 1 </a> </td> <td class="c3" > <a href="blib-lib-SKOS-Simple-pm--subroutine.html#954-1"> 1 </a> </td> <td > 13 </td> <td class="s"> SKOS::Simple->new(@_) </td> </tr> <tr> <td class="h" > <a name="955">955</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="956">956</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="957">957</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> =head2 is_uri ( $uri ) </td> </tr> <tr> <td class="h" > <a name="958">958</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="959">959</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> Copied from L<Data::Validate::URI>, originally by Richard Sonnen. </td> </tr> <tr> <td class="h" > <a name="960">960</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="961">961</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> =cut </td> </tr> <tr> <td class="h" > <a name="962">962</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="963">963</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> sub is_uri{ </td> </tr> <tr> <td class="h" > <a name="964">964</a> </td> <td class="c3" > 7 </td> <td class="c0" > <a href="blib-lib-SKOS-Simple-pm--branch.html#964-1"> 50 </a> </td> <td >   </td> <td class="c3" > <a href="blib-lib-SKOS-Simple-pm--subroutine.html#964-1"> 7 </a> </td> <td class="c3" > <a href="blib-lib-SKOS-Simple-pm--subroutine.html#964-1"> 1 </a> </td> <td > 22 </td> <td class="s"> my $self = shift if ref($_[0]); </td> </tr> <tr> <td class="h" > <a name="965">965</a> </td> <td class="c3" > 7 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 12 </td> <td class="s"> my $value = shift; </td> </tr> <tr> <td class="h" > <a name="966">966</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> </td> </tr> <tr> <td class="h" > <a name="967">967</a> </td> <td class="c3" > 7 </td> <td class="c0" > <a href="blib-lib-SKOS-Simple-pm--branch.html#967-1"> 50 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td > 16 </td> <td class="s"> return unless defined($value); </td> </tr> <tr> <td class="h" > <a name="968">968</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> </td> </tr> <tr> <td class="h" > <a name="969">969</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # check for illegal characters </td> </tr> <tr> <td class="h" > <a name="970">970</a> </td> <td class="c3" > 7 </td> <td class="c0" > <a href="blib-lib-SKOS-Simple-pm--branch.html#970-1"> 50 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td > 29 </td> <td class="s"> return if $value =~ /[^a-z0-9\:\/\?\#\[\]\@\!\$\&\'\(\)\*\+\,\;\=\.\-\_\~\%]/i; </td> </tr> <tr> <td class="h" > <a name="971">971</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> </td> </tr> <tr> <td class="h" > <a name="972">972</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # check for hex escapes that aren't complete </td> </tr> <tr> <td class="h" > <a name="973">973</a> </td> <td class="c3" > 7 </td> <td class="c0" > <a href="blib-lib-SKOS-Simple-pm--branch.html#973-1"> 50 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td > 22 </td> <td class="s"> return if $value =~ /%[^0-9a-f]/i; </td> </tr> <tr> <td class="h" > <a name="974">974</a> </td> <td class="c3" > 7 </td> <td class="c0" > <a href="blib-lib-SKOS-Simple-pm--branch.html#974-1"> 50 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td > 19 </td> <td class="s"> return if $value =~ /%[0-9a-f](:?[^0-9a-f]|$)/i; </td> </tr> <tr> <td class="h" > <a name="975">975</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> </td> </tr> <tr> <td class="h" > <a name="976">976</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # from RFC 3986 </td> </tr> <tr> <td class="h" > <a name="977">977</a> </td> <td class="c3" > 7 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 50 </td> <td class="s"> my($scheme, $authority, $path, $query, $fragment) = </td> </tr> <tr> <td class="h" > <a name="978">978</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> ($value =~ m|(?:([^:/?#]+):)?(?://([^/?#]*))?([^?#]*)(?:\?([^#]*))?(?:#(.*))?|); </td> </tr> <tr> <td class="h" > <a name="979">979</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> </td> </tr> <tr> <td class="h" > <a name="980">980</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # scheme and path are required, though the path can be empty </td> </tr> <tr> <td class="h" > <a name="981">981</a> </td> <td class="c3" > 7 </td> <td class="c0" > <a href="blib-lib-SKOS-Simple-pm--branch.html#981-1"> 50 </a> </td> <td class="c0" > <a href="blib-lib-SKOS-Simple-pm--condition.html#981-1"> 33 </a> </td> <td >   </td> <td >   </td> <td > 108 </td> <td class="s"> return unless (defined($scheme) && length($scheme) && defined($path)); </td> </tr> <tr> <td class="h" > <a > </a> </td> <td >   </td> <td >   </td> <td class="c0" > <a href="blib-lib-SKOS-Simple-pm--condition.html#-2"> 33 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="982">982</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> </td> </tr> <tr> <td class="h" > <a name="983">983</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # if authority is present, the path must be empty or begin with a / </td> </tr> <tr> <td class="h" > <a name="984">984</a> </td> <td class="c3" > 7 </td> <td class="c0" > <a href="blib-lib-SKOS-Simple-pm--branch.html#984-1"> 50 </a> </td> <td class="c0" > <a href="blib-lib-SKOS-Simple-pm--condition.html#984-1"> 33 </a> </td> <td >   </td> <td >   </td> <td > 35 </td> <td class="s"> if(defined($authority) && length($authority)){ </td> </tr> <tr> <td class="h" > <a name="985">985</a> </td> <td class="c3" > 7 </td> <td class="c0" > <a href="blib-lib-SKOS-Simple-pm--branch.html#985-1"> 50 </a> </td> <td class="c0" > <a href="blib-lib-SKOS-Simple-pm--condition.html#985-1"> 66 </a> </td> <td >   </td> <td >   </td> <td > 30 </td> <td class="s"> return unless(length($path) == 0 || $path =~ m!^/!); </td> </tr> <tr> <td class="h" > <a name="986">986</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> </td> </tr> <tr> <td class="h" > <a name="987">987</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } else { </td> </tr> <tr> <td class="h" > <a name="988">988</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # if authority is not present, the path must not start with // </td> </tr> <tr> <td class="h" > <a name="989">989</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-SKOS-Simple-pm--branch.html#989-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td > 0 </td> <td class="s"> return if $path =~ m!^//!; </td> </tr> <tr> <td class="h" > <a name="990">990</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="991">991</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> </td> </tr> <tr> <td class="h" > <a name="992">992</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # scheme must begin with a letter, then consist of letters, digits, +, ., or - </td> </tr> <tr> <td class="h" > <a name="993">993</a> </td> <td class="c3" > 7 </td> <td class="c0" > <a href="blib-lib-SKOS-Simple-pm--branch.html#993-1"> 50 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td > 48 </td> <td class="s"> return unless lc($scheme) =~ m!^[a-z][a-z0-9\+\-\.]*$!; </td> </tr> <tr> <td class="h" > <a name="994">994</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> </td> </tr> <tr> <td class="h" > <a name="995">995</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # re-assemble the URL per section 5.3 in RFC 3986 </td> </tr> <tr> <td class="h" > <a name="996">996</a> </td> <td class="c3" > 7 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 15 </td> <td class="s"> my $out = $scheme . ':'; </td> </tr> <tr> <td class="h" > <a name="997">997</a> </td> <td class="c3" > 7 </td> <td class="c0" > <a href="blib-lib-SKOS-Simple-pm--branch.html#997-1"> 50 </a> </td> <td class="c0" > <a href="blib-lib-SKOS-Simple-pm--condition.html#997-1"> 33 </a> </td> <td >   </td> <td >   </td> <td > 43 </td> <td class="s"> if(defined $authority && length($authority)){ </td> </tr> <tr> <td class="h" > <a name="998">998</a> </td> <td class="c3" > 7 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 15 </td> <td class="s"> $out .= '//' . $authority; </td> </tr> <tr> <td class="h" > <a name="999">999</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="1000">1000</a> </td> <td class="c3" > 7 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 11 </td> <td class="s"> $out .= $path; </td> </tr> <tr> <td class="h" > <a name="1001">1001</a> </td> <td class="c3" > 7 </td> <td class="c0" > <a href="blib-lib-SKOS-Simple-pm--branch.html#1001-1"> 50 </a> </td> <td class="c0" > <a href="blib-lib-SKOS-Simple-pm--condition.html#1001-1"> 33 </a> </td> <td >   </td> <td >   </td> <td > 20 </td> <td class="s"> if(defined $query && length($query)){ </td> </tr> <tr> <td class="h" > <a name="1002">1002</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 0 </td> <td class="s"> $out .= '?' . $query; </td> </tr> <tr> <td class="h" > <a name="1003">1003</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="1004">1004</a> </td> <td class="c3" > 7 </td> <td class="c0" > <a href="blib-lib-SKOS-Simple-pm--branch.html#1004-1"> 50 </a> </td> <td class="c0" > <a href="blib-lib-SKOS-Simple-pm--condition.html#1004-1"> 33 </a> </td> <td >   </td> <td >   </td> <td > 21 </td> <td class="s"> if(defined $fragment && length($fragment)){ </td> </tr> <tr> <td class="h" > <a name="1005">1005</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 0 </td> <td class="s"> $out .= '#' . $fragment; </td> </tr> <tr> <td class="h" > <a name="1006">1006</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="1007">1007</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> </td> </tr> <tr> <td class="h" > <a name="1008">1008</a> </td> <td class="c3" > 7 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 35 </td> <td class="s"> return $out; </td> </tr> <tr> <td class="h" > <a name="1009">1009</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="1010">1010</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="1011">1011</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> =head2 uri_or_empty ( $uri ) </td> </tr> <tr> <td class="h" > <a name="1012">1012</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="1013">1013</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> Checks whether the passed parameter is either an URI or undefined. </td> </tr> <tr> <td class="h" > <a name="1014">1014</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="1015">1015</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> =cut </td> </tr> <tr> <td class="h" > <a name="1016">1016</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="1017">1017</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> sub uri_or_empty { </td> </tr> <tr> <td class="h" > <a name="1018">1018</a> </td> <td class="c3" > 30 </td> <td >   </td> <td class="c0" > <a href="blib-lib-SKOS-Simple-pm--condition.html#1018-1"> 66 </a> </td> <td class="c3" > <a href="blib-lib-SKOS-Simple-pm--subroutine.html#1018-1"> 30 </a> </td> <td class="c3" > <a href="blib-lib-SKOS-Simple-pm--subroutine.html#1018-1"> 1 </a> </td> <td > 227 </td> <td class="s"> return (not defined $_[0] or $_[0] eq '' or is_uri($_[0])); </td> </tr> <tr> <td class="h" > <a name="1019">1019</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="1020">1020</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="1021">1021</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> 1; </td> </tr> <tr> <td class="h" > <a name="1022">1022</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="1023">1023</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> =head1 SEE ALSO </td> </tr> <tr> <td class="h" > <a name="1024">1024</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="1025">1025</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> The SKOS ontology and its semantics is defined in </td> </tr> <tr> <td class="h" > <a name="1026">1026</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> L<http://www.w3.org/TR/skos-primer> and </td> </tr> <tr> <td class="h" > <a name="1027">1027</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> L<http://www.w3.org/TR/skos-reference>. Turtle format </td> </tr> <tr> <td class="h" > <a name="1028">1028</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> is specified at http://www.w3.org/TeamSubmission/turtle/. </td> </tr> <tr> <td class="h" > <a name="1029">1029</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="1030">1030</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> See also L<Biblio::Thesaurus> for a similar module. </td> </tr> <tr> <td class="h" > <a name="1031">1031</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="1032">1032</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> =cut </td> </tr> </table> </body> </html>