チェンジセット 63 : BH13SPARQLBuilder/src/org/biohackathon
- 更新日時:
- 2014/04/21 13:32:02 (11 年 前)
- パス:
- BH13SPARQLBuilder/src/org/biohackathon/SPARQLBuilder/OWL
- ファイル:
-
- 2 変更
凡例:
- 変更なし
- 追加
- 削除
-
BH13SPARQLBuilder/src/org/biohackathon/SPARQLBuilder/OWL/ClassLink.java
r54 r63 1 1 package org.biohackathon.SPARQLBuilder.OWL; 2 3 import org.json.JSONObject; 2 4 3 5 /** … … 39 41 this.numOfOriginClassInstances = numOfOriginClassInstances; 40 42 this.numOfLinkedClassInstances = numofLinkedClassInstances; 43 } 44 45 46 public JSONObject toJSON(){ 47 JSONObject obj = new JSONObject(); 48 if( propertyURI != null ) { 49 obj.put("propertyURI", propertyURI); 50 } 51 if( linkedClassURI != null ){ 52 obj.put("linkedClassURI", linkedClassURI); 53 } 54 obj.put("numOfLinks", numOfLinks); 55 obj.put("numOfLinkedInstances", numOfLinkedInstances); 56 obj.put("numOfOriginInstances", numOfOriginInstances); 57 obj.put("numOfOriginClassInstances", numOfOriginClassInstances); 58 obj.put("numOfLinkedClassInstances", numOfLinkedClassInstances); 59 return obj; 60 } 61 41 62 } 42 63 -
BH13SPARQLBuilder/src/org/biohackathon/SPARQLBuilder/OWL/Path.java
r11 r63 3 3 import java.util.List; 4 4 5 import org.json.JSONArray; 6 import org.json.JSONObject; 7 5 8 /** 6 9 * 襍キ轤ケ縺ィ縺ェ繧九Μ繧ス繝シ繧ケ縺九i騾先ャ。逧�↓隍�焚繝ェ繝ウ繧ッ縺ァ邨らせ繝ェ繧ス繝シ繧ケ縺セ縺ァ謗・邯壹&繧後k荳縺、縺ョ繝代せ繧定ィ倩ソー縺吶k 10 * 7 11 * @author Yamaguchi 8 12 * @since 28.01.2014 9 13 * @version 29.01.2014 10 14 */ 11 public class Path {15 public class Path { 12 16 13 17 /** … … 15 19 */ 16 20 private String startClass; 17 21 private int width; 18 22 19 23 /** … … 21 25 */ 22 26 private List<ClassLink> classLinks; 27 28 public JSONObject toJSON() { 29 JSONObject obj = new JSONObject(); 30 obj.put("startClassURI", startClass); 31 obj.put("width", width); 32 if (classLinks != null && classLinks.size() != 0) { 33 JSONObject[] classLinkObjs = new JSONObject[classLinks.size()]; 34 for (int i = 0; i < classLinks.size(); i++) { 35 classLinkObjs[i] = classLinks.get(i).toJSON(); 36 } 37 obj.put("classLinks", classLinkObjs); 38 } 39 return obj; 40 } 23 41 24 public String getStartClass(){ 42 public String toJSONString(){ 43 return toJSON().toString(); 44 } 45 46 public String getStartClass() { 25 47 return startClass; 26 48 } 27 49 28 /* public String[] getProperties(){ 29 return properties; 50 /* 51 * public String[] getProperties(){ return properties; } 52 * 53 * public String[] getObjectClasses(){ return objectClasses; } 54 * 55 * public Direction[] getDirections(){ return directions; } 56 */ 57 public List<ClassLink> getClassLinks() { 58 return classLinks; 30 59 } 31 60 32 public String[] getObjectClasses(){33 return objectClasses;61 public int getWidth() { 62 return width; 34 63 } 35 64 36 public Direction[] getDirections(){ 37 return directions; 65 public Path() { 38 66 } 39 */ 40 public List<ClassLink> getClassLinks(){ 41 return classLinks; 42 } 43 44 public int getWidth(){ 45 return width; 46 } 47 48 public Path(){} 49 50 public Path(String startClass, List<ClassLink> classLinks, int width){ 67 68 public Path(String startClass, List<ClassLink> classLinks, int width) { 51 69 this.startClass = startClass; 52 70 this.classLinks = classLinks; 53 71 this.width = width; 54 72 } 55 56 public void setStartClass(String startClass) {73 74 public void setStartClass(String startClass) { 57 75 this.startClass = startClass; 58 76 } 59 77 60 public void setClassLinks(List<ClassLink> classLinks) {78 public void setClassLinks(List<ClassLink> classLinks) { 61 79 this.classLinks = classLinks; 62 80 } 63 64 public void setWidth(int width){65 66 67 81 82 public void setWidth(int width) { 83 this.width = width; 84 } 85 68 86 }