チェンジセット 167 : SPARQLBuilderWWW/src/java
- 更新日時:
- 2014/09/25 17:05:29 (10 年 前)
- パス:
- SPARQLBuilderWWW/src/java/org/biohackathon/SPARQLBuilder/OWL
- ファイル:
-
- 3 変更
凡例:
- 変更なし
- 追加
- 削除
-
SPARQLBuilderWWW/src/java/org/biohackathon/SPARQLBuilder/OWL/ClassLink.java
r166 r167 297 297 298 298 private String getLinkedClassLabel(SClass[] classes){ 299 if ( linkedClassURI == null ){ 300 return ""; 301 } 302 for ( int i = 0 ; i < classes.length; i++ ){ 303 if ( linkedClassURI.equals(classes[i].getClassURI()) ){ 304 Label[] labels = classes[i].getLabels(); 305 for ( int j = 0 ; j < labels.length; j++ ){ 306 if ( labels[j].getLanguage() == null ){ 307 return labels[j].getLabel(); 308 }else if ( labels[j].getLanguage().equals("en") ){ 309 return labels[j].getLabel(); 310 } 311 } 312 break; 313 } 314 } 315 String[] url = linkedClassURI.split("/"); 316 String tmplabel = url[url.length-1]; 317 String[] tmplabel2 = tmplabel.split("#"); 318 String label = tmplabel2[tmplabel2.length-1]; 319 return label; 299 return QueryPathGenerator.getClassLabel(linkedClassURI, classes); 320 300 } 321 301 -
SPARQLBuilderWWW/src/java/org/biohackathon/SPARQLBuilder/OWL/Path.java
r166 r167 74 74 String json_str=""; 75 75 json_str+="{\"startClassURI\":\""+ startClass+"\","; 76 76 json_str+="\"startClassLabel\":\""+QueryPathGenerator.getClassLabel(startClass, classes)+"\","; 77 77 if (classLinks != null && classLinks.size() != 0) { 78 78 json_str+="\"classLinks\":["; -
SPARQLBuilderWWW/src/java/org/biohackathon/SPARQLBuilder/OWL/QueryPathGenerator.java
r152 r167 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 }