-
Notifications
You must be signed in to change notification settings - Fork 0
/
TestDriver.java
101 lines (68 loc) · 3.3 KB
/
TestDriver.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
package test;
import org.apache.commons.io.output.TeeOutputStream;
import org.semanticweb.owlapi.io.OntologyIRIMappingNotFoundException;
import org.semanticweb.owlapi.model.OWLOntologyCreationException;
import org.semanticweb.owlapi.model.OWLOntologyStorageException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.PrintStream;
import java.util.*;
public class TestDriver {
//Ontology Select
public static void ontoSelect() throws OWLOntologyStorageException, IOException, CloneNotSupportedException, OWLOntologyCreationException {
//String ontoInputRoot="E:\\dyw\\Data\\BioPortal_Ontologies";
String ontoInputRoot= "E:\\dyw\\Data\\Result\\OntoSelected\\corpus5";
String ontoSaveRoot= "E:\\dyw\\Data\\Result\\OntoSelected";
String ontoDataPath= "E:\\dyw\\Data\\Result\\OntoData";
OntologySelect.ontologySelect(ontoInputRoot, ontoSaveRoot, ontoDataPath);
}
//CRselect
public static void crSelect() throws OWLOntologyStorageException, IOException, CloneNotSupportedException, OWLOntologyCreationException {
String crOutPath="E:\\dyw\\Data\\Result\\CRselected";
String[] corpus1={"corpus1","corpus2","corpus3"};
String[] flag1={"1","2","3"};
Double[] percent1={0.1,0.3};
String selectedOntoinputPath="E:\\dyw\\Data\\Result\\OntoSelected";
for (String crps:corpus1){
for(String flg :flag1){
for(Double pct :percent1){
OntologySelect.crSelect(selectedOntoinputPath,crOutPath,crps,flg,pct);
}
}
}
}
//CRForget
public static void crForget() throws OWLOntologyStorageException, IOException, CloneNotSupportedException, OWLOntologyCreationException {
String[] corpus2 = {"corpus3"};//, "corpus2", "corpus3"};
Double[] percent2 = {0.1};//, 0.3};
String[] flag2={"1"};
String ontoInputPath = "D:\\Senior\\thesis\\DataPrep\\OntoSelected";
String conceptsInputPath = "D:\\Senior\\thesis\\DataPrep\\CRselected";
String rolesInputPath = "D:\\Senior\\thesis\\DataPrep\\CRselected";
String ontoOutPath="D:\\Senior\\thesis\\DataPrep\\OntoForgetted";
String dataLogPath="D:\\Senior\\thesis\\DataPrep\\OntoData\\forgetLog";
String status ="fine";
for(String cps:corpus2)
for(Double pct:percent2)
for(String flag:flag2)
RCForget.forgetRC(cps,pct,ontoInputPath,flag,ontoOutPath,conceptsInputPath,rolesInputPath,dataLogPath,status);
}
//SuccessTest
//mainDriver
public static void main(String[] args) throws OWLOntologyStorageException, IOException, CloneNotSupportedException, OWLOntologyCreationException {
//Log all the things in Console
FileOutputStream fos = new FileOutputStream("D:\\Senior\\thesis\\DataPrep\\Log\\runLog\\" + System.currentTimeMillis() + "out_log.txt");
TeeOutputStream myOut = new TeeOutputStream(System.out, fos);
PrintStream ps = new PrintStream(myOut, true);
System.setOut(ps);
//Root1 String tmp="E:\\dyw\\Data\\Result\\OntoSelected";
//Ontology Select
//ontoSelect();
//CRselect
//crSelect();
//CRForget
crForget();
//SuccessTest
//mainDriver
}
}