- 更新日時:
- 2014/01/30 13:41:37 (11 年 前)
- ファイル:
-
- 1 変更
凡例:
- 変更なし
- 追加
- 削除
-
BH13SPARQLBuilder/src/org/biohackathon/SPARQLBuilder/OWL/OWLClassGraph.java
r8 r15 37 37 38 38 public void generateGraph(List<List<ClassLink>> paths){ 39 39 ListIterator<List<ClassLink>> pit = paths.listIterator(); 40 while( pit.hasNext() ){ 41 // KOKO 42 } 40 43 } 41 44 42 public Path[] getPaths(OWLQueryBuilderImpl qb){ 43 List<List<ClassLink>> paths = searchPathsFromOWL(qb); 44 //List<List<ClassLink>> paths = searchPathsFromInstances(qb); 45 public Path[] getPaths(OWLQueryBuilderImpl qb, int mode){ 46 List<List<ClassLink>> paths = searchPaths(qb, mode); 45 47 Path[] patharray = new Path[paths.size()]; 46 48 ListIterator<List<ClassLink>> pit = paths.listIterator(); … … 65 67 } 66 68 69 /* 67 70 private List<List<ClassLink>> searchPathsFromOWL(OWLQueryBuilderImpl qb){ 68 71 return searchPathsEngine(qb, 0); … … 72 75 return searchPathsEngine(qb, 1); 73 76 } 77 */ 74 78 75 private List<List<ClassLink>> searchPaths Engine(OWLQueryBuilderImpl qb, int mode){76 List<List<ClassLink>> paths = new ArrayList< List<ClassLink>>();79 private List<List<ClassLink>> searchPaths(OWLQueryBuilderImpl qb, int mode){ 80 List<List<ClassLink>> paths = new ArrayList<>(); 77 81 ClassLink crrLink = new ClassLink(null,startClass,Direction.both,0); 78 List<LinkAndPath> lp = new LinkedList< LinkAndPath>();82 List<LinkAndPath> lp = new LinkedList<>(); 79 83 lp.add(new LinkAndPath(crrLink, new LinkedList<ClassLink>())); 80 84 try{ 81 85 for ( int i = 0; i < nsteps; i++ ){ 82 86 ListIterator<LinkAndPath> lit = lp.listIterator(); 83 List<LinkAndPath> nextlp = new LinkedList< LinkAndPath>();87 List<LinkAndPath> nextlp = new LinkedList<>(); 84 88 while ( lit.hasNext() ){ 85 89 LinkAndPath crrlp = lit.next(); … … 93 97 }else{ System.err.println("Mode is not correct."); } 94 98 for ( int j = 0 ; j < classLinks.length; j++ ){ 95 List<ClassLink> crrpath = new LinkedList<ClassLink>(crrlp.path); 99 //List<ClassLink> crrpath = new LinkedList<ClassLink>(crrlp.path); 100 List<ClassLink> crrpath = new LinkedList<>(crrlp.path); 96 101 crrpath.add(classLinks[j]); 97 102 if ( classLinks[j].getLinkedClassURI().equals(endClass) ){ 98 paths.add(new LinkedList<ClassLink>(crrpath)); 103 //paths.add(new LinkedList<ClassLink>(crrpath)); 104 paths.add(new LinkedList<>(crrpath)); 99 105 } 100 106 nextlp.add(new LinkAndPath(classLinks[j],crrpath)); … … 103 109 lp = nextlp; 104 110 } 105 }catch(Exception e){ System.err.println(e);} 111 }catch(Exception e){ 112 System.err.println(e); 113 } 106 114 return paths; 107 115 }