チェンジセット 112 : BH13SPARQLBuilder/src
- 更新日時:
- 2014/07/07 00:27:23 (10 年 前)
- パス:
- BH13SPARQLBuilder/src/org/biohackathon/SPARQLBuilder/OWL
- ファイル:
-
- 2 変更
凡例:
- 変更なし
- 追加
- 削除
-
BH13SPARQLBuilder/src/org/biohackathon/SPARQLBuilder/OWL/AcquiredStructureAnalyzer.java
r108 r112 175 175 176 176 // SELECT 177 queryStr.append("SELECT DISTINCT ?indPropCat ?c ?d ?p ?numLnkInsStart ?numLnkInsEnd ?numInsDom ?numInsRan ?numTriples ?isStartClsLim ?isEndClsLim\n");177 queryStr.append("SELECT DISTINCT ?indPropCat ?c ?dat ?d ?p ?numLnkInsStart ?numLnkInsEnd ?numInsDom ?numInsRan ?numTriples ?isStartClsLim ?isEndClsLim\n"); 178 178 179 179 // if (targetGraphURIs != null) { … … 191 191 queryStr.append(" ?cr <http://sparqlbuilder.org/startClass> <" + originClass + ">. \n"); 192 192 queryStr.append(" ?cr <http://sparqlbuilder.org/endClass> ?c. \n"); 193 queryStr.append(" ?cr <http://sparqlbuilder.org/property> ?p. \n"); 194 queryStr.append(" ?cr <http://sparqlbuilder.org/numberOfTriples> ?numTriples. \n"); 195 queryStr.append(" ?cr <http://sparqlbuilder.org/numberOfInstancesOfStartClass> ?numLnkInsStart. \n"); 196 queryStr.append(" ?cr <http://sparqlbuilder.org/numberOfInstancesOfEndClass> ?numLnkInsEnd. \n"); 197 queryStr.append(" ?cr <http://sparqlbuilder.org/startClassLimitedQ> ?isStartClsLim. \n"); 198 queryStr.append(" ?cr <http://sparqlbuilder.org/endClassLimitedQ> ?isEndClsLim. \n"); 199 queryStr.append("}\n"); 200 queryStr.append(" UNION\n"); 201 queryStr.append(" {"); 202 queryStr.append(" ?cr <http://sparqlbuilder.org/startClass> <" + originClass + ">. \n"); 203 queryStr.append(" ?cr <http://sparqlbuilder.org/endDatatype> ?dat. \n"); 193 204 queryStr.append(" ?cr <http://sparqlbuilder.org/property> ?p. \n"); 194 205 queryStr.append(" ?cr <http://sparqlbuilder.org/numberOfTriples> ?numTriples. \n"); … … 247 258 Resource pro = sol.getResource("p"); 248 259 String clsURI = null; 260 String datURI = null; 249 261 if (pro != null) { 250 262 int indPropCat = 4; … … 257 269 Resource ccls = sol.getResource("c"); 258 270 Resource dcls = sol.getResource("d"); 271 Resource dat = sol.getResource("dat"); 259 272 Direction direction = null; 260 273 if(ccls != null && dcls == null ){ … … 266 279 direction = Direction.reverse; 267 280 clsURI = dcls.getURI(); 281 }else{ 282 if( ccls == null && dat != null && dcls == null ){ 283 clsURI = null; 284 direction = Direction.forward; 285 datURI = dat.getURI(); 286 } 268 287 } 269 288 } … … 309 328 } 310 329 311 ClassLink cl = new ClassLink(proURI, clsURI, d irection,330 ClassLink cl = new ClassLink(proURI, clsURI, datURI, direction, 312 331 numTriples, numInsDom, numInsRan, numLnkInsStart, numLnkInsEnd, isStartClsLim, isEndClsLim); 313 332 solCLs.add(cl); -
BH13SPARQLBuilder/src/org/biohackathon/SPARQLBuilder/OWL/ClassLink.java
r94 r112 14 14 private String propertyURI = null; 15 15 private String linkedClassURI = null; 16 private String linkedLiteralDatatypeURI = null; 16 17 private Direction direction = null; 17 18 private int numOfLinks = 0; … … 34 35 * @since 28.01.2014 35 36 */ 36 public ClassLink(String propertyURI, String linkedClassURI, Direction direction,37 public ClassLink(String propertyURI, String linkedClassURI, String linkedLiteralDatatypeURI, Direction direction, 37 38 int numLinks, int numOfOriginInstances, int numOfLinkedInstances, 38 39 int numOfOriginClassInstances, int numofLinkedClassInstances, … … 40 41 this.propertyURI = propertyURI; 41 42 this.linkedClassURI = linkedClassURI; 43 this.linkedLiteralDatatypeURI = linkedLiteralDatatypeURI; 42 44 this.direction = direction; 43 45 this.numOfLinks = numLinks; … … 59 61 obj.put("linkedClassURI", linkedClassURI); 60 62 } 63 if( linkedLiteralDatatypeURI != null ){ 64 obj.put("linkedLiteralDatatypeURI", linkedLiteralDatatypeURI); 65 } 61 66 obj.put("numOfLinks", numOfLinks); 62 67 obj.put("numOfLinkedInstances", numOfLinkedInstances); … … 81 86 else{ 82 87 json_str+="\"linkedClassURI\":"+"\"linkedClassURI\""; 88 } 89 if( linkedLiteralDatatypeURI != null ){ 90 json_str+="\"linkedLiteralDatatypeURI\":"+"\""+linkedLiteralDatatypeURI+"\""; 91 } 92 else{ 93 json_str+="\"linkedLiteralDatatypeURI\":"+"\"linkedLiteralDatatypeURI\""; 83 94 } 84 95 … … 214 225 this.numOfLinkedClassInstances = numOfLinkedClassInstances; 215 226 } 227 228 229 public final String getLinkedLiteralDatatypeURI() { 230 return linkedLiteralDatatypeURI; 231 } 232 233 234 public final void setLinkedLiteralDatatypeURI(String linkedLiteralDatatypeURI) { 235 this.linkedLiteralDatatypeURI = linkedLiteralDatatypeURI; 236 } 237 238 239 public final void setDomainClassLimitedQ(boolean domainClassLimitedQ) { 240 this.domainClassLimitedQ = domainClassLimitedQ; 241 } 242 243 244 public final void setRangeClassLimitedQ(boolean rangeClassLimitedQ) { 245 this.rangeClassLimitedQ = rangeClassLimitedQ; 246 } 216 247 217 248