チェンジセット 82 : BH13SPARQLBuilder
- 更新日時:
- 2014/06/18 17:15:06 (10 年 前)
- ファイル:
-
- 1 変更
凡例:
- 変更なし
- 追加
- 削除
-
BH13SPARQLBuilder/src/org/biohackathon/SPARQLBuilder/OWL/OWLClassGraph.java
r67 r82 55 55 divcut = - 2.0; 56 56 } 57 58 /* 59 public void generateGraph(List<List<ClassLink>> paths){ 60 ListIterator<List<ClassLink>> pit = paths.listIterator(); 61 while( pit.hasNext() ){ 62 List<ClassLink> cls = pit.next(); 63 String start = startClass; 64 ListIterator<ClassLink> cit = cls.listIterator(); 65 while ( cit.hasNext() ){ 66 // KOKO 67 } 68 } 69 } 70 */ 71 72 public Path[] getPaths(OWLQueryBuilderImpl qb, int mode, boolean countLink){ 57 58 public Path[] getPaths(RDFSchemaAnalyzer rdfsa, boolean countLink){ 73 59 List<List<ClassLink>> paths = null; 74 if ( mode <= 1){ 75 paths = searchPaths(qb, mode, countLink); 76 }else if ( mode == 2 ){ 77 paths = searchPathsWithCut(qb); 78 }else{ 79 System.err.println("Mode is not correct"); 80 return null; 81 } 60 paths = searchPaths(rdfsa, countLink); 82 61 Path[] patharray = new Path[paths.size()]; 83 62 ListIterator<List<ClassLink>> pit = paths.listIterator(); … … 102 81 } 103 82 104 private List<List<ClassLink>> searchPaths( OWLQueryBuilderImpl qb, int mode, boolean countLinks){83 private List<List<ClassLink>> searchPaths(RDFSchemaAnalyzer rdfsa, boolean countLinks){ 105 84 List<List<ClassLink>> paths = new ArrayList<>(); 106 85 ClassLink crrLink = new ClassLink(null,startClass,Direction.both,0,0,0,0,0); … … 114 93 LinkAndPath crrlp = lit.next(); 115 94 ClassLink[] classLinks = null; 116 // Mode 117 if ( mode == 0 ){ 118 classLinks = qb.getNextClass(null, crrlp.classLink.getLinkedClassURI(), limit, countLinks); 119 }else if ( mode == 1 ){ 120 classLinks = qb.getNextClassViaInstanceLink(null, crrlp.classLink.getLinkedClassURI(), limit); 121 }else{ System.err.println("Mode is not correct."); } 95 classLinks = rdfsa.getNextClass(null, crrlp.classLink.getLinkedClassURI(), limit, countLinks); 122 96 for ( int j = 0 ; j < classLinks.length; j++ ){ 123 97 List<ClassLink> crrpath = new LinkedList<>(crrlp.path); … … 140 114 return paths; 141 115 } 142 116 117 /* 143 118 private List<List<ClassLink>> searchPathsWithCut(OWLQueryBuilderImpl qb){ 144 119 List<List<ClassLink>> paths = new ArrayList<>(); … … 194 169 return paths; 195 170 } 196 171 */ 172 173 /* 197 174 private boolean decideConvergence(ClassLink classLink){ 198 175 double con = getValueForConvergence(classLink.getNumOfOriginInstances(), … … 204 181 return false; 205 182 } 206 183 */ 184 185 /* 207 186 private boolean decideDivergence(ClassLink classLink){ 208 187 double con = getValueForConvergence(classLink.getNumOfOriginInstances(), … … 214 193 return false; 215 194 } 216 195 */ 196 197 /* 217 198 private double getValueForConvergence(int numOfOriginInstances, int numOfLinkedInstances, int numOfLinks){ 218 199 //return (double) numOfLinks / (double) numOfLinkedInstances ; … … 220 201 return Math.log((double)numOfOriginInstances) - Math.log((double)numOfLinkedInstances); 221 202 } 203 */ 222 204 }