@@ -45,7 +45,6 @@ public void testEmptyAndNull() {
45
45
}
46
46
{
47
47
JSONTransformer_JSONIter jt = new JSONTransformer_JSONIter (ontologyPrefix );
48
-
49
48
50
49
assertEquals (jt .transformJSON ("{}" ).size (), 0L );
51
50
assertEquals (jt .transformJSON ("[]" ).size (), 0L );
@@ -103,15 +102,13 @@ public void testPrimitive() {
103
102
mn .add (rn , mn .createProperty (ontologyPrefix + "string" ), mn .createTypedLiteral ("string" ));
104
103
mn .add (rn , mn .createProperty (ontologyPrefix + "bool" ), mn .createTypedLiteral (true ));
105
104
mn .add (rn , mn .createProperty (ontologyPrefix + "boolf" ), mn .createTypedLiteral (false ));
106
-
105
+
107
106
// mn.add(mn.createProperty(ontologyPrefix + "a"), RDFS.label, mn.createTypedLiteral("a"));
108
107
// mn.add(mn.createProperty(ontologyPrefix + "string"), RDFS.label, mn.createTypedLiteral("string"));
109
108
// mn.add(mn.createProperty(ontologyPrefix + "bool"), RDFS.label, mn.createTypedLiteral("bool"));
110
109
// mn.add(mn.createProperty(ontologyPrefix + "boolf"), RDFS.label, mn.createTypedLiteral("boolf"));
111
110
// mn.add(mn.createProperty(ontologyPrefix + "n"), RDFS.label, mn.createTypedLiteral("n"));
112
-
113
-
114
-
111
+
115
112
assertTrue (mn .isIsomorphicWith (jtN .transformJSON (primitive1 )));
116
113
}
117
114
}
@@ -127,15 +124,14 @@ public void testPrimitive() {
127
124
m .add (r , m .createProperty (ontologyPrefix + "string" ), m .createTypedLiteral ("string" ));
128
125
m .add (r , m .createProperty (ontologyPrefix + "bool" ), m .createTypedLiteral (true ));
129
126
m .add (r , m .createProperty (ontologyPrefix + "boolf" ), m .createTypedLiteral (false ));
130
-
127
+
131
128
// m.add(r, RDF.type, RDFS.Resource);
132
129
// m.add(m.createProperty(ontologyPrefix + "a"), RDFS.label, m.createTypedLiteral("a"));
133
130
// m.add(m.createProperty(ontologyPrefix + "string"), RDFS.label, m.createTypedLiteral("string"));
134
131
// m.add(m.createProperty(ontologyPrefix + "bool"), RDFS.label, m.createTypedLiteral("bool"));
135
132
// m.add(m.createProperty(ontologyPrefix + "boolf"), RDFS.label, m.createTypedLiteral("boolf"));
136
133
// m.add(m.createProperty(ontologyPrefix + "n"), RDFS.label, m.createTypedLiteral("n"));
137
-
138
-
134
+
139
135
assertTrue (m .isIsomorphicWith (jt .transformJSON (primitive1 )));
140
136
}
141
137
@@ -151,14 +147,13 @@ public void testPrimitive() {
151
147
mn .add (rn , mn .createProperty (ontologyPrefix + "string" ), mn .createTypedLiteral ("string" ));
152
148
mn .add (rn , mn .createProperty (ontologyPrefix + "bool" ), mn .createTypedLiteral (true ));
153
149
mn .add (rn , mn .createProperty (ontologyPrefix + "boolf" ), mn .createTypedLiteral (false ));
154
-
150
+
155
151
// mn.add(mn.createProperty(ontologyPrefix + "a"), RDFS.label, mn.createTypedLiteral("a"));
156
152
// mn.add(mn.createProperty(ontologyPrefix + "string"), RDFS.label, mn.createTypedLiteral("string"));
157
153
// mn.add(mn.createProperty(ontologyPrefix + "bool"), RDFS.label, mn.createTypedLiteral("bool"));
158
154
// mn.add(mn.createProperty(ontologyPrefix + "boolf"), RDFS.label, mn.createTypedLiteral("boolf"));
159
155
// mn.add(mn.createProperty(ontologyPrefix + "n"), RDFS.label, mn.createTypedLiteral("n"));
160
-
161
-
156
+
162
157
assertTrue (mn .isIsomorphicWith (jtN .transformJSON (primitive1 )));
163
158
}
164
159
}
@@ -282,4 +277,17 @@ public void testDuplicateKeyJSON() {
282
277
}
283
278
}
284
279
280
+ @ Test
281
+ public void testWhiteSpace () {
282
+ String test = "{\" a b\" :{\" a c\" :\" c\" }}" ;
283
+ JSONTransformer jt = new JSONTransformer (ontologyPrefix );
284
+
285
+ Model m = ModelFactory .createDefaultModel ();
286
+ Resource r = m .createResource (), r1 = m .createResource ();
287
+ m .add (r , m .createProperty (ontologyPrefix + "a%20b" ), r1 );
288
+ m .add (r1 , m .createProperty (ontologyPrefix + "a%20c" ), m .createTypedLiteral ("c" ));
289
+
290
+ assertTrue (m .isIsomorphicWith (jt .transformJSON (test )));
291
+ }
292
+
285
293
}
0 commit comments