Skip to content

Commit a7c467b

Browse files
committed
Fix for ancestors
1 parent 036aa63 commit a7c467b

File tree

3 files changed

+58
-2
lines changed

3 files changed

+58
-2
lines changed
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
package org.alliancegenome.indexer;
2+
3+
import java.util.List;
4+
5+
import org.alliancegenome.core.config.ConfigHelper;
6+
import org.alliancegenome.curation_api.interfaces.document.GeneDocumentInterface;
7+
import org.alliancegenome.curation_api.model.document.es.GeneSummaryDocument;
8+
import org.alliancegenome.curation_api.model.entities.Gene;
9+
import org.alliancegenome.curation_api.model.entities.ontology.OntologyTermClosure;
10+
import org.alliancegenome.curation_api.model.entities.ontology.SOTerm;
11+
import org.alliancegenome.curation_api.response.SearchResponse;
12+
import org.alliancegenome.es.rest.RestConfig;
13+
14+
import si.mazi.rescu.RestProxyFactory;
15+
16+
public class TestAncestors {
17+
18+
public static void main(String[] args) throws Exception {
19+
long geneId = args.length > 0 ? Long.parseLong(args[0]) : 28821279L;
20+
21+
GeneDocumentInterface geneApi = RestProxyFactory.createProxy(GeneDocumentInterface.class, ConfigHelper.getCurationApiUrl(), RestConfig.config);
22+
23+
System.out.println("=== API URL: " + ConfigHelper.getCurationApiUrl() + " ===");
24+
System.out.println("=== Gene ID: " + geneId + " ===\n");
25+
26+
SearchResponse<GeneSummaryDocument> response = geneApi.findByIds(List.of(geneId));
27+
28+
System.out.println("=== GeneSummaryDocument from API ===");
29+
for (GeneSummaryDocument doc : response.getResults()) {
30+
Gene gene = doc.getGene();
31+
if (gene == null) {
32+
System.out.println("Gene is null");
33+
continue;
34+
}
35+
System.out.println("Gene symbol: " + (gene.getGeneSymbol() != null ? gene.getGeneSymbol().getDisplayText() : "null"));
36+
37+
SOTerm geneType = gene.getGeneType();
38+
if (geneType == null) {
39+
System.out.println("geneType is null");
40+
continue;
41+
}
42+
System.out.println("geneType curie: " + geneType.getCurie());
43+
System.out.println("geneType name: " + geneType.getName());
44+
45+
if (geneType.getAncestors() == null) {
46+
System.out.println("ancestors: null");
47+
} else {
48+
System.out.println("ancestors count: " + geneType.getAncestors().size());
49+
for (OntologyTermClosure closure : geneType.getAncestors()) {
50+
System.out.println(" " + closure.getClosureObject().getCurie() + " " + closure.getClosureTypes());
51+
}
52+
}
53+
}
54+
System.out.println("\n=== Done ===");
55+
}
56+
57+
}

agr_indexer/src/main/java/org/alliancegenome/indexer/indexers/LiteratureIndexer.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ protected void index(ProcessDisplayHelper display) {
5050

5151
@Override
5252
protected void startSingleThread(LinkedBlockingDeque<String> queue) {
53-
ObjectMapper mapper = new ObjectMapper();
5453
while (!queue.isEmpty()) {
5554
String page = null;
5655
try {

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
<maven-checkstyle-plugin.version>3.3.1</maven-checkstyle-plugin.version>
2424
<checkstyle.version>10.17.0</checkstyle.version>
2525
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
26-
<curation.version>v0.47.29</curation.version>
26+
<curation.version>v0.47.30</curation.version>
2727
</properties>
2828
<dependencyManagement>
2929
<dependencies>

0 commit comments

Comments
 (0)