チェンジセット 8
- 更新日時:
- 2014/01/30 10:59:12 (11 年 前)
- パス:
- BH13SPARQLBuilder/src/org/biohackathon/SPARQLBuilder/OWL
- ファイル:
-
- 2 変更
凡例:
- 変更なし
- 追加
- 削除
-
BH13SPARQLBuilder/src/org/biohackathon/SPARQLBuilder/OWL/OWLClassGraph.java
r3 r8 41 41 42 42 public Path[] getPaths(OWLQueryBuilderImpl qb){ 43 //List<List<ClassLink>> paths = searchPathsFromOWL(qb);44 List<List<ClassLink>> paths = searchPathsFromInstances(qb);43 List<List<ClassLink>> paths = searchPathsFromOWL(qb); 44 //List<List<ClassLink>> paths = searchPathsFromInstances(qb); 45 45 Path[] patharray = new Path[paths.size()]; 46 46 ListIterator<List<ClassLink>> pit = paths.listIterator(); … … 51 51 List<ClassLink> path = pit.next(); 52 52 patharray[i].setClassLinks(path); 53 ListIterator<ClassLink> cit = path.listIterator(); 54 int min = Integer.MAX_VALUE; 55 while ( cit.hasNext() ){ 56 ClassLink cl = cit.next(); 57 if ( cl.getNumOfLinks() < min ){ 58 min = cl.getNumOfLinks(); 59 } 60 } 61 patharray[i].setWidth(min); 53 62 i++; 54 63 } … … 66 75 private List<List<ClassLink>> searchPathsEngine(OWLQueryBuilderImpl qb, int mode){ 67 76 List<List<ClassLink>> paths = new ArrayList<List<ClassLink>>(); 68 ClassLink crrLink = new ClassLink(null,startClass,Direction.both );77 ClassLink crrLink = new ClassLink(null,startClass,Direction.both,0); 69 78 List<LinkAndPath> lp = new LinkedList<LinkAndPath>(); 70 79 lp.add(new LinkAndPath(crrLink, new LinkedList<ClassLink>())); -
BH13SPARQLBuilder/src/org/biohackathon/SPARQLBuilder/OWL/Path.java
r3 r8 4 4 5 5 /** 6 * 襍キ轤ケ縺ィ縺ェ繧九Μ繧ス繝シ繧ケ縺九i騾先ャ。 逧?↓隍?焚繝ェ繝ウ繧ッ縺ァ邨らせ繝ェ繧ス繝シ繧ケ縺セ縺ァ謗・邯壹&繧後k荳?縺、縺ョ繝代せ繧定ィ倩ソー縺吶k6 * 襍キ轤ケ縺ィ縺ェ繧九Μ繧ス繝シ繧ケ縺九i騾先ャ。�ス?�ス�ス�ス?�ス�ス繝ェ繝ウ繧ッ縺ァ邨らせ繝ェ繧ス繝シ繧ケ縺セ縺ァ謗・邯壹&繧後k�ス?縺、縺ョ繝代せ繧定ィ倩ソー縺吶k 7 7 * @author Yamaguchi 8 8 * @since 28.01.2014 … … 15 15 */ 16 16 private String startClass; 17 private int width; 17 18 18 19 /** 19 * 繝代せ縺ョ襍キ轤ケ縺九i邨らせ縺ォ蜷代°縺」縺ヲ騾先ャ。 逧?↓縺、縺ェ縺後k繧ッ繝ゥ繧ケ髢薙Μ繝ウ繧ッ縺ョ繝ェ繧ケ繝?20 * 繝代せ縺ョ襍キ轤ケ縺九i邨らせ縺ォ蜷代°縺」縺ヲ騾先ャ。�ス?�ス�ス縺、縺ェ縺後k繧ッ繝ゥ繧ケ髢薙Μ繝ウ繧ッ縺ョ繝ェ繧ケ�ス? 20 21 */ 21 22 private List<ClassLink> classLinks; … … 41 42 } 42 43 44 public int getWidth(){ 45 return width; 46 } 47 43 48 public Path(){} 44 49 45 public Path(String startClass, List<ClassLink> classLinks ){50 public Path(String startClass, List<ClassLink> classLinks, int width){ 46 51 this.startClass = startClass; 47 52 this.classLinks = classLinks; 53 this.width = width; 48 54 } 49 55 … … 55 61 this.classLinks = classLinks; 56 62 } 63 64 public void setWidth(int width){ 65 this.width = width; 66 } 57 67 58 68 }