チェンジセット 178 : BH13SPARQLBuilder/src/org/biohackathon
- 更新日時:
- 2014/09/26 12:16:51 (10 年 前)
- パス:
- BH13SPARQLBuilder/src/org/biohackathon/SPARQLBuilder/OWL
- ファイル:
-
- 2 変更
凡例:
- 変更なし
- 追加
- 削除
-
BH13SPARQLBuilder/src/org/biohackathon/SPARQLBuilder/OWL/OWLClassGraph.java
r174 r178 58 58 NavigableSet<Path> sortedpath = new TreeSet<Path>(); 59 59 ListIterator<List<ClassLink>> pit = paths.listIterator(); 60 int j = 0; 60 61 while ( pit.hasNext() ){ 61 62 Path path = new Path(); … … 73 74 path.setWidth(min); 74 75 sortedpath.add(path); 76 j++; 75 77 } 76 78 Path[] patharray = new Path[paths.size()]; … … 94 96 while ( lit.hasNext() ){ 95 97 LinkAndPath crrlp = lit.next(); 96 /*if ( crrlp.classLink.getLinkedClassURI().equals("http://www.biopax.org/release/biopax-level3.owl#Pathway") ){97 System.out.println("here!");98 }*/99 98 ClassLink[] classLinks = rdfsa.getNextClass(null, crrlp.classLink.getLinkedClassURI(), limit, countLinks); 100 99 for ( int j = 0 ; j < classLinks.length; j++ ){ 101 /*if ( classLinks[j].getLinkedClassURI().endsWith("http://www.biopax.org/release/biopax-level3.owl#BiochemicalReaction") ){102 ClassLink cltmp = classLinks[j];103 }*/104 100 List<ClassLink> crrpath = new LinkedList<>(crrlp.path); 105 101 crrpath.add(classLinks[j]); … … 116 112 crrlp.classLink.getDirection() != classLinks[j].getDirection() && 117 113 crrlp.originalClassURI.equals( classLinks[j].getLinkedClassURI()) ){ 118 System.out.println("P1");114 //System.out.println("P1"); 119 115 continue; 120 116 } 121 117 if ( checkPruning(crrlp.classLink, classLinks[j]) ){ 122 System.out.println("P2");118 //System.out.println("P2"); 123 119 continue; 124 120 } 125 121 } 126 /*127 if ( classLinks[j].getDirection() != Direction.reverse ){128 System.out.println("here b");129 }*/130 131 122 nextlp.add(new LinkAndPath(classLinks[j], crrpath, crrlp.classLink.getLinkedClassURI())); 132 123 } -
BH13SPARQLBuilder/src/org/biohackathon/SPARQLBuilder/OWL/QueryPathGenerator.java
r148 r178 67 67 public QueryPathGenerator(String sparqlEndpoint){ 68 68 factory = new RDFSchemaAnalyzerFactory(CDIR); 69 setSPARQLendpoint(sparqlEndpoint); 69 setSPARQLendpoint(sparqlEndpoint); 70 70 } 71 71 … … 117 117 } 118 118 } 119 120 public static String getClassLabel(String classURI, SClass[] classes){ 121 if ( classURI == null ){ 122 return ""; 123 } 124 for ( int i = 0 ; i < classes.length; i++ ){ 125 if ( classURI.equals(classes[i].getClassURI()) ){ 126 Label[] labels = classes[i].getLabels(); 127 for ( int j = 0 ; j < labels.length; j++ ){ 128 if ( labels[j].getLanguage() == null ){ 129 return labels[j].getLabel(); 130 }else if ( labels[j].getLanguage().equals("en") ){ 131 return labels[j].getLabel(); 132 } 133 } 134 break; 135 } 136 } 137 String[] url = classURI.split("/"); 138 String tmplabel = url[url.length-1]; 139 String[] tmplabel2 = tmplabel.split("#"); 140 String label = tmplabel2[tmplabel2.length-1]; 141 return label; 142 } 119 143 }