root/tags/the-whole-shebang-0.9.1_rc1/ambra/libs/otm-models/src/main/java/org/topazproject/ambra/models/DublinCore.java

Revision 7193, 15.3 KB (checked in by amit, 18 months ago)

Formatting fixes.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id HeadURL Revision
Line 
1/* $HeadURL::                                                                                     $
2 * $Id$
3 *
4 * Copyright (c) 2006-2008 by Topaz, Inc.
5 * http://topazproject.org
6 *
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
10 *
11 *     http://www.apache.org/licenses/LICENSE-2.0
12 *
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 */
19package org.topazproject.ambra.models;
20
21import java.io.Serializable;
22import java.net.URI;
23import java.util.Date;
24import java.util.List;
25import java.util.Set;
26import java.util.HashSet;
27
28import org.topazproject.otm.CascadeType;
29import org.topazproject.otm.annotations.Predicate;
30import org.topazproject.otm.annotations.Searchable;
31
32/**
33 * Model for a subset of the elements of the Dublin Core metadata
34 * specification. Details on the specification and the individual elements can
35 * be found at http://dublincore.org/documents/dcmi-terms/.
36 *
37 * Please note that in most cases the function names map directly into the term
38 * name.
39 *
40 * @author Amit Kapoor
41 */
42public class DublinCore implements Serializable {
43  private static final long serialVersionUID = -3010297971167417038L;
44
45  private String         title;
46  private String         description;
47  private Set<String>    creators = new HashSet<String>();
48  private Date           date;
49  private String         identifier;
50  private String         rights;
51  private URI            type;
52  private Set<String>    contributors = new HashSet<String>();
53  private Set<String>    subjects = new HashSet<String>();
54  private String         language;
55  private String         publisher;
56  private String         format;
57  private Object         source;
58  private Date           available;
59  private Date           issued;
60  private Date           submitted;
61  private Date           accepted;
62  private Integer        copyrightYear;
63  private Set<String>    summary;
64  private Citation       bibliographicCitation;
65  private Date           created;
66  private Set<License>   license;
67  private Date           modified;
68  private List<Citation> references;
69  private URI            conformsTo;
70
71  /**
72   * Empty contructor
73   */
74  public DublinCore() {
75  }
76
77  /**
78   * Return the list of creators of the object. Examples of a Creator include a person, an
79   * organization, or a service. Typically, the name of a Creator should be used to indicate the
80   * entity.
81   *
82   * @return the creators
83   */
84  public Set<String> getCreators() {
85    return creators;
86  }
87
88  /**
89   * Set the list of creators of the object.
90   *
91   * @param creators the set of creators for this object
92   */
93  @Searchable(index = "lucene")
94  @Predicate(uri = "dc:creator")
95  public void setCreators(Set<String> creators) {
96    this.creators = creators;
97  }
98
99  /**
100   * Return the list of contributors. Examples of a Contributor include a person, an organization,
101   * or a service. Typically, the name of a Contributor should be used to indicate the entity.
102   *
103   * @return the contributors
104   */
105  public Set<String> getContributors() {
106    return contributors;
107  }
108
109  /**
110   * Set the list of contributors.
111   *
112   * @param contributors the contributors to set
113   * @see #getContributors
114   */
115  @Searchable(index = "lucene")
116  @Predicate(uri = "dc:contributor")
117  public void setContributors(Set<String> contributors) {
118    this.contributors = contributors;
119  }
120
121  /**
122   * Return the date. Date may be used to express temporal information at any level of granularity.
123   * Recommended best practice is to use an encoding scheme, such as the W3CDTF profile of ISO 8601
124   * [W3CDTF].
125   *
126   * @return the date
127   */
128  public Date getDate() {
129    return date;
130  }
131
132  /**
133   * Set the date.
134   *
135   * @param date the date to set
136   * @see #getDate
137   */
138  @Predicate(uri = "dc:date", dataType = "xsd:date")
139  public void setDate(Date date) {
140    this.date = date;
141  }
142
143  /**
144   * Return the type of the object. Recommended best practice is to use a controlled vocabulary such
145   * as the DCMI Type Vocabulary [DCMITYPE]. To describe the file format, physical medium, or
146   * dimensions of the resource, use the Format element.
147   *
148   * @return the type
149   */
150  public URI getType() {
151    return type;
152  }
153
154  /**
155   * Set the type of the object.
156   *
157   * @param type the type to set
158   * @see #getType
159   */
160  @Predicate(uri = "dc:type")
161  public void setType(URI type) {
162    this.type = type;
163  }
164
165  /**
166   * Return the description of the object. Description may include but is not limited to: an
167   * abstract, a table of contents, a graphical representation, or a free-text account of the
168   * resource.
169   *
170   * @return the description
171   */
172  public String getDescription() {
173    return description;
174  }
175
176  /**
177   * Set the description of the object.
178   *
179   * @param description the description to set
180   * @see #getDescription
181   */
182  @Searchable(index = "lucene")
183  @Predicate(uri = "dc:description", dataType = "rdf:XMLLiteral")
184  public void setDescription(String description) {
185    this.description = description;
186  }
187
188  /**
189   * Return the identifier of the object. Recommended best practice is to identify the resource by
190   * means of a string conforming to a formal identification system.
191   *
192   * @return the identifier
193   */
194  public String getIdentifier() {
195    return identifier;
196  }
197
198  /**
199   * Set the identifier of the object.
200   *
201   * @param identifier the identifier to set
202   * @see #getIdentifier
203   */
204  @Predicate(uri = "dc:identifier")
205  public void setIdentifier(String identifier) {
206    this.identifier = identifier;
207  }
208
209  /**
210   * Return the rights of the objects. Typically, rights information includes a statement about
211   * various property rights associated with the resource, including intellectual property rights.
212   *
213   * @return the rights
214   */
215  public String getRights() {
216    return rights;
217  }
218
219  /**
220   * Set the rights of the object.
221   *
222   * @param rights the rights to set
223   * @see #getRights
224   */
225  @Searchable(index = "lucene")
226  @Predicate(uri = "dc:rights", dataType = "rdf:XMLLiteral")
227  public void setRights(String rights) {
228    this.rights = rights;
229  }
230
231  /**
232   * Return the title of the object. Typically, a Title will be a name by which the resource is
233   * formally known.
234   *
235   * @return the title
236   */
237  public String getTitle() {
238    return title;
239  }
240
241  /**
242   * Set the title of the object.
243   *
244   * @param title the title to set
245   * @see #getTitle
246   */
247  @Searchable(index = "lucene")
248  @Predicate(uri = "dc:title", dataType = "rdf:XMLLiteral")
249  public void setTitle(String title) {
250    this.title = title;
251  }
252
253  /**
254   * Return the list of subjects the object is about. Typically, the topic will be represented
255   * using keywords, key phrases, or classification codes. Recommended best practice is to use a
256   * controlled vocabulary. To describe the spatial or temporal topic of the resource, use the
257   * Coverage element.
258   *
259   * @return the subjects the object is about
260   */
261  public Set<String> getSubjects() {
262    return subjects;
263  }
264
265  /**
266   * Set the list of subjects the object is about.
267   *
268   * @param subjects the subjects the object is about
269   * @see #getSubjects
270   */
271  @Searchable(index = "lucene")
272  @Predicate(uri = "dc:subject", dataType = "rdf:XMLLiteral")
273  public void setSubjects(Set<String> subjects) {
274    this.subjects = subjects;
275  }
276
277  /**
278   * Get the language of the object. Recommended best practice is to use a controlled vocabulary
279   * such as RFC 3066 [RFC3066].
280   *
281   * @return the language
282   */
283  public String getLanguage() {
284    return language;
285  }
286
287  /**
288   * Set the language of the object.
289   *
290   * @param language the language to set
291   * @see #getLanguage
292   */
293  @Predicate(uri = "dc:language")
294  public void setLanguage(String language) {
295    this.language = language;
296  }
297
298  /**
299   * Get the name of the publisher of this object. Examples of a Publisher include a person, an
300   * organization, or a service. Typically, the name of a Publisher should be used to indicate the
301   * entity.
302   *
303   * @return the publisher
304   */
305  public String getPublisher() {
306    return publisher;
307  }
308
309  /**
310   * Set the name of the publisher of this object.
311   *
312   * @param publisher the name of the publisher
313   * @see #getPublisher
314   */
315  @Searchable(index = "lucene")
316  @Predicate(uri = "dc:publisher", dataType = "rdf:XMLLiteral")
317  public void setPublisher(String publisher) {
318    this.publisher = publisher;
319   }
320
321  /**
322   * Get the format of the object. Recommended best practice is to use a controlled vocabulary such
323   * as the list of Internet Media Types [MIME].
324   *
325   * @return format
326   */
327  public String getFormat() {
328    return format;
329  }
330
331  /**
332   * Set the format of the object.
333   *
334   * @param format the dc:format to set
335   * @see #getFormat
336   */
337  @Predicate(uri = "dc:format")
338  public void setFormat(String format) {
339    this.format = format;
340  }
341
342  /**
343   * Get the date the object was made available.
344   *
345   * @return the date the object was made available
346   */
347  public Date getAvailable() {
348    return available;
349  }
350
351  /**
352   * Set the date the object was made available.
353   *
354   * @param available the date the object was made available
355   * @see #getAvailable
356   */
357  @Predicate(uri = "dcterms:available", dataType = "xsd:date")
358  public void setAvailable(Date available) {
359    this.available = available;
360  }
361
362  /**
363   * Get the issued date. This is the date of formal issuance (e.g., publication) of the resource.
364   *
365   * @return the issued date
366   */
367  public Date getIssued() {
368    return issued;
369  }
370
371  /**
372   * Set the issued date.
373   *
374   * @param issued the date the object was issued
375   * @see #getIssued
376   */
377  @Predicate(uri = "dcterms:issued", dataType = "xsd:date")
378  public void setIssued(Date issued) {
379    this.issued = issued;
380  }
381
382  /**
383   * Get the submission date (e.g. thesis, articles, etc.).
384   *
385   * @return the submission date
386   */
387  public Date getSubmitted() {
388    return submitted;
389  }
390
391  /**
392   * Set the submission date.
393   *
394   * @param submitted the date the object was submitted
395   * @see #getSubmitted
396   */
397  @Predicate(uri = "dcterms:dateSubmitted", dataType = "xsd:date")
398  public void setSubmitted(Date submitted) {
399    this.submitted = submitted;
400  }
401
402  /**
403   * Return the acceptance date (e.g. of thesis by university department, of article by journal,
404   * etc.).
405   *
406   * @return the accpetance date
407   */
408  public Date getAccepted() {
409    return accepted;
410  }
411
412  /**
413   * Set the acceptance date.
414   *
415   * @param accepted the date the object was accepted
416   * @see #getAccepted
417   */
418  @Predicate(uri = "dcterms:dateAccepted", dataType = "xsd:date")
419  public void setAccepted(Date accepted) {
420    this.accepted = accepted;
421  }
422
423  /**
424   * Return the year of the copyright.
425   *
426   * @return the year of the copyright
427   */
428  public Integer getCopyrightYear() {
429    return copyrightYear;
430  }
431
432  /**
433   * Set the year of the copyright.
434   *
435   * @param copyrightYear the year of the copyright
436   * @see #getCopyrightYear
437   */
438  @Predicate(uri = "dcterms:dateCopyrighted")
439  public void setCopyrightYear(Integer copyrightYear) {
440    this.copyrightYear = copyrightYear;
441  }
442
443  /**
444   * Return the source of the object. The described resource may be derived from the related
445   * resource in whole or in part. Recommended best practice is to identify the related resource by
446   * means of a string conforming to a formal identification system.
447   *
448   * @return the source of the object
449   */
450  public Object getSource() {
451    return source;
452  }
453
454  /**
455   * Set the source of the object.
456   *
457   * @param source the source of the object
458   * @see #getSource
459   */
460  @Predicate(uri = "dc:source")
461  public void setSource(Object source) {
462    this.source = source;
463  }
464
465  /**
466   * Return the abstract/summary on the object.
467   *
468   * @return the abstract/summary of the object
469   */
470  public Set<String> getSummary() {
471    return summary;
472  }
473
474  /**
475   * Set the abstract/summary of the object.
476   *
477   * @param summary the summary/abstract of the object
478   * @see #getSummary
479   */
480  @Searchable(index = "lucene")
481  @Predicate(uri = "dcterms:abstract")
482  public void setSummary(Set<String> summary) {
483    this.summary = summary;
484  }
485
486  /**
487   * Return the bibliographic citation for the object.
488   *
489   * @return bibliographic citation for the object
490   */
491  public Citation getBibliographicCitation() {
492    return bibliographicCitation;
493  }
494
495  /**
496   * Set the bibliographic citation for the object.
497   *
498   * @param bibliographicCitation bibliographic citation for the object
499   * @see #getBibliographicCitation
500   */
501  @Predicate(uri = "dcterms:bibliographicCitation", cascade = { CascadeType.child })
502  public void setBibliographicCitation(Citation bibliographicCitation) {
503    this.bibliographicCitation = bibliographicCitation;
504  }
505
506  /**
507   * Return the creation date.
508   *
509   * @return the creation date
510   */
511  public Date getCreated() {
512    return created;
513  }
514
515  /**
516   * Set the creation date.
517   *
518   * @param created the date the object was created
519   */
520  @Predicate(uri = "dcterms:created", dataType = "xsd:date")
521  public void setCreated(Date created) {
522    this.created = created;
523  }
524
525  /**
526   * Return the set of licenses for this object. A licenses is a legal document giving official
527   * permission to do something with the resource.
528   *
529   * @return the set of licenses for this object
530   */
531  public Set<License> getLicense() {
532    return license;
533  }
534
535  /**
536   * Set the set of licenses for this object.
537   *
538   * @param license the set of licenses governing this object
539   * @see #getLicense
540   */
541  @Predicate(uri = "dcterms:license")
542  public void setLicense(Set<License> license) {
543    this.license = license;
544  }
545
546  /**
547   * Return the modified date.
548   *
549   * @return the modified date
550   */
551  public Date getModified() {
552    return modified;
553  }
554
555  /**
556   * Set the modified date.
557   *
558   * @param modified the date the object was modified
559   * @see #getModified
560   */
561  @Predicate(uri = "dcterms:modified", dataType = "xsd:date")
562  public void setModified(Date modified) {
563    this.modified = modified;
564  }
565
566  /**
567   * Return the set of objects referred to by this object.
568   *
569   * @return the set of objects referred to by this object
570   */
571  public List<Citation> getReferences() {
572    return references;
573  }
574
575  /**
576   * Set the set of objects referred to by this object.
577   *
578   * @param references the set of objects referred to by this object
579   * @see #getReferences
580   */
581  @Predicate(uri = "dcterms:references", cascade = { CascadeType.child } )
582  public void setReferences(List<Citation> references) {
583    this.references = references;
584  }
585
586  /**
587   * Return the URI identifying the standard the object conforms to. For example, for an XML
588   * document this can point to the URI identifying the DTD.
589   *
590   * @return the URI identifying the standard the object conforms to
591   */
592  public URI getConformsTo() {
593    return conformsTo;
594  }
595
596  /**
597   * Set the format this object conforms to.
598   *
599   * @param conformsTo the URI specifying the conformance standard
600   * @see #getConformsTo
601   */
602  @Predicate(uri = "dcterms:conformsTo")
603  public void setConformsTo(URI conformsTo) {
604    this.conformsTo = conformsTo;
605  }
606}
Note: See TracBrowser for help on using the browser.