View Javadoc

1   /*
2    * Copyright 2015 Data Archiving and Networked Services (an institute of
3    * Koninklijke Nederlandse Akademie van Wetenschappen), King's College London,
4    * Georg-August-Universitaet Goettingen Stiftung Oeffentlichen Rechts
5    *
6    * Licensed under the EUPL, Version 1.1 or – as soon they will be approved by
7    * the European Commission - subsequent versions of the EUPL (the "Licence");
8    * You may not use this work except in compliance with the Licence.
9    * You may obtain a copy of the Licence at:
10   *
11   * https://joinup.ec.europa.eu/software/page/eupl
12   *
13   * Unless required by applicable law or agreed to in writing, software
14   * distributed under the Licence is distributed on an "AS IS" basis,
15   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16   * See the Licence for the specific language governing
17   * permissions and limitations under the Licence.
18   */
19  
20  package eu.ehri.project.models;
21  
22  import com.tinkerpop.blueprints.Direction;
23  import com.tinkerpop.frames.Adjacency;
24  import com.tinkerpop.frames.Property;
25  import eu.ehri.project.definitions.Ontology;
26  import eu.ehri.project.models.annotations.EntityType;
27  import eu.ehri.project.models.annotations.Indexed;
28  import eu.ehri.project.models.annotations.Mandatory;
29  import eu.ehri.project.models.base.Annotatable;
30  import eu.ehri.project.models.base.Temporal;
31  
32  /**
33   * Frame class representing a date period.
34   */
35  @EntityType(EntityClass.DATE_PERIOD)
36  public interface DatePeriod extends Annotatable {
37  
38      enum DatePeriodType {
39          creation, existence
40      }
41  
42      /**
43       * The start date in UTC format.
44       *
45       * @return a UTC date string
46       */
47      @Indexed
48      @Property(Ontology.DATE_PERIOD_START_DATE)
49      String getStartDate();
50  
51      /**
52       * The end date in UTC format.
53       *
54       * @return a UTC string
55       */
56      @Indexed
57      @Property(Ontology.DATE_PERIOD_END_DATE)
58      String getEndDate();
59  
60      /**
61       * Get the date period type.
62       *
63       * @return a type string
64       */
65      @Indexed
66      @Property(Ontology.DATE_PERIOD_TYPE)
67      DatePeriodType getDateType();
68  
69      /**
70       * Get the entity described by this date period.
71       *
72       * @return a temporal item
73       */
74      @Mandatory
75      @Adjacency(label = Ontology.ENTITY_HAS_DATE, direction = Direction.IN)
76      Temporal getEntity();
77  }