Skip to content

Commit fa05104

Browse files
committed
🚧 update data model to have updateTracker
1 parent a608d41 commit fa05104

20 files changed

+510
-29
lines changed

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<artifactId>graph-core</artifactId>
1212

1313
<packaging>jar</packaging>
14-
<version>2.0.8</version>
14+
<version>2.0.9-SNAPSHOT</version>
1515
<name>Graph Core Next Generation</name>
1616

1717
<description>

src/main/java/org/reactome/server/graph/domain/annotations/ReactomeProperty.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,5 @@
1616

1717
boolean addedField() default false;
1818

19+
String originName() default "";
1920
}

src/main/java/org/reactome/server/graph/domain/model/DBInfo.java

Lines changed: 2 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,14 @@
11
package org.reactome.server.graph.domain.model;
22

3-
import com.fasterxml.jackson.annotation.JsonIgnore;
4-
import org.springframework.data.neo4j.core.schema.Id;
53
import org.springframework.data.neo4j.core.schema.Node;
64

75
@Node
8-
public class DBInfo {
9-
10-
@JsonIgnore
11-
@Id
12-
private Long id;
6+
public class DBInfo extends Release {
137

148
private String name;
15-
private Integer version;
169
private Long checksum;
1710

18-
public DBInfo() { }
19-
20-
public Long getId() {
21-
return id;
22-
}
23-
24-
public void setId(Long id) {
25-
this.id = id;
11+
public DBInfo() {
2612
}
2713

2814
public String getName() {
@@ -33,13 +19,6 @@ public void setName(String name) {
3319
this.name = name;
3420
}
3521

36-
public Integer getVersion() {
37-
return version;
38-
}
39-
40-
public void setVersion(Integer version) {
41-
this.version = version;
42-
}
4322

4423
public Long getChecksum() {
4524
return checksum;
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
package org.reactome.server.graph.domain.model;
2+
3+
4+
import org.reactome.server.graph.domain.result.DatabaseObjectLike;
5+
6+
import java.util.List;
7+
8+
public interface Deletable extends DatabaseObjectLike {
9+
10+
List<Deleted> getDeleted();
11+
}
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
package org.reactome.server.graph.domain.model;
2+
3+
import com.fasterxml.jackson.annotation.JsonIgnore;
4+
import org.reactome.server.graph.domain.annotations.ReactomeProperty;
5+
import org.reactome.server.graph.domain.annotations.ReactomeSchemaIgnore;
6+
import org.springframework.data.neo4j.core.schema.Node;
7+
import org.springframework.data.neo4j.core.schema.Relationship;
8+
9+
import java.util.List;
10+
11+
@Node
12+
public class Deleted extends MetaDatabaseObject{
13+
14+
@ReactomeProperty
15+
private String curatorComment;
16+
17+
@Relationship(type = "deletedInstance")
18+
private List<DeletedInstance> deletedInstance;
19+
20+
@Relationship(type="reason")
21+
private DeletedControlledVocabulary reason;
22+
23+
@Relationship(type="replacementInstances")
24+
private List<Deletable> replacementInstances;
25+
26+
@Deprecated
27+
@ReactomeProperty(originName = "deletedInstanceDB_ID")
28+
private List<Integer> deletedInstanceDbId;
29+
30+
public Deleted() {
31+
}
32+
33+
public String getCuratorComment() {
34+
return curatorComment;
35+
}
36+
37+
public void setCuratorComment(String curatorComment) {
38+
this.curatorComment = curatorComment;
39+
}
40+
41+
public List<DeletedInstance> getDeletedInstance() {
42+
return deletedInstance;
43+
}
44+
45+
public void setDeletedInstance(List<DeletedInstance> deletedInstance) {
46+
this.deletedInstance = deletedInstance;
47+
}
48+
49+
public DeletedControlledVocabulary getReason() {
50+
return reason;
51+
}
52+
53+
public void setReason(DeletedControlledVocabulary reason) {
54+
this.reason = reason;
55+
}
56+
57+
public List<Deletable> getReplacementInstances() {
58+
return replacementInstances;
59+
}
60+
61+
public void setReplacementInstances(List<Deletable> replacementInstances) {
62+
this.replacementInstances = replacementInstances;
63+
}
64+
65+
@Deprecated
66+
public List<Integer> getDeletedInstanceDbId() {
67+
return deletedInstanceDbId;
68+
}
69+
70+
@Deprecated
71+
public void setDeletedInstanceDbId(List<Integer> deletedInstanceDbId) {
72+
this.deletedInstanceDbId = deletedInstanceDbId;
73+
}
74+
75+
@ReactomeSchemaIgnore
76+
@Override
77+
@JsonIgnore
78+
public String getExplanation() {
79+
//todo
80+
return "Deleted";
81+
}
82+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
package org.reactome.server.graph.domain.model;
2+
3+
import org.springframework.data.neo4j.core.schema.Node;
4+
5+
@Node
6+
public class DeletedControlledVocabulary extends ControlledVocabulary{
7+
8+
}
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
package org.reactome.server.graph.domain.model;
2+
3+
import com.fasterxml.jackson.annotation.JsonIgnore;
4+
import org.reactome.server.graph.domain.annotations.ReactomeProperty;
5+
import org.reactome.server.graph.domain.annotations.ReactomeSchemaIgnore;
6+
import org.springframework.data.neo4j.core.schema.Node;
7+
import org.springframework.data.neo4j.core.schema.Relationship;
8+
9+
import java.util.List;
10+
11+
@Node
12+
public class DeletedInstance extends MetaDatabaseObject {
13+
14+
@ReactomeProperty(originName = "class")
15+
private String clazz;
16+
17+
@ReactomeProperty(originName = "deletedInstanceDB_ID")
18+
private Integer deletedInstanceDbId;
19+
20+
@ReactomeProperty
21+
private String name;
22+
23+
@ReactomeProperty(addedField = true)
24+
private String deletedStId;
25+
26+
@Relationship(type = "species")
27+
private List<Taxon> species;
28+
29+
public DeletedInstance() {
30+
}
31+
32+
public String getClazz() {
33+
return clazz;
34+
}
35+
36+
public void setClazz(String clazz) {
37+
this.clazz = clazz;
38+
}
39+
40+
public Integer getDeletedInstanceDbId() {
41+
return deletedInstanceDbId;
42+
}
43+
44+
public void setDeletedInstanceDbId(Integer deletedInstanceDbId) {
45+
this.deletedInstanceDbId = deletedInstanceDbId;
46+
}
47+
48+
public String getDeletedStId() {
49+
return deletedStId;
50+
}
51+
52+
public void setDeletedStId(String deletedStId) {
53+
this.deletedStId = deletedStId;
54+
}
55+
56+
public String getName() {
57+
return name;
58+
}
59+
60+
public void setName(String name) {
61+
this.name = name;
62+
}
63+
64+
public List<Taxon> getSpecies() {
65+
return species;
66+
}
67+
68+
public void setSpecies(List<Taxon> species) {
69+
this.species = species;
70+
}
71+
72+
@ReactomeSchemaIgnore
73+
@Override
74+
@JsonIgnore
75+
public String getExplanation() {
76+
//todo
77+
return "DeletedInstance";
78+
}
79+
}

src/main/java/org/reactome/server/graph/domain/model/Event.java

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
@SuppressWarnings({"unused"})
1414

1515
@Node
16-
public abstract class Event extends DatabaseObject {
16+
public abstract class Event extends DatabaseObject implements Trackable, Deletable {
1717

1818
@ReactomeProperty
1919
private String definition;
@@ -117,6 +117,14 @@ public abstract class Event extends DatabaseObject {
117117
@Relationship(type = "structureModified", direction = Relationship.Direction.INCOMING)
118118
private List<InstanceEdit> structureModified;
119119

120+
@ReactomeTransient
121+
@Relationship(type = "replacementInstances", direction = Relationship.Direction.INCOMING)
122+
private List<Deleted> deleted;
123+
124+
@ReactomeTransient
125+
@Relationship(type = "updatedInstance", direction = Relationship.Direction.INCOMING)
126+
private List<UpdateTracker> updateTrackers;
127+
120128

121129
public Event() {}
122130

@@ -390,4 +398,22 @@ public List<InstanceEdit> getStructureModified() {
390398
public void setStructureModified(List<InstanceEdit> structureModified) {
391399
this.structureModified = structureModified;
392400
}
401+
402+
@Override
403+
public List<Deleted> getDeleted() {
404+
return deleted;
405+
}
406+
407+
public void setDeletedList(List<Deleted> deleted) {
408+
this.deleted = deleted;
409+
}
410+
411+
@Override
412+
public List<UpdateTracker> getUpdateTrackers() {
413+
return updateTrackers;
414+
}
415+
416+
public void setUpdateTrackers(List<UpdateTracker> updateTrackers) {
417+
this.updateTrackers = updateTrackers;
418+
}
393419
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
package org.reactome.server.graph.domain.model;
2+
3+
import org.springframework.data.neo4j.core.schema.Node;
4+
5+
@Node
6+
public abstract class MetaDatabaseObject extends DatabaseObject{
7+
8+
}

src/main/java/org/reactome/server/graph/domain/model/Pathway.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,9 @@ public class Pathway extends Event {
3939
@ReactomeProperty
4040
private String isCanonical;
4141

42+
@ReactomeProperty
43+
private String lastUpdatedDate;
44+
4245
@Relationship(type = "hasEvent")
4346
private SortedSet<HasEvent> hasEvent;
4447

@@ -159,6 +162,14 @@ public void setNormalPathway(Pathway normalPathway) {
159162
this.normalPathway = normalPathway;
160163
}
161164

165+
public String getLastUpdatedDate() {
166+
return lastUpdatedDate;
167+
}
168+
169+
public void setLastUpdatedDate(String lastUpdatedDate) {
170+
this.lastUpdatedDate = lastUpdatedDate;
171+
}
172+
162173
@ReactomeSchemaIgnore
163174
@Override
164175
@JsonIgnore

src/main/java/org/reactome/server/graph/domain/model/PhysicalEntity.java

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
@SuppressWarnings("unused")
1414
@Node
15-
public abstract class PhysicalEntity extends DatabaseObject {
15+
public abstract class PhysicalEntity extends DatabaseObject implements Trackable, Deletable {
1616

1717
@ReactomeProperty
1818
private String definition;
@@ -134,6 +134,14 @@ public abstract class PhysicalEntity extends DatabaseObject {
134134
@Relationship(type = "marker", direction = Relationship.Direction.INCOMING)
135135
private List<MarkerReference> markingReferences;
136136

137+
@ReactomeTransient
138+
@Relationship(type = "replacementInstances", direction = Relationship.Direction.INCOMING)
139+
private List<Deleted> deleted;
140+
141+
@ReactomeTransient
142+
@Relationship(type = "updatedInstance", direction = Relationship.Direction.INCOMING)
143+
private List<UpdateTracker> updateTrackers;
144+
137145
public PhysicalEntity() {}
138146

139147
public PhysicalEntity(Long dbId) {
@@ -477,4 +485,22 @@ public List<CellType> getCellType() {
477485
public void setCellType(List<CellType> cellType) {
478486
this.cellType = cellType;
479487
}
488+
489+
@Override
490+
public List<Deleted> getDeleted() {
491+
return deleted;
492+
}
493+
494+
public void setDeleted(List<Deleted> deleted) {
495+
this.deleted = deleted;
496+
}
497+
498+
@Override
499+
public List<UpdateTracker> getUpdateTrackers() {
500+
return updateTrackers;
501+
}
502+
503+
public void setUpdateTrackers(List<UpdateTracker> updateTrackers) {
504+
this.updateTrackers = updateTrackers;
505+
}
480506
}

0 commit comments

Comments
 (0)