1 | package org.biohackathon.SPARQLBuilder.OWL;
|
---|
2 |
|
---|
3 | import org.json.JSONObject;
|
---|
4 |
|
---|
5 | /**
|
---|
6 | * 繧ッ繝ゥ繧ケ縺ク縲√≠繧九>縺ッ繧ッ繝ゥ繧ケ縺九i縺ョ1繧ケ繝�ャ繝励Μ繝ウ繧ッ繧定ィ倩ソー縺吶k
|
---|
7 | * @author Norio KOBAYASHI
|
---|
8 | * @since 28.01.2014
|
---|
9 | * @version 29.01.2014
|
---|
10 | */
|
---|
11 | public class ClassLink {
|
---|
12 |
|
---|
13 | private String propertyURI = null;
|
---|
14 | private String linkedClassURI = null;
|
---|
15 | private Direction direction = null;
|
---|
16 | private int numOfLinks = 0;
|
---|
17 | private int numOfLinkedInstances = 0;
|
---|
18 | private int numOfOriginInstances = 0;
|
---|
19 | private int numOfOriginClassInstances = 0;
|
---|
20 | private int numOfLinkedClassInstances = 0;
|
---|
21 |
|
---|
22 | /**
|
---|
23 | * 繝励Ο繝代ユ繧」URI縲√Μ繝ウ繧ッ蜈茨シ亥��峨け繝ゥ繧ケ縲√Μ繝ウ繧ッ縺ョ蜷代″繧剃ク弱∴繧区ァ区�蟄� |
---|
24 | *
|
---|
25 | * @param propertyURI縲繝励Ο繝代ユ繧」縺ョURI
|
---|
26 | * @param linkedClassURI縲繝ェ繝ウ繧ッ縺ョ荳サ隱槭√√≠繧九>縺ッ繝ェ繝ウ繧ッ縺ョ逶ョ逧�ェ槭→縺ェ縺」縺ヲ縺�k繧ッ繝ゥ繧ケ縺ョURI
|
---|
27 | * @param direction 繝励Ο繝代ユ繧」縺ョ蜷代″縲〕inkedClassURI縺ョ繧ッ繝ゥ繧ケ縺後Μ繝ウ繧ッ蜈医↓縺ェ縺」縺ヲ縺�k縺ィ縺阪�Direction.forward,繝ェ繝ウ繧ッ蜈�↓縺ェ縺」縺ヲ縺�k縺ィ縺阪�Direction.reverse, 縺昴l繧我ク。譁ケ縺ョ譎ゅ�Direction.both繧呈欠螳壹☆繧�
|
---|
28 | * @param numOfLinks 蠖楢ゥイ繝励Ο繝代ユ繧」縺ァ荳。遶ッ繧ッ繝ゥ繧ケ縺ョ繧、繝ウ繧ケ繧ソ繝ウ繧ケ蜷悟」ォ繧偵▽縺ェ縺�〒縺�k繝ェ繝ウ繧ッ謨ー�医ヨ繝ェ繝励Ν謨ー�� |
---|
29 | * @throws Exception
|
---|
30 | * @since 28.01.2014
|
---|
31 | */
|
---|
32 | public ClassLink(String propertyURI, String linkedClassURI, Direction direction,
|
---|
33 | int numLinks, int numOfOriginInstances, int numOfLinkedInstances,
|
---|
34 | int numOfOriginClassInstances, int numofLinkedClassInstances){
|
---|
35 | this.propertyURI = propertyURI;
|
---|
36 | this.linkedClassURI = linkedClassURI;
|
---|
37 | this.direction = direction;
|
---|
38 | this.numOfLinks = numLinks;
|
---|
39 | this.numOfLinkedInstances = numOfLinkedInstances;
|
---|
40 | this.numOfOriginInstances = numOfOriginInstances;
|
---|
41 | this.numOfOriginClassInstances = numOfOriginClassInstances;
|
---|
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 |
|
---|
62 |
|
---|
63 |
|
---|
64 | public int getNumOfLinks() {
|
---|
65 | return numOfLinks;
|
---|
66 | }
|
---|
67 |
|
---|
68 |
|
---|
69 |
|
---|
70 |
|
---|
71 | public void setNumOfLinks(int numOfLinks) {
|
---|
72 | this.numOfLinks = numOfLinks;
|
---|
73 | }
|
---|
74 |
|
---|
75 |
|
---|
76 |
|
---|
77 |
|
---|
78 | /**
|
---|
79 | * 譁�ュ怜�陦ィ險倥r蜿門セ励☆繧� |
---|
80 | *
|
---|
81 | * @since 28.01.2014
|
---|
82 | */
|
---|
83 | public String toString(){
|
---|
84 | StringBuffer sb = new StringBuffer();
|
---|
85 | sb.append(propertyURI);
|
---|
86 | if( direction == Direction.forward ){
|
---|
87 | sb.append(" --> ");
|
---|
88 | }else{
|
---|
89 | if( direction == Direction.reverse ){
|
---|
90 | sb.append(" <-- ");
|
---|
91 | }else{
|
---|
92 | sb.append(" <-> ");
|
---|
93 | }
|
---|
94 | }
|
---|
95 | sb.append(linkedClassURI);
|
---|
96 | sb.append(" [");
|
---|
97 | sb.append(numOfOriginInstances);
|
---|
98 | sb.append("/");
|
---|
99 | sb.append(numOfOriginClassInstances);
|
---|
100 | sb.append("]縲---");
|
---|
101 |
|
---|
102 |
|
---|
103 | sb.append(" [");
|
---|
104 | sb.append(numOfLinks);
|
---|
105 | sb.append("] --->");
|
---|
106 |
|
---|
107 | sb.append(" [");
|
---|
108 | sb.append(numOfLinkedInstances);
|
---|
109 | sb.append("/");
|
---|
110 | sb.append(numOfLinkedClassInstances);
|
---|
111 | sb.append("]");
|
---|
112 | return sb.toString();
|
---|
113 | }
|
---|
114 |
|
---|
115 | public String getPropertyURI() {
|
---|
116 | return propertyURI;
|
---|
117 | }
|
---|
118 | public void setPropertyURI(String propertyURI) {
|
---|
119 | this.propertyURI = propertyURI;
|
---|
120 | }
|
---|
121 | public String getLinkedClassURI() {
|
---|
122 | return linkedClassURI;
|
---|
123 | }
|
---|
124 | public void setLinkedClassURI(String linkedClassURI) {
|
---|
125 | this.linkedClassURI = linkedClassURI;
|
---|
126 | }
|
---|
127 | public Direction getDirection() {
|
---|
128 | return direction;
|
---|
129 | }
|
---|
130 | public void setDirection(Direction direction) {
|
---|
131 | this.direction = direction;
|
---|
132 | }
|
---|
133 |
|
---|
134 | public final int getNumOfLinkedInstances() {
|
---|
135 | return numOfLinkedInstances;
|
---|
136 | }
|
---|
137 |
|
---|
138 | public final void setNumOfLinkedInstances(int numOfLinkedInstances) {
|
---|
139 | this.numOfLinkedInstances = numOfLinkedInstances;
|
---|
140 | }
|
---|
141 |
|
---|
142 |
|
---|
143 | public final int getNumOfOriginInstances() {
|
---|
144 | return numOfOriginInstances;
|
---|
145 | }
|
---|
146 |
|
---|
147 |
|
---|
148 | public final void setNumOfOriginInstances(int numOfOriginInstances) {
|
---|
149 | this.numOfOriginInstances = numOfOriginInstances;
|
---|
150 | }
|
---|
151 |
|
---|
152 |
|
---|
153 | public final int getNumOfOriginClassInstances() {
|
---|
154 | return numOfOriginClassInstances;
|
---|
155 | }
|
---|
156 |
|
---|
157 |
|
---|
158 | public final void setNumOfOriginClassInstances(int numOfOriginClassInstances) {
|
---|
159 | this.numOfOriginClassInstances = numOfOriginClassInstances;
|
---|
160 | }
|
---|
161 |
|
---|
162 |
|
---|
163 | public final int getNumOfLinkedClassInstances() {
|
---|
164 | return numOfLinkedClassInstances;
|
---|
165 | }
|
---|
166 |
|
---|
167 |
|
---|
168 | public final void setNumOfLinkedClassInstances(int numOfLinkedClassInstances) {
|
---|
169 | this.numOfLinkedClassInstances = numOfLinkedClassInstances;
|
---|
170 | }
|
---|
171 |
|
---|
172 |
|
---|
173 |
|
---|
174 | // private String[] propertyDomainClassURIs = null;
|
---|
175 | // private String[] propertyRangeClassURIs = null;
|
---|
176 |
|
---|
177 |
|
---|
178 |
|
---|
179 | }
|
---|