- 更新日時:
- 2014/10/28 16:50:31 (10 年 前)
- ファイル:
-
- 1 変更
凡例:
- 変更なし
- 追加
- 削除
-
SPARQLBuilderWWW/src/java/org/biohackathon/SPARQLBuilder/OWL/QueryPathGenerator.java
r197 r201 45 45 //SClass[] cl = qpg.getClasses(null); 46 46 47 /* 47 48 long start1 = System.currentTimeMillis(); 48 49 Path[] path1 = qpg1.getPaths(sc, ec, false); … … 60 61 System.out.println(path1.length); 61 62 System.out.println(path2.length); 63 */ 62 64 } 63 65 … … 119 121 } 120 122 121 public static String getClassLabel (String classURI, SClass[] classes){123 public static String getClassLabelfromList(String classURI, SClass[] classes){ 122 124 if ( classURI == null ){ 123 125 return ""; 124 126 } 127 SClass sclass = null; 125 128 for ( int i = 0 ; i < classes.length; i++ ){ 126 129 if ( classURI.equals(classes[i].getClassURI()) ){ 127 Label[] labels = classes[i].getLabels(); 128 for ( int j = 0 ; j < labels.length; j++ ){ 129 if ( labels[j].getLanguage() == null ){ 130 return labels[j].getLabel(); 131 }else if ( labels[j].getLanguage().equals("en") ){ 132 return labels[j].getLabel(); 133 } 134 } 135 break; 130 return getClassLabelfromClass(classes[i]); 136 131 } 137 132 } 138 String[] url = classURI.split("/"); 133 return ""; 134 } 135 136 public static String getClassLabelfromClass(SClass sclass){ 137 Label[] labels = sclass.getLabels(); 138 for ( int i = 0 ; i < labels.length; i++ ){ 139 if ( labels[i].getLanguage() == null ){ 140 return labels[i].getLabel(); 141 }else if ( labels[i].getLanguage().equals("en") ){ 142 return labels[i].getLabel(); 143 } 144 } 145 String[] url = sclass.getClassURI().split("/"); 139 146 String tmplabel = url[url.length-1]; 140 147 String[] tmplabel2 = tmplabel.split("#");