Skip to content

Commit b3cf6a5

Browse files
committed
Pulling latest version from IBM source
2 parents 3fc6b19 + db10283 commit b3cf6a5

31 files changed

+1026
-759
lines changed

README.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,21 +8,21 @@ JSONata was created by Andrew Coleman to provide many of the features that XPath
88
* [JSONata Documentation](http://docs.jsonata.org/overview.html)
99
* [JavaScript JSONata github repository](https://github.com/jsonata-js/jsonata)
1010

11-
JSONata4Java is an attempt to port the jsonata.js capabilities to Java v1.8.
11+
JSONata4Java is an attempt to port the jsonata.js 1.8.4 capabilities to Java v1.8.
1212
The easiest way to use this library is to include it as a dependency in your Maven pom.xml using these line:
1313
```
1414
<dependency>
1515
<groupId>com.ibm.jsonata4java</groupId>
1616
<artifactId>JSONata4Java</artifactId>
17-
<version>1.5.2</version>
17+
<version>1.5.5</version>
1818
</dependency>
1919
```
2020

2121
You can also opt to clone this repository using the command line below and build the jars yourself:
2222
```
2323
git clone https://github.com/IBM/JSONata4Java.git
2424
```
25-
The code was created using OpenJDK Runtime Environment (build 1.8.0_242-b08). You can import the project into Eclipse 2020-03 or newer.
25+
The code was created using OpenJDK Runtime Environment (build 1.8.0_252-b09). You can import the project into Eclipse 2021-03 or newer.
2626

2727
### Building the jar files
2828

@@ -34,8 +34,8 @@ you can right click on the pom.xml file and select **Run as... / Maven build...*
3434
![Launcher Image](images/Launcher.png)
3535

3636
Once you have run the launcher, you can find the jar files in the /target directory. There are two:
37-
* **JSONata4Java-1.5.2-jar-with-dependencies.jar** (thinks includes dependent jar files)
38-
* **JSONata4Java-1.5.2.jar** (only the JSONata4Java code)
37+
* **JSONata4Java-1.5.5-jar-with-dependencies.jar** (thinks includes dependent jar files)
38+
* **JSONata4Java-1.5.5.jar** (only the JSONata4Java code)
3939

4040
The com.api.jsonata4java.Tester program enables you to enter an expression and run it
4141
against the same JSON as is used at the https://try.jsonata.org site. You can also
@@ -158,4 +158,6 @@ From: https://docs.jsonata.org/numeric-functions we did not implement:
158158
* $formatInteger()
159159
* $parseInteger()
160160

161+
There are some jsonata.org 1.8.4 tests that we skip because we fail on them in the AgnosticTestSuite.java.
162+
161163

dataobject_8.json

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
{
2+
"var1": "val1",
3+
"var2": {
4+
"firstName": "John",
5+
"lastName": "doe",
6+
"age": 26,
7+
"address": {
8+
"streetAddress": "naist street",
9+
"city": "Nara",
10+
"postalCode": "630-0192"
11+
},
12+
"phoneNumbers": [
13+
{
14+
"type": "iPhone",
15+
"number": "0123-4567-8888"
16+
},
17+
{
18+
"type": "home",
19+
"number": "0123-4567-8910"
20+
}
21+
]
22+
},
23+
"var3": {
24+
"firstName": "Paul",
25+
"lastName": "Smith",
26+
"age": 32,
27+
"address": {
28+
"streetAddress": "main avenue",
29+
"city": "Smart City",
30+
"postalCode": "234-234"
31+
},
32+
"phoneNumbers": [
33+
{
34+
"type": "Android",
35+
"number": "0123-4567-9999"
36+
},
37+
{
38+
"type": "office",
39+
"number": "0123-4567-2222"
40+
}
41+
]
42+
}
43+
}

dataset_case025.json

Lines changed: 247 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,247 @@
1+
{
2+
"jsonata": {
3+
"2019-01-01": 889,
4+
"2019-01-02": 1792,
5+
"2019-01-03": 2236,
6+
"2019-01-04": 2544,
7+
"2019-01-05": 1448,
8+
"2019-01-06": 1544,
9+
"2019-01-07": 2351,
10+
"2019-01-08": 2513,
11+
"2019-01-09": 2709,
12+
"2019-01-10": 2573,
13+
"2019-01-11": 2776,
14+
"2019-01-12": 1366,
15+
"2019-01-13": 1423,
16+
"2019-01-14": 2372,
17+
"2019-01-15": 2420,
18+
"2019-01-16": 2438,
19+
"2019-01-17": 2420,
20+
"2019-01-18": 2658,
21+
"2019-01-19": 1424,
22+
"2019-01-20": 1260,
23+
"2019-01-21": 2466,
24+
"2019-01-22": 2708,
25+
"2019-01-23": 2991,
26+
"2019-01-24": 2429,
27+
"2019-01-25": 2491,
28+
"2019-01-26": 1459,
29+
"2019-01-27": 1444,
30+
"2019-01-28": 2722,
31+
"2019-01-29": 2987,
32+
"2019-01-30": 2670,
33+
"2019-01-31": 2758,
34+
"2019-02-01": 2757,
35+
"2019-02-02": 1418,
36+
"2019-02-03": 1626,
37+
"2019-02-04": 2541,
38+
"2019-02-05": 2600,
39+
"2019-02-06": 2595,
40+
"2019-02-07": 2627,
41+
"2019-02-08": 2290,
42+
"2019-02-09": 1301,
43+
"2019-02-10": 1491,
44+
"2019-02-11": 2731,
45+
"2019-02-12": 2789,
46+
"2019-02-13": 2522,
47+
"2019-02-14": 2757,
48+
"2019-02-15": 2462,
49+
"2019-02-16": 1485,
50+
"2019-02-17": 1585,
51+
"2019-02-18": 2243,
52+
"2019-02-19": 2865,
53+
"2019-02-20": 2714,
54+
"2019-02-21": 2631,
55+
"2019-02-22": 2532,
56+
"2019-02-23": 1408,
57+
"2019-02-24": 1301,
58+
"2019-02-25": 2502,
59+
"2019-02-26": 2731,
60+
"2019-02-27": 2616,
61+
"2019-02-28": 2552,
62+
"2019-03-01": 2462,
63+
"2019-03-02": 1647,
64+
"2019-03-03": 1319,
65+
"2019-03-04": 2788,
66+
"2019-03-05": 3008,
67+
"2019-03-06": 2528,
68+
"2019-03-07": 2662,
69+
"2019-03-08": 2521,
70+
"2019-03-09": 1536,
71+
"2019-03-10": 1400,
72+
"2019-03-11": 2617,
73+
"2019-03-12": 3258,
74+
"2019-03-13": 3424,
75+
"2019-03-14": 3267,
76+
"2019-03-15": 2940,
77+
"2019-03-16": 1976,
78+
"2019-03-17": 1709,
79+
"2019-03-18": 1281,
80+
"2019-03-19": 3484,
81+
"2019-03-20": 3555,
82+
"2019-03-21": 3223,
83+
"2019-03-22": 3011,
84+
"2019-03-23": 1847,
85+
"2019-03-24": 1942,
86+
"2019-03-25": 3015,
87+
"2019-03-26": 3372,
88+
"2019-03-27": 3518,
89+
"2019-03-28": 3150,
90+
"2019-03-29": 3015,
91+
"2019-03-30": 1645,
92+
"2019-03-31": 1505,
93+
"2019-04-01": 3215,
94+
"2019-04-02": 3165,
95+
"2019-04-03": 3117,
96+
"2019-04-04": 3009,
97+
"2019-04-05": 3452,
98+
"2019-04-06": 1628,
99+
"2019-04-07": 1555,
100+
"2019-04-08": 3156,
101+
"2019-04-09": 2875,
102+
"2019-04-10": 2986,
103+
"2019-04-11": 2985,
104+
"2019-04-12": 2789,
105+
"2019-04-13": 1415,
106+
"2019-04-14": 1442,
107+
"2019-04-15": 2661,
108+
"2019-04-16": 3073,
109+
"2019-04-17": 2975,
110+
"2019-04-18": 2672,
111+
"2019-04-19": 1930,
112+
"2019-04-20": 1203,
113+
"2019-04-21": 1170,
114+
"2019-04-22": 2534,
115+
"2019-04-23": 3070,
116+
"2019-04-24": 3800,
117+
"2019-04-25": 3131,
118+
"2019-04-26": 3073,
119+
"2019-04-27": 1520,
120+
"2019-04-28": 1390,
121+
"2019-04-29": 2756,
122+
"2019-04-30": 2758,
123+
"2019-05-01": 2507,
124+
"2019-05-02": 3208,
125+
"2019-05-03": 3445,
126+
"2019-05-04": 1685,
127+
"2019-05-05": 1495,
128+
"2019-05-06": 3269,
129+
"2019-05-07": 3426,
130+
"2019-05-08": 3258,
131+
"2019-05-09": 3178,
132+
"2019-05-10": 2997,
133+
"2019-05-11": 1627,
134+
"2019-05-12": 1223,
135+
"2019-05-13": 3102,
136+
"2019-05-14": 3587,
137+
"2019-05-15": 3100,
138+
"2019-05-16": 3367,
139+
"2019-05-17": 3221,
140+
"2019-05-18": 1530,
141+
"2019-05-19": 1182,
142+
"2019-05-20": 2957,
143+
"2019-05-21": 3311,
144+
"2019-05-22": 3661,
145+
"2019-05-23": 3577,
146+
"2019-05-24": 3053,
147+
"2019-05-25": 1328,
148+
"2019-05-26": 1204,
149+
"2019-05-27": 2641,
150+
"2019-05-28": 8328,
151+
"2019-05-29": 17660,
152+
"2019-05-30": 15634,
153+
"2019-05-31": 15599,
154+
"2019-06-01": 4822,
155+
"2019-06-02": 5264,
156+
"2019-06-03": 19349,
157+
"2019-06-04": 21550,
158+
"2019-06-05": 36310,
159+
"2019-06-06": 18592,
160+
"2019-06-07": 17869,
161+
"2019-06-08": 4877,
162+
"2019-06-09": 4324,
163+
"2019-06-10": 17473,
164+
"2019-06-11": 20640,
165+
"2019-06-12": 20604,
166+
"2019-06-13": 20963,
167+
"2019-06-14": 16736,
168+
"2019-06-15": 4112,
169+
"2019-06-16": 4349,
170+
"2019-06-17": 23274,
171+
"2019-06-18": 25012,
172+
"2019-06-19": 21058,
173+
"2019-06-20": 20439,
174+
"2019-06-21": 21925,
175+
"2019-06-22": 4618,
176+
"2019-06-23": 4925,
177+
"2019-06-24": 24140,
178+
"2019-06-25": 23948,
179+
"2019-06-26": 22750,
180+
"2019-06-27": 23307,
181+
"2019-06-28": 21104,
182+
"2019-06-29": 4903,
183+
"2019-06-30": 5007,
184+
"2019-07-01": 23655,
185+
"2019-07-02": 27579,
186+
"2019-07-03": 27072,
187+
"2019-07-04": 23840,
188+
"2019-07-05": 19827,
189+
"2019-07-06": 5015,
190+
"2019-07-07": 5914,
191+
"2019-07-08": 27916,
192+
"2019-07-09": 29980,
193+
"2019-07-10": 30276,
194+
"2019-07-11": 30459,
195+
"2019-07-12": 24334,
196+
"2019-07-13": 6853,
197+
"2019-07-14": 7217,
198+
"2019-07-15": 28602,
199+
"2019-07-16": 29082,
200+
"2019-07-17": 31428,
201+
"2019-07-18": 29343,
202+
"2019-07-19": 28385,
203+
"2019-07-20": 5610,
204+
"2019-07-21": 5980,
205+
"2019-07-22": 29996,
206+
"2019-07-23": 31486,
207+
"2019-07-24": 31543,
208+
"2019-07-25": 28539,
209+
"2019-07-26": 26029,
210+
"2019-07-27": 5169,
211+
"2019-07-28": 5936,
212+
"2019-07-29": 31774,
213+
"2019-07-30": 27629,
214+
"2019-07-31": 32280,
215+
"2019-08-01": 32947,
216+
"2019-08-02": 28920,
217+
"2019-08-03": 6538,
218+
"2019-08-04": 7263,
219+
"2019-08-05": 32893,
220+
"2019-08-06": 33360,
221+
"2019-08-07": 31727,
222+
"2019-08-08": 32074,
223+
"2019-08-09": 27695,
224+
"2019-08-10": 7007,
225+
"2019-08-11": 7640,
226+
"2019-08-12": 29802,
227+
"2019-08-13": 35060,
228+
"2019-08-14": 34097,
229+
"2019-08-15": 27904,
230+
"2019-08-16": 28759,
231+
"2019-08-17": 6614,
232+
"2019-08-18": 8024,
233+
"2019-08-19": 33020,
234+
"2019-08-20": 35527,
235+
"2019-08-21": 34475,
236+
"2019-08-22": 33838,
237+
"2019-08-23": 29362,
238+
"2019-08-24": 7680,
239+
"2019-08-25": 9561,
240+
"2019-08-26": 32594,
241+
"2019-08-27": 38115,
242+
"2019-08-28": 37219,
243+
"2019-08-29": 38805,
244+
"2019-08-30": 31773,
245+
"2019-08-31": 8029
246+
}
247+
}

pom.xml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
<modelVersion>4.0.0</modelVersion>
2828
<groupId>com.ibm.jsonata4java</groupId>
2929
<artifactId>JSONata4Java</artifactId>
30-
<version>1.5.2</version>
30+
<version>1.5.5</version>
3131
<name>JSONata4Java</name>
3232
<description>Port of jsonata.js to Java to enable rules for JSON content</description>
3333
<url>https://github.com/IBM/JSONata4Java</url>
@@ -214,10 +214,14 @@
214214
<goal>wget</goal>
215215
</goals>
216216
<configuration>
217-
<url>https://github.com/jsonata-js/jsonata/archive/v1.8.3.zip</url>
217+
<url>https://github.com/jsonata-js/jsonata/archive/v1.8.4.zip</url>
218218
<unpack>true</unpack>
219219
<outputDirectory>${project.build.directory}/jsonata</outputDirectory>
220-
<md5>3db67b7aec88d9b542d42e88547a1e26</md5>
220+
<md5>c8f057d10e659c27a5aa79f11d961947</md5>
221+
<!--
222+
<url>https://github.com/jsonata-js/jsonata/archive/v1.8.3.zip</url>
223+
<md5>3db67b7aec88d9b542d42e88547a1e26</md5>
224+
-->
221225
</configuration>
222226
</execution>
223227
</executions>
@@ -246,7 +250,7 @@
246250
<plugin>
247251
<groupId>org.antlr</groupId>
248252
<artifactId>antlr4-maven-plugin</artifactId>
249-
<version>4.8-1</version>
253+
<version>4.9.2</version>
250254
<configuration>
251255
<sourceDirectory>src/main/antlr4</sourceDirectory>
252256
<outputDirectory>src/main/java</outputDirectory>

src/main/antlr4/com/api/jsonata4java/expressions/generated/MappingExpression.g4

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
*/
2222

2323
/* Antlr grammar defining the mapping expression language */
24-
24+
2525
grammar MappingExpression;
2626

2727
//options {

src/main/antlr4/com/api/jsonata4java/expressions/path/generated/PathExpressionLexer.g4

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
* limitations under the License.
2020
*
2121
*/
22-
22+
2323
/* Grammar defining the subset of JSONata we support on the LHS of mapping expressions */
2424

2525
lexer grammar PathExpressionLexer;

src/main/antlr4/com/api/jsonata4java/expressions/path/generated/PathExpressionParser.g4

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
*/
2222

2323
/* Grammar defining the subset of JSONata we support on the LHS of mapping expressions */
24-
24+
2525
parser grammar PathExpressionParser;
2626

2727
options {tokenVocab = PathExpressionLexer;}

0 commit comments

Comments
 (0)