1 /*
2 * Licensed to The Apereo Foundation under one or more contributor license
3 * agreements. See the NOTICE file distributed with this work for additional
4 * information regarding copyright ownership.
5 *
6 *
7 * The Apereo Foundation licenses this file to you under the Educational
8 * Community License, Version 2.0 (the "License"); you may not use this file
9 * except in compliance with the License. You may obtain a copy of the License
10 * at:
11 *
12 * http://opensource.org/licenses/ecl2.txt
13 *
14 * Unless required by applicable law or agreed to in writing, software
15 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
16 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
17 * License for the specific language governing permissions and limitations under
18 * the License.
19 *
20 */
21
22
23 package org.opencastproject.metadata.dublincore;
24
25 import org.opencastproject.mediapackage.EName;
26
27 import java.util.List;
28 import java.util.Map;
29 import java.util.Set;
30
31 import javax.annotation.Nullable;
32 import javax.annotation.ParametersAreNonnullByDefault;
33
34 /**
35 * This interface is mainly intended to encapsulate Dublin Core metadata, but it is also capable of maintaining
36 * proprietary metadata alongside the Dublin Core.
37 * <p>
38 * Dublin Core is an initiative to create a digital "library card catalog" for the Web. Dublin Core, in its simple form,
39 * is made up of 15 metadata (data that describes data) elements that offer expanded cataloging information and improved
40 * document indexing for search engine programs.
41 * <p>
42 * Two forms of Dublin Core exist: <code>Simple Dublin Core</code> and <code>Qualified Dublin Core</code>. Simple Dublin
43 * Core expresses properties as literal strings using just the 15 metadata elements from the Dublin Core Metadata
44 * Element Sets. Each element can have multiple values, but order is defined. Values may have an associated language. <br>
45 * Please see <a href="http://dublincore.org/documents/dces/">http://dublincore.org/documents/dces/</a> for further
46 * information.
47 * <p>
48 * Qualified Dublin Core increases the specificity of metadata by extending the set of properties (elements) and by
49 * adding information about encoding schemes. While enabling searches to be more specific, qualifiers are also more
50 * complex and can pose challenges to interoperability. <br>
51 * Please see <a href="http://dublincore.org/documents/dcmi-terms/">http://dublincore.org/documents/dcmi-terms/</a> and
52 * <a href="http://dublincore.org/documents/dc-xml-guidelines/">http://dublincore.org/documents/dc-xml-guidelines/</a>
53 * Section 5 for further information.
54 * <p>
55 * <h2>Current limitations</h2>
56 * <ul>
57 * <li>This interface assumes that Dublin Core metadata is stored as XML. According to the Dublin Core specification
58 * this is not necessary.
59 * <li>Encoding schemes aren't fully supported yet.
60 * </ul>
61 */
62 @ParametersAreNonnullByDefault
63 public interface DublinCore {
64
65 /**
66 * Namespace name of the <code>/terms/</code> namespace. See <a
67 * href="http://dublincore.org/documents/dcmi-terms/">http://dublincore.org/documents/dcmi-terms/</a> for details.
68 */
69 String TERMS_NS_URI = "http://purl.org/dc/terms/";
70
71 /**
72 * Namespace prefix if the <code>/terms/</code> namespace. See <a
73 * href="http://dublincore.org/documents/dcmi-terms/">http://dublincore.org/documents/dcmi-terms/</a> for details.
74 */
75 String TERMS_NS_PREFIX = "dcterms";
76
77 /**
78 * Namespace name of the <code>/elements/1.1/</code> namespace. See <a
79 * href="http://dublincore.org/documents/dces/">http://dublincore.org/documents/dces/</a> for details.
80 */
81 String ELEMENTS_1_1_NS_URI = "http://purl.org/dc/elements/1.1/";
82
83 /**
84 * Namespace prefix if the <code>Elements 1.1</code> namespace. See <a
85 * href="http://dublincore.org/documents/dces/">http://dublincore.org/documents/dces/</a> for details.
86 */
87 String ELEMENTS_1_1_NS_PREFIX = "dc";
88
89 /**
90 * Dublin Core Property <dfn>abstract</dfn> in the /terms/ namespace. See <a
91 * href="http://dublincore.org/documents/dcmi-terms/#terms-abstract">DCMI Terms Abstract</a>.
92 */
93 EName PROPERTY_ABSTRACT = new EName(TERMS_NS_URI, "abstract");
94
95 /**
96 * Dublin Core Property <dfn>accessRights</dfn> in the /terms/ namespace. See <a
97 * href="http://dublincore.org/documents/dcmi-terms/#terms-accessRights">DCMI Terms Access Rights</a>.
98 */
99 EName PROPERTY_ACCESS_RIGHTS = new EName(TERMS_NS_URI, "accessRights");
100
101 /**
102 * Dublin Core Property <dfn>accrualMethod</dfn> in the /terms/ namespace. See <a
103 * href="http://dublincore.org/documents/dcmi-terms/#terms-accrualMethod">DCMI Terms Accrual Method</a>.
104 */
105 EName PROPERTY_ACCRUAL_METHOD = new EName(TERMS_NS_URI, "accrualMethod");
106
107 /**
108 * Dublin Core Property <dfn>accrualPeriodicity</dfn> in the /terms/ namespace. See <a
109 * href="http://dublincore.org/documents/dcmi-terms/#terms-accrualPeriodicity">DCMI Terms Accrual Periodicity</a>.
110 */
111 EName PROPERTY_ACCRUAL_PERIODICITY = new EName(TERMS_NS_URI, "accrualPeriodicity");
112
113 /**
114 * Dublin Core Property <dfn>accrualPolicy</dfn> in the /terms/ namespace. See <a
115 * href="http://dublincore.org/documents/dcmi-terms/#terms-accrualPolicy">DCMI Terms Accrual Policy</a>.
116 */
117 EName PROPERTY_ACCRUAL_POLICY = new EName(TERMS_NS_URI, "accrualPolicy");
118
119 /**
120 * Dublin Core Property <dfn>alternative</dfn> in the /terms/ namespace. See <a
121 * href="http://dublincore.org/documents/dcmi-terms/#terms-alternative">DCMI Terms Alternative</a>.
122 */
123 EName PROPERTY_ALTERNATIVE = new EName(TERMS_NS_URI, "alternative");
124
125 /**
126 * Dublin Core Property <dfn>audience</dfn> in the /terms/ namespace. See <a
127 * href="http://dublincore.org/documents/dcmi-terms/#terms-audience">DCMI Terms Audience</a>.
128 */
129 EName PROPERTY_AUDIENCE = new EName(TERMS_NS_URI, "audience");
130
131 /**
132 * Dublin Core Property <dfn>available</dfn> in the /terms/ namespace. See <a
133 * href="http://dublincore.org/documents/dcmi-terms/#terms-available">DCMI Terms Available</a>.
134 */
135 EName PROPERTY_AVAILABLE = new EName(TERMS_NS_URI, "available");
136
137 /**
138 * Dublin Core Property <dfn>bibliographicCitation</dfn> in the /terms/ namespace. See <a
139 * href="http://dublincore.org/documents/dcmi-terms/#terms-bibliographicCitation">DCMI Terms Bibliographic Citation</a>.
140 */
141 EName PROPERTY_BIBLIOGRAPHIC_CITATION = new EName(TERMS_NS_URI, "bibliographicCitation");
142
143 /**
144 * Dublin Core Property <dfn>conformsTo</dfn> in the /terms/ namespace. See <a
145 * href="http://dublincore.org/documents/dcmi-terms/#terms-conformsTo">DCMI Terms Conforms To</a>.
146 */
147 EName PROPERTY_CONFORMS_TO = new EName(TERMS_NS_URI, "conformsTo");
148
149 /**
150 * Dublin Core Property <dfn>contributor</dfn> in the /terms/ namespace. See <a
151 * href="http://dublincore.org/documents/dcmi-terms/#terms-contributor">DCMI Terms Contributor</a>.
152 */
153 EName PROPERTY_CONTRIBUTOR = new EName(TERMS_NS_URI, "contributor");
154
155 /**
156 * Dublin Core Property <dfn>coverage</dfn> in the /terms/ namespace. See <a
157 * href="http://dublincore.org/documents/dcmi-terms/#terms-coverage">DCMI Terms Coverage</a>.
158 */
159 EName PROPERTY_COVERAGE = new EName(TERMS_NS_URI, "coverage");
160
161 /**
162 * Dublin Core Property <dfn>created</dfn> in the /terms/ namespace. See <a
163 * href="http://dublincore.org/documents/dcmi-terms/#terms-created">DCMI Terms Created</a>.
164 */
165 EName PROPERTY_CREATED = new EName(TERMS_NS_URI, "created");
166
167 /**
168 * Dublin Core Property <dfn>creator</dfn> in the /terms/ namespace. See <a
169 * href="http://dublincore.org/documents/dcmi-terms/#terms-creator">DCMI Terms Creator</a>.
170 */
171 EName PROPERTY_CREATOR = new EName(TERMS_NS_URI, "creator");
172
173 /**
174 * Dublin Core Property <dfn>date</dfn> in the /terms/ namespace. See <a
175 * href="http://dublincore.org/documents/dcmi-terms/#terms-date">DCMI Terms Date</a>.
176 */
177 EName PROPERTY_DATE = new EName(TERMS_NS_URI, "date");
178
179 /**
180 * Dublin Core Property <dfn>dateAccepted</dfn> in the /terms/ namespace. See <a
181 * href="http://dublincore.org/documents/dcmi-terms/#terms-dateAccepted">DCMI Terms Date Accepted</a>.
182 */
183 EName PROPERTY_DATE_ACCEPTED = new EName(TERMS_NS_URI, "dateAccepted");
184
185 /**
186 * Dublin Core Property <dfn>dateCopyrighted</dfn> in the /terms/ namespace. See <a
187 * href="http://dublincore.org/documents/dcmi-terms/#terms-dateCopyrighted">DCMI Terms Date Copyrighted</a>.
188 */
189 EName PROPERTY_DATE_COPYRIGHTED = new EName(TERMS_NS_URI, "dateCopyrighted");
190
191 /**
192 * Dublin Core Property <dfn>dateSubmitted</dfn> in the /terms/ namespace. See <a
193 * href="http://dublincore.org/documents/dcmi-terms/#terms-dateSubmitted">DCMI Terms Date Submitted</a>.
194 */
195 EName PROPERTY_DATE_SUBMITTED = new EName(TERMS_NS_URI, "dateSubmitted");
196
197 /**
198 * Dublin Core Property <dfn>description</dfn> in the /terms/ namespace. See <a
199 * href="http://dublincore.org/documents/dcmi-terms/#terms-description">DCMI Terms Description</a>.
200 */
201 EName PROPERTY_DESCRIPTION = new EName(TERMS_NS_URI, "description");
202
203 /**
204 * Dublin Core Property <dfn>educationLevel</dfn> in the /terms/ namespace. See <a
205 * href="http://dublincore.org/documents/dcmi-terms/#terms-educationLevel">DCMI Terms Education Level</a>.
206 */
207 EName PROPERTY_EDUCATION_LEVEL = new EName(TERMS_NS_URI, "educationLevel");
208
209 /**
210 * Dublin Core Property <dfn>extent</dfn> in the /terms/ namespace. See <a
211 * href="http://dublincore.org/documents/dcmi-terms/#terms-extent">DCMI Terms Extent</a>.
212 */
213 EName PROPERTY_EXTENT = new EName(TERMS_NS_URI, "extent");
214
215 /**
216 * Dublin Core Property <dfn>format</dfn> in the /terms/ namespace. See <a
217 * href="http://dublincore.org/documents/dcmi-terms/#terms-format">DCMI Terms Format</a>.
218 */
219 EName PROPERTY_FORMAT = new EName(TERMS_NS_URI, "format");
220
221 /**
222 * Dublin Core Property <dfn>hasFormat</dfn> in the /terms/ namespace. See <a
223 * href="http://dublincore.org/documents/dcmi-terms/#terms-hasFormat">DCMI Terms Has Format</a>.
224 */
225 EName PROPERTY_HAS_FORMAT = new EName(TERMS_NS_URI, "hasFormat");
226
227 /**
228 * Dublin Core Property <dfn>hasPart</dfn> in the /terms/ namespace. See <a
229 * href="http://dublincore.org/documents/dcmi-terms/#terms-hasPart">DCMI Terms Has Part</a>.
230 */
231 EName PROPERTY_HAS_PART = new EName(TERMS_NS_URI, "hasPart");
232
233 /**
234 * Dublin Core Property <dfn>hasVersion</dfn> in the /terms/ namespace. See <a
235 * href="http://dublincore.org/documents/dcmi-terms/#terms-hasVersion">DCMI Terms Has Version</a>.
236 */
237 EName PROPERTY_HAS_VERSION = new EName(TERMS_NS_URI, "hasVersion");
238
239 /**
240 * Dublin Core Property <dfn>identifier</dfn> in the /terms/ namespace. See <a
241 * href="http://dublincore.org/documents/dcmi-terms/#terms-identifier">DCMI Terms Identifier</a>.
242 */
243 EName PROPERTY_IDENTIFIER = new EName(TERMS_NS_URI, "identifier");
244
245 /**
246 * Dublin Core Property <dfn>instructionalMethod</dfn> in the /terms/ namespace. See <a
247 * href="http://dublincore.org/documents/dcmi-terms/#terms-instructionalMethod">DCMI Terms Instructional Method</a>.
248 */
249 EName PROPERTY_INSTRUCTIONAL_METHOD = new EName(TERMS_NS_URI, "instructionalMethod");
250
251 /**
252 * Dublin Core Property <dfn>isFormatOf</dfn> in the /terms/ namespace. See <a
253 * href="http://dublincore.org/documents/dcmi-terms/#terms-isFormatOf">DCMI Terms Is Format Of</a>.
254 */
255 EName PROPERTY_IS_FORMAT_OF = new EName(TERMS_NS_URI, "isFormatOf");
256
257 /**
258 * Dublin Core Property <dfn>isPartOf</dfn> in the /terms/ namespace. See <a
259 * href="http://dublincore.org/documents/dcmi-terms/#terms-isPartOf">DCMI Terms Is Part Of</a>.
260 */
261 EName PROPERTY_IS_PART_OF = new EName(TERMS_NS_URI, "isPartOf");
262
263 /**
264 * Dublin Core Property <dfn>isReferencedBy</dfn> in the /terms/ namespace. See <a
265 * href="http://dublincore.org/documents/dcmi-terms/#terms-isReferencedBy">DCMI Terms Is Referenced By</a>.
266 */
267 EName PROPERTY_IS_REFERENCED_BY = new EName(TERMS_NS_URI, "isReferencedBy");
268
269 /**
270 * Dublin Core Property <dfn>isReplacedBy</dfn> in the /terms/ namespace. See <a
271 * href="http://dublincore.org/documents/dcmi-terms/#terms-isReplacedBy">DCMI Terms Is Replaced By</a>.
272 */
273 EName PROPERTY_IS_REPLACED_BY = new EName(TERMS_NS_URI, "isReplacedBy");
274
275 /**
276 * Dublin Core Property <dfn>isRequiredBy</dfn> in the /terms/ namespace. See <a
277 * href="http://dublincore.org/documents/dcmi-terms/#terms-isRequiredBy">DCMI Terms Is Required By</a>.
278 */
279 EName PROPERTY_IS_REQUIRED_BY = new EName(TERMS_NS_URI, "isRequiredBy");
280
281 /**
282 * Dublin Core Property <dfn>issued</dfn> in the /terms/ namespace. See <a
283 * href="http://dublincore.org/documents/dcmi-terms/#terms-issued">DCMI Terms Issued</a>.
284 */
285 EName PROPERTY_ISSUED = new EName(TERMS_NS_URI, "issued");
286
287 /**
288 * Dublin Core Property <dfn>isVersionOf</dfn> in the /terms/ namespace. See <a
289 * href="http://dublincore.org/documents/dcmi-terms/#terms-isVersionOf">DCMI Terms Is Version Of</a>.
290 */
291 EName PROPERTY_IS_VERSION_OF = new EName(TERMS_NS_URI, "isVersionOf");
292
293 /**
294 * Dublin Core Property <dfn>language</dfn> in the /terms/ namespace. See <a
295 * href="http://dublincore.org/documents/dcmi-terms/#terms-language">DCMI Terms Language</a>.
296 */
297 EName PROPERTY_LANGUAGE = new EName(TERMS_NS_URI, "language");
298
299 /**
300 * Dublin Core Property <dfn>license</dfn> in the /terms/ namespace. See <a
301 * href="http://dublincore.org/documents/dcmi-terms/#terms-license">DCMI Terms License</a>.
302 */
303 EName PROPERTY_LICENSE = new EName(TERMS_NS_URI, "license");
304
305 /**
306 * Dublin Core Property <dfn>mediator</dfn> in the /terms/ namespace. See <a
307 * href="http://dublincore.org/documents/dcmi-terms/#terms-mediator">DCMI Terms Mediator</a>.
308 */
309 EName PROPERTY_MEDIATOR = new EName(TERMS_NS_URI, "mediator");
310
311 /**
312 * Dublin Core Property <dfn>medium</dfn> in the /terms/ namespace. See <a
313 * href="http://dublincore.org/documents/dcmi-terms/#terms-medium">DCMI Terms Medium</a>.
314 */
315 EName PROPERTY_MEDIUM = new EName(TERMS_NS_URI, "medium");
316
317 /**
318 * Dublin Core Property <dfn>modified</dfn> in the /terms/ namespace. See <a
319 * href="http://dublincore.org/documents/dcmi-terms/#terms-modified">DCMI Terms Modified</a>.
320 */
321 EName PROPERTY_MODIFIED = new EName(TERMS_NS_URI, "modified");
322
323 /**
324 * Dublin Core Property <dfn>provenance</dfn> in the /terms/ namespace. See <a
325 * href="http://dublincore.org/documents/dcmi-terms/#terms-provenance">DCMI Terms Provenance</a>.
326 */
327 EName PROPERTY_PROVENANCE = new EName(TERMS_NS_URI, "provenance");
328
329 /**
330 * Dublin Core Property <dfn>publisher</dfn> in the /terms/ namespace. See <a
331 * href="http://dublincore.org/documents/dcmi-terms/#terms-publisher">DCMI Terms Publisher</a>.
332 */
333 EName PROPERTY_PUBLISHER = new EName(TERMS_NS_URI, "publisher");
334
335 /**
336 * Dublin Core Property <dfn>references</dfn> in the /terms/ namespace. See <a
337 * href="http://dublincore.org/documents/dcmi-terms/#terms-references">DCMI Terms References</a>.
338 */
339 EName PROPERTY_REFERENCES = new EName(TERMS_NS_URI, "references");
340
341 /**
342 * Dublin Core Property <dfn>relation</dfn> in the /terms/ namespace. See <a
343 * href="http://dublincore.org/documents/dcmi-terms/#terms-relation">DCMI Terms Relation</a>.
344 */
345 EName PROPERTY_RELATION = new EName(TERMS_NS_URI, "relation");
346
347 /**
348 * Dublin Core Property <dfn>replaces</dfn> in the /terms/ namespace. See <a
349 * href="http://dublincore.org/documents/dcmi-terms/#terms-replaces">DCMI Terms Replaces</a>.
350 */
351 EName PROPERTY_REPLACES = new EName(TERMS_NS_URI, "replaces");
352
353 /**
354 * Dublin Core Property <dfn>requires</dfn> in the /terms/ namespace. See <a
355 * href="http://dublincore.org/documents/dcmi-terms/#terms-requires">DCMI Terms Requires</a>.
356 */
357 EName PROPERTY_REQUIRES = new EName(TERMS_NS_URI, "requires");
358
359 /**
360 * Dublin Core Property <dfn>rights</dfn> in the /terms/ namespace. See <a
361 * href="http://dublincore.org/documents/dcmi-terms/#terms-rights">DCMI Terms Rights</a>.
362 */
363 EName PROPERTY_RIGHTS = new EName(TERMS_NS_URI, "rights");
364
365 /**
366 * Dublin Core Property <dfn>rightsHolder</dfn> in the /terms/ namespace. See <a
367 * href="http://dublincore.org/documents/dcmi-terms/#terms-rightsHolder">DCMI Terms Rights Holder</a>.
368 */
369 EName PROPERTY_RIGHTS_HOLDER = new EName(TERMS_NS_URI, "rightsHolder");
370
371 /**
372 * Dublin Core Property <dfn>source</dfn> in the /terms/ namespace. See <a
373 * href="http://dublincore.org/documents/dcmi-terms/#terms-source">DCMI Terms Source</a>.
374 */
375 EName PROPERTY_SOURCE = new EName(TERMS_NS_URI, "source");
376
377 /**
378 * Dublin Core Property <dfn>spatial</dfn> in the /terms/ namespace. See <a
379 * href="http://dublincore.org/documents/dcmi-terms/#terms-spatial">DCMI Terms Spatial</a>.
380 */
381 EName PROPERTY_SPATIAL = new EName(TERMS_NS_URI, "spatial");
382
383 /**
384 * Dublin Core Property <dfn>subject</dfn> in the /terms/ namespace. See <a
385 * href="http://dublincore.org/documents/dcmi-terms/#terms-subject">DCMI Terms Subject</a>.
386 */
387 EName PROPERTY_SUBJECT = new EName(TERMS_NS_URI, "subject");
388
389 /**
390 * Dublin Core Property <dfn>tableOfContents</dfn> in the /terms/ namespace. See <a
391 * href="http://dublincore.org/documents/dcmi-terms/#terms-tableOfContents">DCMI Terms Table Of Contents</a>.
392 */
393 EName PROPERTY_TABLE_OF_CONTENTS = new EName(TERMS_NS_URI, "tableOfContents");
394
395 /**
396 * Dublin Core Property <dfn>temporal</dfn> in the /terms/ namespace. See <a
397 * href="http://dublincore.org/documents/dcmi-terms/#terms-temporal">DCMI Terms Temporal</a>.
398 */
399 EName PROPERTY_TEMPORAL = new EName(TERMS_NS_URI, "temporal");
400
401 /**
402 * Dublin Core Property <dfn>title</dfn> in the /terms/ namespace. See <a
403 * href="http://dublincore.org/documents/dcmi-terms/#terms-title">DCMI Terms Title</a>.
404 */
405 EName PROPERTY_TITLE = new EName(TERMS_NS_URI, "title");
406
407 /**
408 * Dublin Core Property <dfn>type</dfn> in the /terms/ namespace. See <a
409 * href="http://dublincore.org/documents/dcmi-terms/#terms-type">DCMI Terms Type</a>.
410 */
411 EName PROPERTY_TYPE = new EName(TERMS_NS_URI, "type");
412
413 /**
414 * Dublin Core Property <dfn>valid</dfn> in the /terms/ namespace. See <a
415 * href="http://dublincore.org/documents/dcmi-terms/#terms-valid">DCMI Terms Valid</a>.
416 */
417 EName PROPERTY_VALID = new EName(TERMS_NS_URI, "valid");
418
419 /**
420 * Syntax encoding scheme <code>Box</code>. See <a
421 * href="http://dublincore.org/documents/dcmi-terms/#H5">http://dublincore.org/documents/dcmi-terms/#H5</a>
422 */
423 EName ENC_SCHEME_BOX = new EName(TERMS_NS_URI, "Box");
424
425 /**
426 * Syntax encoding scheme <code>ISO3166</code>. See <a
427 * href="http://dublincore.org/documents/dcmi-terms/#H5">http://dublincore.org/documents/dcmi-terms/#H5</a>
428 */
429 EName ENC_SCHEME_ISO3166 = new EName(TERMS_NS_URI, "ISO3166");
430
431 /**
432 * Syntax encoding scheme <code>ISO639-1</code>. See <a
433 * href="http://dublincore.org/documents/dcmi-terms/#H5">http://dublincore.org/documents/dcmi-terms/#H5</a>
434 */
435 EName ENC_SCHEME_ISO639_2 = new EName(TERMS_NS_URI, "ISO639-1");
436
437 /**
438 * Syntax encoding scheme <code>ISO639-3</code>. See <a
439 * href="http://dublincore.org/documents/dcmi-terms/#H5">http://dublincore.org/documents/dcmi-terms/#H5</a>
440 */
441 EName ENC_SCHEME_ISO639_3 = new EName(TERMS_NS_URI, "ISO639-3");
442
443 /**
444 * Syntax encoding scheme <code>Period</code>. See <a
445 * href="http://dublincore.org/documents/dcmi-terms/#H5">http://dublincore.org/documents/dcmi-terms/#H5</a>
446 */
447 EName ENC_SCHEME_PERIOD = new EName(TERMS_NS_URI, "Period");
448
449 /**
450 * Syntax encoding scheme <code>Point</code>. See <a
451 * href="http://dublincore.org/documents/dcmi-terms/#H5">http://dublincore.org/documents/dcmi-terms/#H5</a>
452 */
453 EName ENC_SCHEME_POINT = new EName(TERMS_NS_URI, "Point");
454
455 /**
456 * Syntax encoding scheme <code>RFC1766</code>. See <a
457 * href="http://dublincore.org/documents/dcmi-terms/#H5">http://dublincore.org/documents/dcmi-terms/#H5</a>
458 */
459 EName ENC_SCHEME_RFC1766 = new EName(TERMS_NS_URI, "RFC1766");
460
461 /**
462 * Syntax encoding scheme <code>RFC3066</code>. See <a
463 * href="http://dublincore.org/documents/dcmi-terms/#H5">http://dublincore.org/documents/dcmi-terms/#H5</a>
464 */
465 EName ENC_SCHEME_RFC3066 = new EName(TERMS_NS_URI, "RFC3066");
466
467 /**
468 * Syntax encoding scheme <code>RFC4646</code>. See <a
469 * href="http://dublincore.org/documents/dcmi-terms/#H5">http://dublincore.org/documents/dcmi-terms/#H5</a>
470 */
471 EName ENC_SCHEME_RFC4646 = new EName(TERMS_NS_URI, "RFC4646");
472
473 /**
474 * Syntax encoding scheme <code>URI</code>. See <a
475 * href="http://dublincore.org/documents/dcmi-terms/#H5">http://dublincore.org/documents/dcmi-terms/#H5</a>
476 */
477 EName ENC_SCHEME_URI = new EName(TERMS_NS_URI, "URI");
478
479 /**
480 * Syntax encoding scheme <code>W3CDTF</code>. See <a
481 * href="http://dublincore.org/documents/dcmi-terms/#H5">http://dublincore.org/documents/dcmi-terms/#H5</a>
482 */
483 EName ENC_SCHEME_W3CDTF = new EName(TERMS_NS_URI, "W3CDTF");
484
485 /**
486 * Syntax encoding scheme <code>ISO8601</code> used for durations. See <a
487 * href="http://en.wikipedia.org/wiki/ISO_8601#Durations">http://en.wikipedia.org/wiki/ISO_8601#Durations</a>
488 */
489 EName ENC_SCHEME_ISO8601 = new EName(TERMS_NS_URI, "ISO8601");
490
491 /* Language constants */
492
493 /** Language code for properties without language information. */
494 String LANGUAGE_UNDEFINED = "__";
495
496 /**
497 * Language code that matches any language.
498 * <p>
499 * Use this code whenever you need values in <em>all</em> languages or you don't care about the language. Note that
500 * all methods taking this as a legal value for the language parameter are adviced to return at first a value for
501 * {@link #LANGUAGE_UNDEFINED} if multiple values exist and only one value is wanted.
502 */
503 String LANGUAGE_ANY = "**";
504
505 /**
506 * Get all values of a property, either in a certain language or in all contained languages.
507 *
508 * @param property
509 * the property qname
510 * @param language
511 * a language code, {@link #LANGUAGE_UNDEFINED} or {@link #LANGUAGE_ANY}
512 * @return a list of values which is empty if the property is not set
513 */
514 List<String> get(EName property, String language);
515
516 /**
517 * Get all values of a property no matter what language they have.
518 *
519 * @param property
520 * the property's expanded name
521 * @return a list of values
522 */
523 List<DublinCoreValue> get(EName property);
524
525 /** Get all contained values grouped by property. */
526 Map<EName, List<DublinCoreValue>> getValues();
527
528 /** Get all values as a flat list. */
529 List<DublinCoreValue> getValuesFlat();
530
531 /**
532 * Like {@link #get(EName, String)} but returns only the first value of the list. This method is intended to be a
533 * convenience method for those properties that have only one value.
534 * <p>
535 * Please note, that if you pass {@link #LANGUAGE_ANY}, values with an {@link #LANGUAGE_UNDEFINED undefined language}
536 * are returned preferably.
537 *
538 * @param property
539 * the property's expanded name
540 * @param language
541 * a language code, {@link #LANGUAGE_UNDEFINED} or {@link #LANGUAGE_ANY}
542 * @return the value or null
543 */
544 @Nullable String getFirst(EName property, String language);
545
546 /**
547 * Get the first value of a property, no matter what language it is in. Like a call of
548 * {@link #getFirst(EName, String)} with <code>language = {@link #LANGUAGE_ANY}</code>. Please not that values with an {@link #LANGUAGE_UNDEFINED undefined
549 * language} are returned preferably.
550 *
551 * @param property
552 * the property's expanded name
553 * @return the value or null
554 * @see #getFirst(EName, String)
555 */
556 @Nullable String getFirst(EName property);
557
558 /**
559 * Get the first value of a property, no matter what language it is in. Like a call of
560 * {@link #getFirst(EName, String)} with <code>language = {@link #LANGUAGE_ANY}</code>. Please not that values with an {@link #LANGUAGE_UNDEFINED undefined
561 * language} are returned preferably.
562 *
563 * @param property
564 * the property's expanded name
565 * @return the value or null
566 * @see #getFirst(EName, String)
567 */
568 @Nullable DublinCoreValue getFirstVal(EName property);
569
570 /**
571 * Return all values separated by a delimiter.
572 *
573 * @param property
574 * the property's expanded name
575 * @param language
576 * a language code, {@link #LANGUAGE_UNDEFINED} or {@link #LANGUAGE_ANY}
577 * @param delimiter
578 * a delimiter
579 * @return the concatenated values or null (FIXME bad API. Should not return null)
580 */
581 @Nullable String getAsText(EName property, String language, String delimiter);
582
583 /**
584 * Return all languages this property has values in.
585 *
586 * @param property
587 * the property's expanded name
588 * @return a set of languages which may be empty in case the property does not have any value. Note that the state of
589 * having no language defined ({@link #LANGUAGE_UNDEFINED}) is treated like a language.
590 */
591 Set<String> getLanguages(EName property);
592
593 /**
594 * Check, if a property has multiple values assigned.
595 *
596 * @param property
597 * the property's expanded name
598 * @param language
599 * a language code, {@link #LANGUAGE_UNDEFINED} or {@link #LANGUAGE_ANY}
600 */
601 boolean hasMultipleValues(EName property, String language);
602
603 /**
604 * Check if a property has multiple values, ignoring any language information.
605 *
606 * @param property
607 * the property's expanded name
608 */
609 boolean hasMultipleValues(EName property);
610
611 /**
612 * Check if a property has at least one value assigned.
613 *
614 * @param property
615 * the property's expanded name
616 * @param language
617 * a language code, {@link #LANGUAGE_UNDEFINED} or {@link #LANGUAGE_ANY}
618 */
619 boolean hasValue(EName property, String language);
620
621 /**
622 * Check if a property has at least on value without language information assigned. Like a call of
623 * {@link #hasValue(EName)} with <code>language = {@link #LANGUAGE_ANY}</code>
624 *
625 * @param property
626 * the property's expanded name
627 */
628 boolean hasValue(EName property);
629
630 /**
631 * Set a property to the given value, overwriting an existing value in the given language.
632 * <p>
633 * Please note that it is not allowed to pass {@link #LANGUAGE_ANY} as <code>language</code>.
634 *
635 * @param property
636 * the property's expanded name
637 * @param value
638 * the value or null to remove all values of the given language for this property
639 * @param language
640 * a language code or {@link #LANGUAGE_UNDEFINED}
641 */
642 void set(EName property, @Nullable String value, String language);
643
644 /**
645 * Set a value without language information to a property, overwriting an existing value. This is like calling
646 * {@link #set(EName, String, String)} with <code>language = {@link #LANGUAGE_UNDEFINED}</code>
647 *
648 * @param property
649 * the property's expanded name
650 * @param value
651 * the value or null to remove all values of {@link #LANGUAGE_UNDEFINED} for this property
652 */
653 void set(EName property, @Nullable String value);
654
655 /**
656 * Set a property to a value, overwriting an existing value.
657 *
658 * @param property
659 * the property's expanded name
660 * @param value
661 * the value or null to completely remove the property (all values in all languages)
662 */
663 void set(EName property, @Nullable DublinCoreValue value);
664
665 /**
666 * Set a property to a list of values, overwriting any existing.
667 *
668 * @param property
669 * the property's expanded name
670 * @param values
671 * the values or an empty list
672 */
673 void set(EName property, List<DublinCoreValue> values);
674
675 /**
676 * Add a value to a property.
677 * <p>
678 * Please note that it is not allowed to pass {@link #LANGUAGE_ANY} as <code>language</code>.
679 *
680 * @param property
681 * the property's expanded name
682 * @param value
683 * the value
684 * @param language
685 * a language code or {@link #LANGUAGE_UNDEFINED}
686 */
687 void add(EName property, String value, String language);
688
689 /**
690 * Add a value without language information to a property. This is like calling {@link #add(EName, String, String)}
691 * with <code>language = {@link #LANGUAGE_UNDEFINED}</code>
692 *
693 * @param property
694 * the property's expanded name
695 * @param value
696 * the value
697 */
698 void add(EName property, String value);
699
700 /**
701 * Add a value to a property.
702 *
703 * @param property
704 * the property's expanded name
705 * @param value
706 * the value
707 */
708 void add(EName property, DublinCoreValue value);
709
710 /**
711 * Remove values of a property.
712 * <ul>
713 * <li> {@link #LANGUAGE_ANY}: remove the whole element
714 * <li> {@link #LANGUAGE_UNDEFINED}: remove only values with no language information
715 * <li>language code: remove values of that language
716 * </ul>
717 *
718 * @param property
719 * the property's expanded name
720 * @param language
721 * a language code, {@link #LANGUAGE_UNDEFINED} or {@link #LANGUAGE_ANY}
722 */
723 void remove(EName property, String language);
724
725 /**
726 * Remove a complete property.
727 *
728 * @param property
729 * the property's expanded name
730 */
731 void remove(EName property);
732
733 /** Clear the Dublin Core */
734 void clear();
735
736 /**
737 * Return all contained properties.
738 *
739 * @return a set of property names
740 */
741 Set<EName> getProperties();
742 }