1
|
1 package org.mpi.openmind.scripts;
|
|
2
|
|
3 import java.util.List;
|
|
4
|
|
5 import org.mpi.openmind.cache.WrapperService;
|
|
6 import org.mpi.openmind.repository.bo.Attribute;
|
|
7 import org.mpi.openmind.repository.bo.Entity;
|
|
8 import org.mpi.openmind.repository.services.ServiceRegistry;
|
|
9
|
|
10 public class PrintStartPages {
|
|
11
|
|
12
|
|
13 public static void execute(WrapperService wrapper){
|
|
14
|
|
15
|
|
16 List<Attribute> list = wrapper.getAttributes("WITNESS", "start_page");
|
|
17
|
|
18
|
|
19 System.out.println("Codex\tWitness\tAhlwardt_no");
|
|
20 for(Attribute att : list){
|
|
21
|
|
22 List<Entity> codexList = wrapper.getTargetsForSourceRelation(att.getSourceId(), "is_part_of", "CODEX", 1);
|
|
23 if(codexList.isEmpty()){
|
|
24 //System.err.println("XXXXXXXXXXXXXXXXXX");
|
|
25 }else{
|
|
26 System.out.println(codexList.get(0).getId() + "\t" + att.getSourceId() + "\t" + att.getValue());
|
|
27 }
|
|
28
|
|
29 }
|
|
30
|
|
31 }
|
|
32
|
|
33 public static void main(String[] args){
|
|
34
|
|
35 ServiceRegistry sr = new ServiceRegistry();
|
|
36 execute(sr.getWrapper());
|
|
37 System.exit(0);
|
|
38
|
|
39 }
|
|
40 }
|