1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20 package eu.ehri.project.models;
21
22 import com.tinkerpop.frames.Adjacency;
23 import com.tinkerpop.frames.Property;
24 import eu.ehri.project.definitions.Ontology;
25 import eu.ehri.project.models.annotations.EntityType;
26 import eu.ehri.project.models.annotations.Fetch;
27 import eu.ehri.project.models.annotations.Indexed;
28 import eu.ehri.project.models.annotations.Mandatory;
29 import eu.ehri.project.models.base.Accessible;
30 import eu.ehri.project.models.base.Accessor;
31 import eu.ehri.project.models.base.Annotatable;
32 import eu.ehri.project.models.base.Linkable;
33 import eu.ehri.project.models.base.Promotable;
34 import eu.ehri.project.models.base.Temporal;
35
36
37
38
39
40 @EntityType(EntityClass.LINK)
41 public interface Link extends Promotable, Temporal, Annotatable {
42
43 @Fetch(value = Ontology.LINK_HAS_LINKER, numLevels = 0)
44 @Adjacency(label = Ontology.LINK_HAS_LINKER)
45 UserProfile getLinker();
46
47 @Adjacency(label = Ontology.LINK_HAS_LINKER)
48 void setLinker(Accessor accessor);
49
50 @Fetch(value = Ontology.LINK_HAS_TARGET, ifLevel = 0, numLevels = 1)
51 @Adjacency(label = Ontology.LINK_HAS_TARGET)
52 Iterable<Linkable> getLinkTargets();
53
54 @Adjacency(label = Ontology.LINK_HAS_TARGET)
55 void addLinkTarget(Linkable entity);
56
57 @Adjacency(label = Ontology.LINK_HAS_TARGET)
58 void removeLinkTarget(Linkable entity);
59
60 @Fetch(Ontology.LINK_HAS_BODY)
61 @Adjacency(label = Ontology.LINK_HAS_BODY)
62 Iterable<Accessible> getLinkBodies();
63
64 @Adjacency(label = Ontology.LINK_HAS_BODY)
65 void addLinkBody(Accessible entity);
66
67 @Mandatory
68 @Property(Ontology.LINK_HAS_TYPE)
69 String getLinkType();
70
71 @Indexed
72 @Property(Ontology.LINK_HAS_FIELD)
73 String getLinkField();
74
75 @Property(Ontology.LINK_HAS_DESCRIPTION)
76 String getDescription();
77 }
78
79
80
81