Repository: developmentseed/cql2-rs (language: python)

Issue:
Create fixtures for standardized output for all tests that come from the OGC examples.
Right now, we test that running the parser against all OGC examples passes validation, but we do not actually check that the output is what we expect. Create CQL2 text and CQL2 json examples that will match the output from the OGC examples formatted to match the output of cql2-rs


Discussion / hints:

Fix patch:
diff --git a/.github/workflows/test.yml b/.github/workflows/ci.yml
similarity index 52%
rename from .github/workflows/test.yml
rename to .github/workflows/ci.yml
index 561e383..4ad7907 100644
--- a/.github/workflows/test.yml
+++ b/.github/workflows/ci.yml
@@ -1,4 +1,4 @@
-name: Rust
+name: CI
 
 on:
   push:
@@ -12,24 +12,16 @@ jobs:
     runs-on: ubuntu-latest
     steps:
       - uses: actions/checkout@v3
-
       - name: Install Rust
         uses: dtolnay/rust-toolchain@stable
         with:
           components: rustfmt, clippy
-
       - uses: Swatinem/rust-cache@v2
-
-      - name: Cargo fmt
+      - name: cargo fmt
         run: cargo fmt -- --check
-
-      - name: "clippy --all"
-        run: cargo clippy --all-features --tests -- -D warnings
-
-      - name: "cargo check"
-        run: cargo check --all-features
-
-      - name: "cargo test"
-        run: |
-          cargo test --all --no-default-features
-          cargo test --all --all-features
+      - name: cargo clippy
+        run: cargo clippy --tests -- -D warnings
+      - name: cargo check
+        run: cargo check
+      - name: cargo test
+        run: cargo test
diff --git a/rustfmt.toml b/rustfmt.toml
new file mode 100644
index 0000000..c3c8c37
--- /dev/null
+++ b/rustfmt.toml
@@ -0,0 +1,1 @@
+imports_granularity = "Crate"
diff --git a/src/lib.rs b/src/lib.rs
index d49112a..c5794ad 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -3,16 +3,19 @@
 #![deny(unused_crate_dependencies)]
 
 use boon::{Compiler, SchemaIndex, Schemas, ValidationError};
-use geozero::geojson::{GeoJsonString, GeoJsonWriter};
-use geozero::wkt::Wkt;
-use geozero::{CoordDimensions, GeozeroGeometry, ToJson, ToWkt};
-use pest::iterators::{Pair, Pairs};
-use pest::pratt_parser::PrattParser;
-use pest::Parser;
+use geozero::{
+    geojson::{GeoJsonString, GeoJsonWriter},
+    wkt::Wkt,
+    CoordDimensions, GeozeroGeometry, ToJson, ToWkt,
+};
+use pest::{
+    iterators::{Pair, Pairs},
+    pratt_parser::PrattParser,
+    Parser,
+};
 use serde_derive::{Deserialize, Serialize};
 use serde_json::Value;
-use std::fs;
-use std::path::Path;
+use std::{fs, io::Read, path::Path};
 use thiserror::Error;
 
 /// Crate-specific error enum.
@@ -675,8 +678,10 @@ pub fn parse_file(path: impl AsRef<Path>) -> Result<Expr, Error> {
 }
 
 fn get_stdin() -> Result<String, std::io::Error> {
-    use std::env;
-    use std::io::{self, IsTerminal};
+    use std::{
+        env,
+        io::{self, IsTerminal},
+    };
     let args: Vec<String> = env::args().collect();
     let mut buffer = String::new();
 
@@ -686,7 +691,7 @@ fn get_stdin() -> Result<String, std::io::Error> {
         println!("Enter CQL2 as Text or JSON, then hit return");
         io::stdin().read_line(&mut buffer)?;
     } else {
-        io::stdin().read_line(&mut buffer)?;
+        io::stdin().read_to_string(&mut buffer)?;
     }
     Ok(buffer)
 }


Test patch:
diff --git a/tests/README.md b/tests/README.md
new file mode 100644
index 0000000..bd17477
--- /dev/null
+++ b/tests/README.md
@@ -0,0 +1,7 @@
+# Expected test output
+
+To generate:
+
+```shell
+tests/expected/generate
+```
diff --git a/tests/expected/json/clause6_01.json b/tests/expected/json/clause6_01.json
new file mode 100644
index 0000000..fe3290a
--- /dev/null
+++ b/tests/expected/json/clause6_01.json
@@ -0,0 +1,1 @@
+{"op":"avg","args":[{"property":"windSpeed"}]}
diff --git a/tests/expected/json/clause6_01.txt b/tests/expected/json/clause6_01.txt
new file mode 100644
index 0000000..7da7915
--- /dev/null
+++ b/tests/expected/json/clause6_01.txt
@@ -0,0 +1,1 @@
+avg("windSpeed")
diff --git a/tests/expected/json/clause6_02a.json b/tests/expected/json/clause6_02a.json
new file mode 100644
index 0000000..21be46c
--- /dev/null
+++ b/tests/expected/json/clause6_02a.json
@@ -0,0 +1,1 @@
+{"op":"=","args":[{"property":"city"},"Toronto"]}
diff --git a/tests/expected/json/clause6_02a.txt b/tests/expected/json/clause6_02a.txt
new file mode 100644
index 0000000..9eadc2d
--- /dev/null
+++ b/tests/expected/json/clause6_02a.txt
@@ -0,0 +1,1 @@
+("city" = 'Toronto')
diff --git a/tests/expected/json/clause6_02b.json b/tests/expected/json/clause6_02b.json
new file mode 100644
index 0000000..7f5a3ea
--- /dev/null
+++ b/tests/expected/json/clause6_02b.json
@@ -0,0 +1,1 @@
+{"op":"<","args":[{"op":"avg","args":[{"property":"windSpeed"}]},4.0]}
diff --git a/tests/expected/json/clause6_02b.txt b/tests/expected/json/clause6_02b.txt
new file mode 100644
index 0000000..8e74c1c
--- /dev/null
+++ b/tests/expected/json/clause6_02b.txt
@@ -0,0 +1,1 @@
+(avg("windSpeed") < 4)
diff --git a/tests/expected/json/clause6_02c.json b/tests/expected/json/clause6_02c.json
new file mode 100644
index 0000000..9f04c8b
--- /dev/null
+++ b/tests/expected/json/clause6_02c.json
@@ -0,0 +1,1 @@
+{"op":">","args":[{"op":"-","args":[{"property":"balance"},150.0]},0.0]}
diff --git a/tests/expected/json/clause6_02c.txt b/tests/expected/json/clause6_02c.txt
new file mode 100644
index 0000000..04a3306
--- /dev/null
+++ b/tests/expected/json/clause6_02c.txt
@@ -0,0 +1,1 @@
+(("balance" - 150) > 0)
diff --git a/tests/expected/json/clause6_02d.json b/tests/expected/json/clause6_02d.json
new file mode 100644
index 0000000..87d2bd3
--- /dev/null
+++ b/tests/expected/json/clause6_02d.json
@@ -0,0 +1,1 @@
+{"op":">=","args":[{"property":"updated"},{"date":"1970-01-01"}]}
diff --git a/tests/expected/json/clause6_02d.txt b/tests/expected/json/clause6_02d.txt
new file mode 100644
index 0000000..652b385
--- /dev/null
+++ b/tests/expected/json/clause6_02d.txt
@@ -0,0 +1,1 @@
+("updated" >= DATE('1970-01-01'))
diff --git a/tests/expected/json/clause6_03.json b/tests/expected/json/clause6_03.json
new file mode 100644
index 0000000..a5410f8
--- /dev/null
+++ b/tests/expected/json/clause6_03.json
@@ -0,0 +1,1 @@
+{"op":"not","args":[{"op":"isNull","args":[{"property":"geometry"}]}]}
diff --git a/tests/expected/json/clause6_03.txt b/tests/expected/json/clause6_03.txt
new file mode 100644
index 0000000..a220659
--- /dev/null
+++ b/tests/expected/json/clause6_03.txt
@@ -0,0 +1,1 @@
+(NOT isNull("geometry"))
diff --git a/tests/expected/json/clause7_01.json b/tests/expected/json/clause7_01.json
new file mode 100644
index 0000000..2b121e5
--- /dev/null
+++ b/tests/expected/json/clause7_01.json
@@ -0,0 +1,1 @@
+{"op":"like","args":[{"property":"name"},"Smith%"]}
diff --git a/tests/expected/json/clause7_01.txt b/tests/expected/json/clause7_01.txt
new file mode 100644
index 0000000..5775a98
--- /dev/null
+++ b/tests/expected/json/clause7_01.txt
@@ -0,0 +1,1 @@
+like("name", 'Smith%')
diff --git a/tests/expected/json/clause7_02.json b/tests/expected/json/clause7_02.json
new file mode 100644
index 0000000..1493b69
--- /dev/null
+++ b/tests/expected/json/clause7_02.json
@@ -0,0 +1,1 @@
+{"op":"between","args":[{"property":"depth"},100.0,150.0]}
diff --git a/tests/expected/json/clause7_02.txt b/tests/expected/json/clause7_02.txt
new file mode 100644
index 0000000..2ef194b
--- /dev/null
+++ b/tests/expected/json/clause7_02.txt
@@ -0,0 +1,1 @@
+("depth" BETWEEN 100 AND 150)
diff --git a/tests/expected/json/clause7_03a.json b/tests/expected/json/clause7_03a.json
new file mode 100644
index 0000000..2e6269b
--- /dev/null
+++ b/tests/expected/json/clause7_03a.json
@@ -0,0 +1,1 @@
+{"op":"in","args":[{"property":"cityName"},["Toronto","Frankfurt","Tokyo","New York"]]}
diff --git a/tests/expected/json/clause7_03a.txt b/tests/expected/json/clause7_03a.txt
new file mode 100644
index 0000000..2db8c38
--- /dev/null
+++ b/tests/expected/json/clause7_03a.txt
@@ -0,0 +1,1 @@
+in("cityName", ('Toronto', 'Frankfurt', 'Tokyo', 'New York'))
diff --git a/tests/expected/json/clause7_03b.json b/tests/expected/json/clause7_03b.json
new file mode 100644
index 0000000..9bda911
--- /dev/null
+++ b/tests/expected/json/clause7_03b.json
@@ -0,0 +1,1 @@
+{"op":"not","args":[{"op":"in","args":[{"property":"category"},[1.0,2.0,3.0,4.0]]}]}
diff --git a/tests/expected/json/clause7_03b.txt b/tests/expected/json/clause7_03b.txt
new file mode 100644
index 0000000..d6823b3
--- /dev/null
+++ b/tests/expected/json/clause7_03b.txt
@@ -0,0 +1,1 @@
+(NOT in("category", (1, 2, 3, 4)))
diff --git a/tests/expected/json/clause7_04.json b/tests/expected/json/clause7_04.json
new file mode 100644
index 0000000..918f401
--- /dev/null
+++ b/tests/expected/json/clause7_04.json
@@ -0,0 +1,1 @@
+{"op":"in","args":[{"op":"casei","args":[{"property":"road_class"}]},[{"op":"casei","args":["Οδος"]},{"op":"casei","args":["Straße"]}]]}
diff --git a/tests/expected/json/clause7_04.txt b/tests/expected/json/clause7_04.txt
new file mode 100644
index 0000000..cf16575
--- /dev/null
+++ b/tests/expected/json/clause7_04.txt
@@ -0,0 +1,1 @@
+in(casei("road_class"), (casei('Οδος'), casei('Straße')))
diff --git a/tests/expected/json/clause7_05.json b/tests/expected/json/clause7_05.json
new file mode 100644
index 0000000..5903327
--- /dev/null
+++ b/tests/expected/json/clause7_05.json
@@ -0,0 +1,1 @@
+{"op":"=","args":[{"op":"accenti","args":[{"property":"etat_vol"}]},{"op":"accenti","args":["débárquér"]}]}
diff --git a/tests/expected/json/clause7_05.txt b/tests/expected/json/clause7_05.txt
new file mode 100644
index 0000000..2899d9e
--- /dev/null
+++ b/tests/expected/json/clause7_05.txt
@@ -0,0 +1,1 @@
+(accenti("etat_vol") = accenti('débárquér'))
diff --git a/tests/expected/json/clause7_07.json b/tests/expected/json/clause7_07.json
new file mode 100644
index 0000000..466c96e
--- /dev/null
+++ b/tests/expected/json/clause7_07.json
@@ -0,0 +1,1 @@
+{"op":"s_intersects","args":[{"property":"geometry"},{"type":"Point","coordinates":[36.319836,32.288087]}]}
diff --git a/tests/expected/json/clause7_07.txt b/tests/expected/json/clause7_07.txt
new file mode 100644
index 0000000..eeb90f9
--- /dev/null
+++ b/tests/expected/json/clause7_07.txt
@@ -0,0 +1,1 @@
+s_intersects("geometry", POINT(36.319836 32.288087))
diff --git a/tests/expected/json/clause7_10.json b/tests/expected/json/clause7_10.json
new file mode 100644
index 0000000..c71f5ff
--- /dev/null
+++ b/tests/expected/json/clause7_10.json
@@ -0,0 +1,1 @@
+{"op":"s_crosses","args":[{"property":"road"},{"type":"Polygon","coordinates":[[[43.7286,-79.2986],[43.7311,-79.2996],[43.7323,-79.2972],[43.7326,-79.2971],[43.735,-79.2981],[43.735,-79.2982],[43.7352,-79.2982],[43.7357,-79.2956],[43.7337,-79.2948],[43.7343,-79.2933],[43.7339,-79.2923],[43.7327,-79.2947],[43.732,-79.2942],[43.7322,-79.2937],[43.7306,-79.293],[43.7303,-79.293],[43.7299,-79.2928],[43.7286,-79.2986]]]}]}
diff --git a/tests/expected/json/clause7_10.txt b/tests/expected/json/clause7_10.txt
new file mode 100644
index 0000000..3286a73
--- /dev/null
+++ b/tests/expected/json/clause7_10.txt
@@ -0,0 +1,1 @@
+s_crosses("road", POLYGON((43.7286 -79.2986,43.7311 -79.2996,43.7323 -79.2972,43.7326 -79.2971,43.735 -79.2981,43.735 -79.2982,43.7352 -79.2982,43.7357 -79.2956,43.7337 -79.2948,43.7343 -79.2933,43.7339 -79.2923,43.7327 -79.2947,43.732 -79.2942,43.7322 -79.2937,43.7306 -79.293,43.7303 -79.293,43.7299 -79.2928,43.7286 -79.2986)))
diff --git a/tests/expected/json/clause7_12.json b/tests/expected/json/clause7_12.json
new file mode 100644
index 0000000..281c144
--- /dev/null
+++ b/tests/expected/json/clause7_12.json
@@ -0,0 +1,1 @@
+{"op":"t_intersects","args":[{"property":"event_time"},{"interval":["1969-07-16T05:32:00Z","1969-07-24T16:50:35Z"]}]}
diff --git a/tests/expected/json/clause7_12.txt b/tests/expected/json/clause7_12.txt
new file mode 100644
index 0000000..4dc5306
--- /dev/null
+++ b/tests/expected/json/clause7_12.txt
@@ -0,0 +1,1 @@
+t_intersects("event_time", INTERVAL('1969-07-16T05:32:00Z','1969-07-24T16:50:35Z'))
diff --git a/tests/expected/json/clause7_13.json b/tests/expected/json/clause7_13.json
new file mode 100644
index 0000000..29d93dd
--- /dev/null
+++ b/tests/expected/json/clause7_13.json
@@ -0,0 +1,1 @@
+{"op":"t_during","args":[{"interval":[{"property":"touchdown"},{"property":"liftOff"}]},{"interval":["1969-07-16T13:32:00Z","1969-07-24T16:50:35Z"]}]}
diff --git a/tests/expected/json/clause7_13.txt b/tests/expected/json/clause7_13.txt
new file mode 100644
index 0000000..bb6c3dc
--- /dev/null
+++ b/tests/expected/json/clause7_13.txt
@@ -0,0 +1,1 @@
+t_during(INTERVAL("touchdown","liftOff"), INTERVAL('1969-07-16T13:32:00Z','1969-07-24T16:50:35Z'))
diff --git a/tests/expected/json/clause7_15.json b/tests/expected/json/clause7_15.json
new file mode 100644
index 0000000..c88bf36
--- /dev/null
+++ b/tests/expected/json/clause7_15.json
@@ -0,0 +1,1 @@
+{"op":"a_contains","args":[{"property":"layer:ids"},["layers-ca","layers-us"]]}
diff --git a/tests/expected/json/clause7_15.txt b/tests/expected/json/clause7_15.txt
new file mode 100644
index 0000000..53d5bb4
--- /dev/null
+++ b/tests/expected/json/clause7_15.txt
@@ -0,0 +1,1 @@
+a_contains("layer:ids", ('layers-ca', 'layers-us'))
diff --git a/tests/expected/json/clause7_16.json b/tests/expected/json/clause7_16.json
new file mode 100644
index 0000000..8b03b4c
--- /dev/null
+++ b/tests/expected/json/clause7_16.json
@@ -0,0 +1,1 @@
+{"op":"s_crosses","args":[{"type":"LineString","coordinates":[[43.72992,-79.2998],[43.73005,-79.2991],[43.73006,-79.2984],[43.7314,-79.2956],[43.73259,-79.295],[43.73266,-79.2945],[43.7332,-79.2936],[43.73378,-79.2936],[43.73486,-79.2917]]},{"type":"Polygon","coordinates":[[[43.7286,-79.2986],[43.7311,-79.2996],[43.7323,-79.2972],[43.7326,-79.2971],[43.735,-79.2981],[43.735,-79.2982],[43.7352,-79.2982],[43.7357,-79.2956],[43.7337,-79.2948],[43.7343,-79.2933],[43.7339,-79.2923],[43.7327,-79.2947],[43.732,-79.2942],[43.7322,-79.2937],[43.7306,-79.293],[43.7303,-79.293],[43.7299,-79.2928],[43.7286,-79.2986]]]}]}
diff --git a/tests/expected/json/clause7_16.txt b/tests/expected/json/clause7_16.txt
new file mode 100644
index 0000000..0072784
--- /dev/null
+++ b/tests/expected/json/clause7_16.txt
@@ -0,0 +1,1 @@
+s_crosses(LINESTRING(43.72992 -79.2998,43.73005 -79.2991,43.73006 -79.2984,43.7314 -79.2956,43.73259 -79.295,43.73266 -79.2945,43.7332 -79.2936,43.73378 -79.2936,43.73486 -79.2917), POLYGON((43.7286 -79.2986,43.7311 -79.2996,43.7323 -79.2972,43.7326 -79.2971,43.735 -79.2981,43.735 -79.2982,43.7352 -79.2982,43.7357 -79.2956,43.7337 -79.2948,43.7343 -79.2933,43.7339 -79.2923,43.7327 -79.2947,43.732 -79.2942,43.7322 -79.2937,43.7306 -79.293,43.7303 -79.293,43.7299 -79.2928,43.7286 -79.2986)))
diff --git a/tests/expected/json/clause7_17.json b/tests/expected/json/clause7_17.json
new file mode 100644
index 0000000..325540c
--- /dev/null
+++ b/tests/expected/json/clause7_17.json
@@ -0,0 +1,1 @@
+{"op":"t_during","args":[{"interval":["1969-07-20T20:17:40Z","1969-07-21T17:54:00Z"]},{"interval":["1969-07-16T13:32:00Z","1969-07-24T16:50:35Z"]}]}
diff --git a/tests/expected/json/clause7_17.txt b/tests/expected/json/clause7_17.txt
new file mode 100644
index 0000000..1a5313e
--- /dev/null
+++ b/tests/expected/json/clause7_17.txt
@@ -0,0 +1,1 @@
+t_during(INTERVAL('1969-07-20T20:17:40Z','1969-07-21T17:54:00Z'), INTERVAL('1969-07-16T13:32:00Z','1969-07-24T16:50:35Z'))
diff --git a/tests/expected/json/clause7_18.json b/tests/expected/json/clause7_18.json
new file mode 100644
index 0000000..e23a36e
--- /dev/null
+++ b/tests/expected/json/clause7_18.json
@@ -0,0 +1,1 @@
+{"op":"s_within","args":[{"property":"road"},{"op":"Buffer","args":[{"property":"geometry"},10.0,"m"]}]}
diff --git a/tests/expected/json/clause7_18.txt b/tests/expected/json/clause7_18.txt
new file mode 100644
index 0000000..8e597aa
--- /dev/null
+++ b/tests/expected/json/clause7_18.txt
@@ -0,0 +1,1 @@
+s_within("road", Buffer("geometry", 10, 'm'))
diff --git a/tests/expected/json/clause7_19.json b/tests/expected/json/clause7_19.json
new file mode 100644
index 0000000..a07993f
--- /dev/null
+++ b/tests/expected/json/clause7_19.json
@@ -0,0 +1,1 @@
+{"op":">","args":[{"property":"vehicle_height"},{"op":"-","args":[{"property":"bridge_clearance"},1.0]}]}
diff --git a/tests/expected/json/clause7_19.txt b/tests/expected/json/clause7_19.txt
new file mode 100644
index 0000000..2401b91
--- /dev/null
+++ b/tests/expected/json/clause7_19.txt
@@ -0,0 +1,1 @@
+("vehicle_height" > ("bridge_clearance" - 1))
diff --git a/tests/expected/json/example01.json b/tests/expected/json/example01.json
new file mode 100644
index 0000000..b5de01a
--- /dev/null
+++ b/tests/expected/json/example01.json
@@ -0,0 +1,1 @@
+{"op":"=","args":[{"property":"landsat:scene_id"},"LC82030282019133LGN00"]}
diff --git a/tests/expected/json/example01.txt b/tests/expected/json/example01.txt
new file mode 100644
index 0000000..8ea0134
--- /dev/null
+++ b/tests/expected/json/example01.txt
@@ -0,0 +1,1 @@
+("landsat:scene_id" = 'LC82030282019133LGN00')
diff --git a/tests/expected/json/example02.json b/tests/expected/json/example02.json
new file mode 100644
index 0000000..001ff68
--- /dev/null
+++ b/tests/expected/json/example02.json
@@ -0,0 +1,1 @@
+{"op":"like","args":[{"property":"eo:instrument"},"OLI%"]}
diff --git a/tests/expected/json/example02.txt b/tests/expected/json/example02.txt
new file mode 100644
index 0000000..c7b9388
--- /dev/null
+++ b/tests/expected/json/example02.txt
@@ -0,0 +1,1 @@
+like("eo:instrument", 'OLI%')
diff --git a/tests/expected/json/example03.json b/tests/expected/json/example03.json
new file mode 100644
index 0000000..a3a8e9d
--- /dev/null
+++ b/tests/expected/json/example03.json
@@ -0,0 +1,1 @@
+{"op":"in","args":[{"property":"landsat:wrs_path"},["153","154","15X"]]}
diff --git a/tests/expected/json/example03.txt b/tests/expected/json/example03.txt
new file mode 100644
index 0000000..51dd73b
--- /dev/null
+++ b/tests/expected/json/example03.txt
@@ -0,0 +1,1 @@
+in("landsat:wrs_path", ('153', '154', '15X'))
diff --git a/tests/expected/json/example04.json b/tests/expected/json/example04.json
new file mode 100644
index 0000000..f2df389
--- /dev/null
+++ b/tests/expected/json/example04.json
@@ -0,0 +1,1 @@
+{"op":"and","args":[{"op":"<","args":[{"property":"eo:cloud_cover"},0.1]},{"op":"=","args":[{"property":"landsat:wrs_row"},28.0]},{"op":"=","args":[{"property":"landsat:wrs_path"},203.0]}]}
diff --git a/tests/expected/json/example04.txt b/tests/expected/json/example04.txt
new file mode 100644
index 0000000..a3b155c
--- /dev/null
+++ b/tests/expected/json/example04.txt
@@ -0,0 +1,1 @@
+(("eo:cloud_cover" < 0.1) AND ("landsat:wrs_row" = 28) AND ("landsat:wrs_path" = 203))
diff --git a/tests/expected/json/example05a.json b/tests/expected/json/example05a.json
new file mode 100644
index 0000000..29e996b
--- /dev/null
+++ b/tests/expected/json/example05a.json
@@ -0,0 +1,1 @@
+{"op":"or","args":[{"op":"=","args":[{"property":"eo:cloud_cover"},0.1]},{"op":"=","args":[{"property":"eo:cloud_cover"},0.2]}]}
diff --git a/tests/expected/json/example05a.txt b/tests/expected/json/example05a.txt
new file mode 100644
index 0000000..203915c
--- /dev/null
+++ b/tests/expected/json/example05a.txt
@@ -0,0 +1,1 @@
+(("eo:cloud_cover" = 0.1) OR ("eo:cloud_cover" = 0.2))
diff --git a/tests/expected/json/example05b.json b/tests/expected/json/example05b.json
new file mode 100644
index 0000000..22874a2
--- /dev/null
+++ b/tests/expected/json/example05b.json
@@ -0,0 +1,1 @@
+{"op":"in","args":[{"property":"eo:cloud_cover"},[0.1,0.2]]}
diff --git a/tests/expected/json/example05b.txt b/tests/expected/json/example05b.txt
new file mode 100644
index 0000000..d86d13f
--- /dev/null
+++ b/tests/expected/json/example05b.txt
@@ -0,0 +1,1 @@
+in("eo:cloud_cover", (0.1, 0.2))
diff --git a/tests/expected/json/example06a.json b/tests/expected/json/example06a.json
new file mode 100644
index 0000000..543a16e
--- /dev/null
+++ b/tests/expected/json/example06a.json
@@ -0,0 +1,1 @@
+{"op":"and","args":[{"op":"between","args":[{"property":"eo:cloud_cover"},0.1,0.2]},{"op":"=","args":[{"property":"landsat:wrs_row"},28.0]},{"op":"=","args":[{"property":"landsat:wrs_path"},203.0]}]}
diff --git a/tests/expected/json/example06a.txt b/tests/expected/json/example06a.txt
new file mode 100644
index 0000000..f3e83f9
--- /dev/null
+++ b/tests/expected/json/example06a.txt
@@ -0,0 +1,1 @@
+(("eo:cloud_cover" BETWEEN 0.1 AND 0.2) AND ("landsat:wrs_row" = 28) AND ("landsat:wrs_path" = 203))
diff --git a/tests/expected/json/example06b.json b/tests/expected/json/example06b.json
new file mode 100644
index 0000000..f986256
--- /dev/null
+++ b/tests/expected/json/example06b.json
@@ -0,0 +1,1 @@
+{"op":"and","args":[{"op":">=","args":[{"property":"eo:cloud_cover"},0.1]},{"op":"<=","args":[{"property":"eo:cloud_cover"},0.2]},{"op":"=","args":[{"property":"landsat:wrs_row"},28.0]},{"op":"=","args":[{"property":"landsat:wrs_path"},203.0]}]}
diff --git a/tests/expected/json/example06b.txt b/tests/expected/json/example06b.txt
new file mode 100644
index 0000000..f369547
--- /dev/null
+++ b/tests/expected/json/example06b.txt
@@ -0,0 +1,1 @@
+(("eo:cloud_cover" >= 0.1) AND ("eo:cloud_cover" <= 0.2) AND ("landsat:wrs_row" = 28) AND ("landsat:wrs_path" = 203))
diff --git a/tests/expected/json/example07.json b/tests/expected/json/example07.json
new file mode 100644
index 0000000..8b7ec9f
--- /dev/null
+++ b/tests/expected/json/example07.json
@@ -0,0 +1,1 @@
+{"op":"and","args":[{"op":"like","args":[{"property":"eo:instrument"},"OLI%"]},{"op":"s_intersects","args":[{"property":"footprint"},{"type":"Polygon","coordinates":[[[43.5845,-79.5442],[43.6079,-79.4893],[43.5677,-79.4632],[43.6129,-79.3925],[43.6223,-79.3238],[43.6576,-79.3163],[43.7945,-79.1178],[43.8144,-79.1542],[43.8555,-79.1714],[43.7509,-79.639],[43.5845,-79.5442]]]}]}]}
diff --git a/tests/expected/json/example07.txt b/tests/expected/json/example07.txt
new file mode 100644
index 0000000..e7f6d32
--- /dev/null
+++ b/tests/expected/json/example07.txt
@@ -0,0 +1,1 @@
+(like("eo:instrument", 'OLI%') AND s_intersects("footprint", POLYGON((43.5845 -79.5442,43.6079 -79.4893,43.5677 -79.4632,43.6129 -79.3925,43.6223 -79.3238,43.6576 -79.3163,43.7945 -79.1178,43.8144 -79.1542,43.8555 -79.1714,43.7509 -79.639,43.5845 -79.5442))))
diff --git a/tests/expected/json/example08.json b/tests/expected/json/example08.json
new file mode 100644
index 0000000..7193360
--- /dev/null
+++ b/tests/expected/json/example08.json
@@ -0,0 +1,1 @@
+{"op":"and","args":[{"op":"=","args":[{"property":"beamMode"},"ScanSAR Narrow"]},{"op":"=","args":[{"property":"swathDirection"},"ascending"]},{"op":"=","args":[{"property":"polarization"},"HH+VV+HV+VH"]},{"op":"s_intersects","args":[{"property":"footprint"},{"type":"Polygon","coordinates":[[[-77.117938,38.93686],[-77.040604,39.995648],[-76.910536,38.892912],[-77.039359,38.791753],[-77.047906,38.841462],[-77.034183,38.840655],[-77.033142,38.85749],[-77.117938,38.93686]]]}]}]}
diff --git a/tests/expected/json/example08.txt b/tests/expected/json/example08.txt
new file mode 100644
index 0000000..3b5001b
--- /dev/null
+++ b/tests/expected/json/example08.txt
@@ -0,0 +1,1 @@
+(("beamMode" = 'ScanSAR Narrow') AND ("swathDirection" = 'ascending') AND ("polarization" = 'HH+VV+HV+VH') AND s_intersects("footprint", POLYGON((-77.117938 38.93686,-77.040604 39.995648,-76.910536 38.892912,-77.039359 38.791753,-77.047906 38.841462,-77.034183 38.840655,-77.033142 38.85749,-77.117938 38.93686))))
diff --git a/tests/expected/json/example09.json b/tests/expected/json/example09.json
new file mode 100644
index 0000000..9fc6caa
--- /dev/null
+++ b/tests/expected/json/example09.json
@@ -0,0 +1,1 @@
+{"op":">","args":[{"property":"floors"},5.0]}
diff --git a/tests/expected/json/example09.txt b/tests/expected/json/example09.txt
new file mode 100644
index 0000000..c8147f0
--- /dev/null
+++ b/tests/expected/json/example09.txt
@@ -0,0 +1,1 @@
+("floors" > 5)
diff --git a/tests/expected/json/example10.json b/tests/expected/json/example10.json
new file mode 100644
index 0000000..1dd499d
--- /dev/null
+++ b/tests/expected/json/example10.json
@@ -0,0 +1,1 @@
+{"op":"<=","args":[{"property":"taxes"},500.0]}
diff --git a/tests/expected/json/example10.txt b/tests/expected/json/example10.txt
new file mode 100644
index 0000000..281c134
--- /dev/null
+++ b/tests/expected/json/example10.txt
@@ -0,0 +1,1 @@
+("taxes" <= 500)
diff --git a/tests/expected/json/example11.json b/tests/expected/json/example11.json
new file mode 100644
index 0000000..c690b9a
--- /dev/null
+++ b/tests/expected/json/example11.json
@@ -0,0 +1,1 @@
+{"op":"like","args":[{"property":"owner"},"%Jones%"]}
diff --git a/tests/expected/json/example11.txt b/tests/expected/json/example11.txt
new file mode 100644
index 0000000..294411f
--- /dev/null
+++ b/tests/expected/json/example11.txt
@@ -0,0 +1,1 @@
+like("owner", '%Jones%')
diff --git a/tests/expected/json/example12.json b/tests/expected/json/example12.json
new file mode 100644
index 0000000..a52bf05
--- /dev/null
+++ b/tests/expected/json/example12.json
@@ -0,0 +1,1 @@
+{"op":"like","args":[{"property":"owner"},"Mike%"]}
diff --git a/tests/expected/json/example12.txt b/tests/expected/json/example12.txt
new file mode 100644
index 0000000..2415deb
--- /dev/null
+++ b/tests/expected/json/example12.txt
@@ -0,0 +1,1 @@
+like("owner", 'Mike%')
diff --git a/tests/expected/json/example13.json b/tests/expected/json/example13.json
new file mode 100644
index 0000000..7395264
--- /dev/null
+++ b/tests/expected/json/example13.json
@@ -0,0 +1,1 @@
+{"op":"not","args":[{"op":"like","args":[{"property":"owner"},"%Mike%"]}]}
diff --git a/tests/expected/json/example13.txt b/tests/expected/json/example13.txt
new file mode 100644
index 0000000..c2a78da
--- /dev/null
+++ b/tests/expected/json/example13.txt
@@ -0,0 +1,1 @@
+(NOT like("owner", '%Mike%'))
diff --git a/tests/expected/json/example14.json b/tests/expected/json/example14.json
new file mode 100644
index 0000000..ca167d2
--- /dev/null
+++ b/tests/expected/json/example14.json
@@ -0,0 +1,1 @@
+{"op":"=","args":[{"property":"swimming_pool"},true]}
diff --git a/tests/expected/json/example14.txt b/tests/expected/json/example14.txt
new file mode 100644
index 0000000..bcec8de
--- /dev/null
+++ b/tests/expected/json/example14.txt
@@ -0,0 +1,1 @@
+("swimming_pool" = true)
diff --git a/tests/expected/json/example15.json b/tests/expected/json/example15.json
new file mode 100644
index 0000000..97d1cd3
--- /dev/null
+++ b/tests/expected/json/example15.json
@@ -0,0 +1,1 @@
+{"op":"and","args":[{"op":">","args":[{"property":"floors"},5.0]},{"op":"=","args":[{"property":"swimming_pool"},true]}]}
diff --git a/tests/expected/json/example15.txt b/tests/expected/json/example15.txt
new file mode 100644
index 0000000..2ead8f9
--- /dev/null
+++ b/tests/expected/json/example15.txt
@@ -0,0 +1,1 @@
+(("floors" > 5) AND ("swimming_pool" = true))
diff --git a/tests/expected/json/example16.json b/tests/expected/json/example16.json
new file mode 100644
index 0000000..325c276
--- /dev/null
+++ b/tests/expected/json/example16.json
@@ -0,0 +1,1 @@
+{"op":"and","args":[{"op":"=","args":[{"property":"swimming_pool"},true]},{"op":"or","args":[{"op":">","args":[{"property":"floors"},5.0]},{"op":"like","args":[{"property":"material"},"brick%"]},{"op":"like","args":[{"property":"material"},"%brick"]}]}]}
diff --git a/tests/expected/json/example16.txt b/tests/expected/json/example16.txt
new file mode 100644
index 0000000..d978b57
--- /dev/null
+++ b/tests/expected/json/example16.txt
@@ -0,0 +1,1 @@
+(("swimming_pool" = true) AND (("floors" > 5) OR like("material", 'brick%') OR like("material", '%brick')))
diff --git a/tests/expected/json/example17.json b/tests/expected/json/example17.json
new file mode 100644
index 0000000..22df770
--- /dev/null
+++ b/tests/expected/json/example17.json
@@ -0,0 +1,1 @@
+{"op":"or","args":[{"op":"and","args":[{"op":">","args":[{"property":"floors"},5.0]},{"op":"=","args":[{"property":"material"},"brick"]}]},{"op":"=","args":[{"property":"swimming_pool"},true]}]}
diff --git a/tests/expected/json/example17.txt b/tests/expected/json/example17.txt
new file mode 100644
index 0000000..7e613fc
--- /dev/null
+++ b/tests/expected/json/example17.txt
@@ -0,0 +1,1 @@
+((("floors" > 5) AND ("material" = 'brick')) OR ("swimming_pool" = true))
diff --git a/tests/expected/json/example18.json b/tests/expected/json/example18.json
new file mode 100644
index 0000000..79a847a
--- /dev/null
+++ b/tests/expected/json/example18.json
@@ -0,0 +1,1 @@
+{"op":"or","args":[{"op":"not","args":[{"op":"<","args":[{"property":"floors"},5.0]}]},{"op":"=","args":[{"property":"swimming_pool"},true]}]}
diff --git a/tests/expected/json/example18.txt b/tests/expected/json/example18.txt
new file mode 100644
index 0000000..fee5683
--- /dev/null
+++ b/tests/expected/json/example18.txt
@@ -0,0 +1,1 @@
+((NOT ("floors" < 5)) OR ("swimming_pool" = true))
diff --git a/tests/expected/json/example19.json b/tests/expected/json/example19.json
new file mode 100644
index 0000000..b619042
--- /dev/null
+++ b/tests/expected/json/example19.json
@@ -0,0 +1,1 @@
+{"op":"and","args":[{"op":"or","args":[{"op":"like","args":[{"property":"owner"},"mike%"]},{"op":"like","args":[{"property":"owner"},"Mike%"]}]},{"op":"<","args":[{"property":"floors"},4.0]}]}
diff --git a/tests/expected/json/example19.txt b/tests/expected/json/example19.txt
new file mode 100644
index 0000000..ef51aab
--- /dev/null
+++ b/tests/expected/json/example19.txt
@@ -0,0 +1,1 @@
+((like("owner", 'mike%') OR like("owner", 'Mike%')) AND ("floors" < 4))
diff --git a/tests/expected/json/example20.json b/tests/expected/json/example20.json
new file mode 100644
index 0000000..facdd89
--- /dev/null
+++ b/tests/expected/json/example20.json
@@ -0,0 +1,1 @@
+{"op":"t_before","args":[{"property":"built"},{"date":"2015-01-01"}]}
diff --git a/tests/expected/json/example20.txt b/tests/expected/json/example20.txt
new file mode 100644
index 0000000..dc901d8
--- /dev/null
+++ b/tests/expected/json/example20.txt
@@ -0,0 +1,1 @@
+t_before("built", DATE('2015-01-01'))
diff --git a/tests/expected/json/example21.json b/tests/expected/json/example21.json
new file mode 100644
index 0000000..34d7afe
--- /dev/null
+++ b/tests/expected/json/example21.json
@@ -0,0 +1,1 @@
+{"op":"t_after","args":[{"property":"built"},{"date":"2012-06-05"}]}
diff --git a/tests/expected/json/example21.txt b/tests/expected/json/example21.txt
new file mode 100644
index 0000000..d16a195
--- /dev/null
+++ b/tests/expected/json/example21.txt
@@ -0,0 +1,1 @@
+t_after("built", DATE('2012-06-05'))
diff --git a/tests/expected/json/example22.json b/tests/expected/json/example22.json
new file mode 100644
index 0000000..23d224e
--- /dev/null
+++ b/tests/expected/json/example22.json
@@ -0,0 +1,1 @@
+{"op":"t_during","args":[{"interval":[{"property":"starts_at"},{"property":"ends_at"}]},{"interval":["2017-06-10T07:30:00Z","2017-06-11T10:30:00Z"]}]}
diff --git a/tests/expected/json/example22.txt b/tests/expected/json/example22.txt
new file mode 100644
index 0000000..01aab7d
--- /dev/null
+++ b/tests/expected/json/example22.txt
@@ -0,0 +1,1 @@
+t_during(INTERVAL("starts_at","ends_at"), INTERVAL('2017-06-10T07:30:00Z','2017-06-11T10:30:00Z'))
diff --git a/tests/expected/json/example23.json b/tests/expected/json/example23.json
new file mode 100644
index 0000000..c49dfa4
--- /dev/null
+++ b/tests/expected/json/example23.json
@@ -0,0 +1,1 @@
+{"op":"s_within","args":[{"property":"location"},{"bbox":[-118.0,33.8,-117.9,34.0]}]}
diff --git a/tests/expected/json/example23.txt b/tests/expected/json/example23.txt
new file mode 100644
index 0000000..83c1598
--- /dev/null
+++ b/tests/expected/json/example23.txt
@@ -0,0 +1,1 @@
+s_within("location", BBOX(-118, 33.8, -117.9, 34))
diff --git a/tests/expected/json/example24.json b/tests/expected/json/example24.json
new file mode 100644
index 0000000..e0bdf87
--- /dev/null
+++ b/tests/expected/json/example24.json
@@ -0,0 +1,1 @@
+{"op":"s_intersects","args":[{"property":"geometry"},{"type":"Polygon","coordinates":[[[-10,-10],[10,-10],[10,10],[-10,-10]]]}]}
diff --git a/tests/expected/json/example24.txt b/tests/expected/json/example24.txt
new file mode 100644
index 0000000..c895573
--- /dev/null
+++ b/tests/expected/json/example24.txt
@@ -0,0 +1,1 @@
+s_intersects("geometry", POLYGON((-10 -10,10 -10,10 10,-10 -10)))
diff --git a/tests/expected/json/example25.json b/tests/expected/json/example25.json
new file mode 100644
index 0000000..5a597a6
--- /dev/null
+++ b/tests/expected/json/example25.json
@@ -0,0 +1,1 @@
+{"op":"and","args":[{"op":">","args":[{"property":"floors"},5.0]},{"op":"s_within","args":[{"property":"geometry"},{"bbox":[-118.0,33.8,-117.9,34.0]}]}]}
diff --git a/tests/expected/json/example25.txt b/tests/expected/json/example25.txt
new file mode 100644
index 0000000..28acd26
--- /dev/null
+++ b/tests/expected/json/example25.txt
@@ -0,0 +1,1 @@
+(("floors" > 5) AND s_within("geometry", BBOX(-118, 33.8, -117.9, 34)))
diff --git a/tests/expected/json/example26.json b/tests/expected/json/example26.json
new file mode 100644
index 0000000..918f401
--- /dev/null
+++ b/tests/expected/json/example26.json
@@ -0,0 +1,1 @@
+{"op":"in","args":[{"op":"casei","args":[{"property":"road_class"}]},[{"op":"casei","args":["Οδος"]},{"op":"casei","args":["Straße"]}]]}
diff --git a/tests/expected/json/example26.txt b/tests/expected/json/example26.txt
new file mode 100644
index 0000000..cf16575
--- /dev/null
+++ b/tests/expected/json/example26.txt
@@ -0,0 +1,1 @@
+in(casei("road_class"), (casei('Οδος'), casei('Straße')))
diff --git a/tests/expected/json/example27.json b/tests/expected/json/example27.json
new file mode 100644
index 0000000..5903327
--- /dev/null
+++ b/tests/expected/json/example27.json
@@ -0,0 +1,1 @@
+{"op":"=","args":[{"op":"accenti","args":[{"property":"etat_vol"}]},{"op":"accenti","args":["débárquér"]}]}
diff --git a/tests/expected/json/example27.txt b/tests/expected/json/example27.txt
new file mode 100644
index 0000000..2899d9e
--- /dev/null
+++ b/tests/expected/json/example27.txt
@@ -0,0 +1,1 @@
+(accenti("etat_vol") = accenti('débárquér'))
diff --git a/tests/expected/json/example28.json b/tests/expected/json/example28.json
new file mode 100644
index 0000000..cf06616
--- /dev/null
+++ b/tests/expected/json/example28.json
@@ -0,0 +1,1 @@
+{"op":"like","args":[{"op":"casei","args":[{"property":"geophys:SURVEY_NAME"}]},{"op":"casei","args":["%calcutta%"]}]}
diff --git a/tests/expected/json/example28.txt b/tests/expected/json/example28.txt
new file mode 100644
index 0000000..8e9d36a
--- /dev/null
+++ b/tests/expected/json/example28.txt
@@ -0,0 +1,1 @@
+like(casei("geophys:SURVEY_NAME"), casei('%calcutta%'))
diff --git a/tests/expected/json/example29.json b/tests/expected/json/example29.json
new file mode 100644
index 0000000..a6d759e
--- /dev/null
+++ b/tests/expected/json/example29.json
@@ -0,0 +1,1 @@
+{"op":"=","args":[{"property":"id"},"fa7e1920-9107-422d-a3db-c468cbc5d6df"]}
diff --git a/tests/expected/json/example29.txt b/tests/expected/json/example29.txt
new file mode 100644
index 0000000..80f33e9
--- /dev/null
+++ b/tests/expected/json/example29.txt
@@ -0,0 +1,1 @@
+("id" = 'fa7e1920-9107-422d-a3db-c468cbc5d6df')
diff --git a/tests/expected/json/example30.json b/tests/expected/json/example30.json
new file mode 100644
index 0000000..55c1252
--- /dev/null
+++ b/tests/expected/json/example30.json
@@ -0,0 +1,1 @@
+{"op":"<>","args":[{"property":"id"},"fa7e1920-9107-422d-a3db-c468cbc5d6df"]}
diff --git a/tests/expected/json/example30.txt b/tests/expected/json/example30.txt
new file mode 100644
index 0000000..0578a6f
--- /dev/null
+++ b/tests/expected/json/example30.txt
@@ -0,0 +1,1 @@
+("id" <> 'fa7e1920-9107-422d-a3db-c468cbc5d6df')
diff --git a/tests/expected/json/example31.json b/tests/expected/json/example31.json
new file mode 100644
index 0000000..c0ace76
--- /dev/null
+++ b/tests/expected/json/example31.json
@@ -0,0 +1,1 @@
+{"op":"<","args":[{"property":"value"},10.0]}
diff --git a/tests/expected/json/example31.txt b/tests/expected/json/example31.txt
new file mode 100644
index 0000000..d65390e
--- /dev/null
+++ b/tests/expected/json/example31.txt
@@ -0,0 +1,1 @@
+("value" < 10)
diff --git a/tests/expected/json/example32.json b/tests/expected/json/example32.json
new file mode 100644
index 0000000..7246dea
--- /dev/null
+++ b/tests/expected/json/example32.json
@@ -0,0 +1,1 @@
+{"op":">","args":[{"property":"value"},10.0]}
diff --git a/tests/expected/json/example32.txt b/tests/expected/json/example32.txt
new file mode 100644
index 0000000..a89adf5
--- /dev/null
+++ b/tests/expected/json/example32.txt
@@ -0,0 +1,1 @@
+("value" > 10)
diff --git a/tests/expected/json/example33.json b/tests/expected/json/example33.json
new file mode 100644
index 0000000..cce72a7
--- /dev/null
+++ b/tests/expected/json/example33.json
@@ -0,0 +1,1 @@
+{"op":"<=","args":[{"property":"value"},10.0]}
diff --git a/tests/expected/json/example33.txt b/tests/expected/json/example33.txt
new file mode 100644
index 0000000..43f85fc
--- /dev/null
+++ b/tests/expected/json/example33.txt
@@ -0,0 +1,1 @@
+("value" <= 10)
diff --git a/tests/expected/json/example34.json b/tests/expected/json/example34.json
new file mode 100644
index 0000000..0039003
--- /dev/null
+++ b/tests/expected/json/example34.json
@@ -0,0 +1,1 @@
+{"op":">=","args":[{"property":"value"},10.0]}
diff --git a/tests/expected/json/example34.txt b/tests/expected/json/example34.txt
new file mode 100644
index 0000000..c822d1b
--- /dev/null
+++ b/tests/expected/json/example34.txt
@@ -0,0 +1,1 @@
+("value" >= 10)
diff --git a/tests/expected/json/example35.json b/tests/expected/json/example35.json
new file mode 100644
index 0000000..3f84e73
--- /dev/null
+++ b/tests/expected/json/example35.json
@@ -0,0 +1,1 @@
+{"op":"like","args":[{"property":"name"},"foo%"]}
diff --git a/tests/expected/json/example35.txt b/tests/expected/json/example35.txt
new file mode 100644
index 0000000..ace7a16
--- /dev/null
+++ b/tests/expected/json/example35.txt
@@ -0,0 +1,1 @@
+like("name", 'foo%')
diff --git a/tests/expected/json/example36-alt01.json b/tests/expected/json/example36-alt01.json
new file mode 100644
index 0000000..d2fa835
--- /dev/null
+++ b/tests/expected/json/example36-alt01.json
@@ -0,0 +1,1 @@
+{"op":"not","args":[{"op":"like","args":[{"property":"name"},"foo%"]}]}
diff --git a/tests/expected/json/example36.json b/tests/expected/json/example36.json
new file mode 100644
index 0000000..d2fa835
--- /dev/null
+++ b/tests/expected/json/example36.json
@@ -0,0 +1,1 @@
+{"op":"not","args":[{"op":"like","args":[{"property":"name"},"foo%"]}]}
diff --git a/tests/expected/json/example36.txt b/tests/expected/json/example36.txt
new file mode 100644
index 0000000..2dc6954
--- /dev/null
+++ b/tests/expected/json/example36.txt
@@ -0,0 +1,1 @@
+(NOT like("name", 'foo%'))
diff --git a/tests/expected/json/example37.json b/tests/expected/json/example37.json
new file mode 100644
index 0000000..2f6a943
--- /dev/null
+++ b/tests/expected/json/example37.json
@@ -0,0 +1,1 @@
+{"op":"between","args":[{"property":"value"},10.0,20.0]}
diff --git a/tests/expected/json/example37.txt b/tests/expected/json/example37.txt
new file mode 100644
index 0000000..3c7e2d9
--- /dev/null
+++ b/tests/expected/json/example37.txt
@@ -0,0 +1,1 @@
+("value" BETWEEN 10 AND 20)
diff --git a/tests/expected/json/example38-alt01.json b/tests/expected/json/example38-alt01.json
new file mode 100644
index 0000000..c7399bf
--- /dev/null
+++ b/tests/expected/json/example38-alt01.json
@@ -0,0 +1,1 @@
+{"op":"not","args":[{"op":"between","args":[{"property":"value"},10.0,20.0]}]}
diff --git a/tests/expected/json/example38.json b/tests/expected/json/example38.json
new file mode 100644
index 0000000..c7399bf
--- /dev/null
+++ b/tests/expected/json/example38.json
@@ -0,0 +1,1 @@
+{"op":"not","args":[{"op":"between","args":[{"property":"value"},10.0,20.0]}]}
diff --git a/tests/expected/json/example38.txt b/tests/expected/json/example38.txt
new file mode 100644
index 0000000..ea5ce7d
--- /dev/null
+++ b/tests/expected/json/example38.txt
@@ -0,0 +1,1 @@
+(NOT ("value" BETWEEN 10 AND 20))
diff --git a/tests/expected/json/example39.json b/tests/expected/json/example39.json
new file mode 100644
index 0000000..2ae873d
--- /dev/null
+++ b/tests/expected/json/example39.json
@@ -0,0 +1,1 @@
+{"op":"in","args":[{"property":"value"},[1.0,2.0,3.0]]}
diff --git a/tests/expected/json/example39.txt b/tests/expected/json/example39.txt
new file mode 100644
index 0000000..a5e9ecd
--- /dev/null
+++ b/tests/expected/json/example39.txt
@@ -0,0 +1,1 @@
+in("value", (1, 2, 3))
diff --git a/tests/expected/json/example40-alt01.json b/tests/expected/json/example40-alt01.json
new file mode 100644
index 0000000..6332a99
--- /dev/null
+++ b/tests/expected/json/example40-alt01.json
@@ -0,0 +1,1 @@
+{"op":"not","args":[{"op":"in","args":[{"property":"value"},["a","b","c"]]}]}
diff --git a/tests/expected/json/example40.json b/tests/expected/json/example40.json
new file mode 100644
index 0000000..6332a99
--- /dev/null
+++ b/tests/expected/json/example40.json
@@ -0,0 +1,1 @@
+{"op":"not","args":[{"op":"in","args":[{"property":"value"},["a","b","c"]]}]}
diff --git a/tests/expected/json/example40.txt b/tests/expected/json/example40.txt
new file mode 100644
index 0000000..9f12f73
--- /dev/null
+++ b/tests/expected/json/example40.txt
@@ -0,0 +1,1 @@
+(NOT in("value", ('a', 'b', 'c')))
diff --git a/tests/expected/json/example41.json b/tests/expected/json/example41.json
new file mode 100644
index 0000000..565934d
--- /dev/null
+++ b/tests/expected/json/example41.json
@@ -0,0 +1,1 @@
+{"op":"isNull","args":[{"property":"value"}]}
diff --git a/tests/expected/json/example41.txt b/tests/expected/json/example41.txt
new file mode 100644
index 0000000..31a61df
--- /dev/null
+++ b/tests/expected/json/example41.txt
@@ -0,0 +1,1 @@
+isNull("value")
diff --git a/tests/expected/json/example42-alt01.json b/tests/expected/json/example42-alt01.json
new file mode 100644
index 0000000..565934d
--- /dev/null
+++ b/tests/expected/json/example42-alt01.json
@@ -0,0 +1,1 @@
+{"op":"isNull","args":[{"property":"value"}]}
diff --git a/tests/expected/json/example42.json b/tests/expected/json/example42.json
new file mode 100644
index 0000000..aeb39ba
--- /dev/null
+++ b/tests/expected/json/example42.json
@@ -0,0 +1,1 @@
+{"op":"not","args":[{"op":"isNull","args":[{"property":"value"}]}]}
diff --git a/tests/expected/json/example42.txt b/tests/expected/json/example42.txt
new file mode 100644
index 0000000..a8e0524
--- /dev/null
+++ b/tests/expected/json/example42.txt
@@ -0,0 +1,1 @@
+(NOT isNull("value"))
diff --git a/tests/expected/json/example43-alt01.json b/tests/expected/json/example43-alt01.json
new file mode 100644
index 0000000..8fcc319
--- /dev/null
+++ b/tests/expected/json/example43-alt01.json
@@ -0,0 +1,1 @@
+{"op":"and","args":[{"op":"not","args":[{"op":"like","args":[{"property":"name"},"foo%"]}]},{"op":">","args":[{"property":"value"},10.0]}]}
diff --git a/tests/expected/json/example43.json b/tests/expected/json/example43.json
new file mode 100644
index 0000000..8fcc319
--- /dev/null
+++ b/tests/expected/json/example43.json
@@ -0,0 +1,1 @@
+{"op":"and","args":[{"op":"not","args":[{"op":"like","args":[{"property":"name"},"foo%"]}]},{"op":">","args":[{"property":"value"},10.0]}]}
diff --git a/tests/expected/json/example43.txt b/tests/expected/json/example43.txt
new file mode 100644
index 0000000..2ca4815
--- /dev/null
+++ b/tests/expected/json/example43.txt
@@ -0,0 +1,1 @@
+((NOT like("name", 'foo%')) AND ("value" > 10))
diff --git a/tests/expected/json/example44-alt01.json b/tests/expected/json/example44-alt01.json
new file mode 100644
index 0000000..37bc6b3
--- /dev/null
+++ b/tests/expected/json/example44-alt01.json
@@ -0,0 +1,1 @@
+{"op":"or","args":[{"op":"isNull","args":[{"property":"value"}]},{"op":"between","args":[{"property":"value"},10.0,20.0]}]}
diff --git a/tests/expected/json/example44.json b/tests/expected/json/example44.json
new file mode 100644
index 0000000..37bc6b3
--- /dev/null
+++ b/tests/expected/json/example44.json
@@ -0,0 +1,1 @@
+{"op":"or","args":[{"op":"isNull","args":[{"property":"value"}]},{"op":"between","args":[{"property":"value"},10.0,20.0]}]}
diff --git a/tests/expected/json/example44.txt b/tests/expected/json/example44.txt
new file mode 100644
index 0000000..e6a1ef6
--- /dev/null
+++ b/tests/expected/json/example44.txt
@@ -0,0 +1,1 @@
+(isNull("value") OR ("value" BETWEEN 10 AND 20))
diff --git a/tests/expected/json/example45.json b/tests/expected/json/example45.json
new file mode 100644
index 0000000..aef9d64
--- /dev/null
+++ b/tests/expected/json/example45.json
@@ -0,0 +1,1 @@
+{"op":"s_intersects","args":[{"property":"geometry"},{"bbox":[-128.098193,-1.1,-99999.0,180.0,90.0,100000.0]}]}
diff --git a/tests/expected/json/example45.txt b/tests/expected/json/example45.txt
new file mode 100644
index 0000000..759d6e8
--- /dev/null
+++ b/tests/expected/json/example45.txt
@@ -0,0 +1,1 @@
+s_intersects("geometry", BBOX(-128.098193, -1.1, -99999, 180, 90, 100000))
diff --git a/tests/expected/json/example46-alt01.json b/tests/expected/json/example46-alt01.json
new file mode 100644
index 0000000..f887385
--- /dev/null
+++ b/tests/expected/json/example46-alt01.json
@@ -0,0 +1,1 @@
+{"op":"s_equals","args":[{"type":"Polygon","coordinates":[[[-0.333333,89],[-102.723546,-0.5],[-179,-89],[-1.9,89],[-0.0,89],[2.00001,-1.9],[-0.333333,89]]]},{"property":"geometry"}]}
diff --git a/tests/expected/json/example46.json b/tests/expected/json/example46.json
new file mode 100644
index 0000000..3e4574b
--- /dev/null
+++ b/tests/expected/json/example46.json
@@ -0,0 +1,1 @@
+{"op":"s_equals","args":[{"type":"Polygon","coordinates":[[[-0.333333,89.0],[-102.723546,-0.5],[-179.0,-89.0],[-1.9,89.0],[-0.0,89.0],[2.00001,-1.9],[-0.333333,89.0]]]},{"property":"geometry"}]}
diff --git a/tests/expected/json/example46.txt b/tests/expected/json/example46.txt
new file mode 100644
index 0000000..bb9567f
--- /dev/null
+++ b/tests/expected/json/example46.txt
@@ -0,0 +1,1 @@
+s_equals(POLYGON((-0.333333 89,-102.723546 -0.5,-179 -89,-1.9 89,-0 89,2.00001 -1.9,-0.333333 89)), "geometry")
diff --git a/tests/expected/json/example47.json b/tests/expected/json/example47.json
new file mode 100644
index 0000000..f8ab5ae
--- /dev/null
+++ b/tests/expected/json/example47.json
@@ -0,0 +1,1 @@
+{"op":"s_disjoint","args":[{"property":"geometry"},{"type":"MultiPolygon","coordinates":[[[[144.022387,45.176126],[-1.1,0.0],[180.0,47.808086],[144.022387,45.176126]]]]}]}
diff --git a/tests/expected/json/example47.txt b/tests/expected/json/example47.txt
new file mode 100644
index 0000000..0f33e66
--- /dev/null
+++ b/tests/expected/json/example47.txt
@@ -0,0 +1,1 @@
+s_disjoint("geometry", MULTIPOLYGON(((144.022387 45.176126,-1.1 0,180 47.808086,144.022387 45.176126))))
diff --git a/tests/expected/json/example48.json b/tests/expected/json/example48.json
new file mode 100644
index 0000000..acaa6d0
--- /dev/null
+++ b/tests/expected/json/example48.json
@@ -0,0 +1,1 @@
+{"op":"s_touches","args":[{"property":"geometry"},{"type":"MultiLineString","coordinates":[[[-1.9,-0.99999],[75.292574,1.5],[-0.5,-4.016458],[-31.708594,-74.743801],[179.0,-90.0]],[[-1.9,-1.1],[1.5,8.547371]]]}]}
diff --git a/tests/expected/json/example48.txt b/tests/expected/json/example48.txt
new file mode 100644
index 0000000..70b9299
--- /dev/null
+++ b/tests/expected/json/example48.txt
@@ -0,0 +1,1 @@
+s_touches("geometry", MULTILINESTRING((-1.9 -0.99999,75.292574 1.5,-0.5 -4.016458,-31.708594 -74.743801,179 -90),(-1.9 -1.1,1.5 8.547371)))
diff --git a/tests/expected/json/example49-alt01.json b/tests/expected/json/example49-alt01.json
new file mode 100644
index 0000000..347a400
--- /dev/null
+++ b/tests/expected/json/example49-alt01.json
@@ -0,0 +1,1 @@
+{"op":"s_within","args":[{"type":"Polygon","coordinates":[[[-49.88024,0.5],[-1.5,-0.99999],[0,0.5],[-49.88024,0.5]],[[-65.887123,2.00001],[0.333333,-53.017711],[180,0],[-65.887123,2.00001]]]},{"property":"geometry"}]}
diff --git a/tests/expected/json/example49.json b/tests/expected/json/example49.json
new file mode 100644
index 0000000..3c32691
--- /dev/null
+++ b/tests/expected/json/example49.json
@@ -0,0 +1,1 @@
+{"op":"s_within","args":[{"type":"Polygon","coordinates":[[[-49.88024,0.5,-75993.341684],[-1.5,-0.99999,-100000.0],[0.0,0.5,-0.333333],[-49.88024,0.5,-75993.341684]],[[-65.887123,2.00001,-100000.0],[0.333333,-53.017711,-79471.332949],[180.0,0.0,1852.616704],[-65.887123,2.00001,-100000.0]]]},{"property":"geometry"}]}
diff --git a/tests/expected/json/example49.txt b/tests/expected/json/example49.txt
new file mode 100644
index 0000000..566c287
--- /dev/null
+++ b/tests/expected/json/example49.txt
@@ -0,0 +1,1 @@
+s_within(POLYGON((-49.88024 0.5,-1.5 -0.99999,0 0.5,-49.88024 0.5),(-65.887123 2.00001,0.333333 -53.017711,180 0,-65.887123 2.00001)), "geometry")
diff --git a/tests/expected/json/example50.json b/tests/expected/json/example50.json
new file mode 100644
index 0000000..c7f5021
--- /dev/null
+++ b/tests/expected/json/example50.json
@@ -0,0 +1,1 @@
+{"op":"s_overlaps","args":[{"property":"geometry"},{"bbox":[-179.912109,1.9,180.0,16.897016]}]}
diff --git a/tests/expected/json/example50.txt b/tests/expected/json/example50.txt
new file mode 100644
index 0000000..f23035b
--- /dev/null
+++ b/tests/expected/json/example50.txt
@@ -0,0 +1,1 @@
+s_overlaps("geometry", BBOX(-179.912109, 1.9, 180, 16.897016))
diff --git a/tests/expected/json/example51.json b/tests/expected/json/example51.json
new file mode 100644
index 0000000..a1b90f1
--- /dev/null
+++ b/tests/expected/json/example51.json
@@ -0,0 +1,1 @@
+{"op":"s_crosses","args":[{"property":"geometry"},{"type":"LineString","coordinates":[[172.03086,1.5],[1.1,-90.0],[-159.757695,0.99999],[-180.0,0.5],[-12.111235,81.336403],[-0.5,64.43958],[0.0,81.991815],[-155.93831,90.0]]}]}
diff --git a/tests/expected/json/example51.txt b/tests/expected/json/example51.txt
new file mode 100644
index 0000000..43f9619
--- /dev/null
+++ b/tests/expected/json/example51.txt
@@ -0,0 +1,1 @@
+s_crosses("geometry", LINESTRING(172.03086 1.5,1.1 -90,-159.757695 0.99999,-180 0.5,-12.111235 81.336403,-0.5 64.43958,0 81.991815,-155.93831 90))
diff --git a/tests/expected/json/example52.json b/tests/expected/json/example52.json
new file mode 100644
index 0000000..45e115d
--- /dev/null
+++ b/tests/expected/json/example52.json
@@ -0,0 +1,1 @@
+{"op":"s_contains","args":[{"property":"geometry"},{"type":"Point","coordinates":[-3.508362,-1.754181]}]}
diff --git a/tests/expected/json/example52.txt b/tests/expected/json/example52.txt
new file mode 100644
index 0000000..d970c3f
--- /dev/null
+++ b/tests/expected/json/example52.txt
@@ -0,0 +1,1 @@
+s_contains("geometry", POINT(-3.508362 -1.754181))
diff --git a/tests/expected/json/example53.json b/tests/expected/json/example53.json
new file mode 100644
index 0000000..d80d04b
--- /dev/null
+++ b/tests/expected/json/example53.json
@@ -0,0 +1,1 @@
+{"op":"t_after","args":[{"property":"updated_at"},{"date":"2010-02-10"}]}
diff --git a/tests/expected/json/example53.txt b/tests/expected/json/example53.txt
new file mode 100644
index 0000000..d6a5f63
--- /dev/null
+++ b/tests/expected/json/example53.txt
@@ -0,0 +1,1 @@
+t_after("updated_at", DATE('2010-02-10'))
diff --git a/tests/expected/json/example54-alt01.json b/tests/expected/json/example54-alt01.json
new file mode 100644
index 0000000..236abaf
--- /dev/null
+++ b/tests/expected/json/example54-alt01.json
@@ -0,0 +1,1 @@
+{"op":"t_before","args":[{"property":"updated_at"},{"timestamp":"2012-08-10T05:30:00Z"}]}
diff --git a/tests/expected/json/example54.json b/tests/expected/json/example54.json
new file mode 100644
index 0000000..236abaf
--- /dev/null
+++ b/tests/expected/json/example54.json
@@ -0,0 +1,1 @@
+{"op":"t_before","args":[{"property":"updated_at"},{"timestamp":"2012-08-10T05:30:00Z"}]}
diff --git a/tests/expected/json/example54.txt b/tests/expected/json/example54.txt
new file mode 100644
index 0000000..68b5d2f
--- /dev/null
+++ b/tests/expected/json/example54.txt
@@ -0,0 +1,1 @@
+t_before("updated_at", TIMESTAMP('2012-08-10T05:30:00Z'))
diff --git a/tests/expected/json/example55-alt01.json b/tests/expected/json/example55-alt01.json
new file mode 100644
index 0000000..66c10b7
--- /dev/null
+++ b/tests/expected/json/example55-alt01.json
@@ -0,0 +1,1 @@
+{"op":"t_contains","args":[{"interval":["2000-01-01T00:00:00Z","2005-01-10T01:01:01.393216Z"]},{"interval":[{"property":"starts_at"},{"property":"ends_at"}]}]}
diff --git a/tests/expected/json/example55.json b/tests/expected/json/example55.json
new file mode 100644
index 0000000..66c10b7
--- /dev/null
+++ b/tests/expected/json/example55.json
@@ -0,0 +1,1 @@
+{"op":"t_contains","args":[{"interval":["2000-01-01T00:00:00Z","2005-01-10T01:01:01.393216Z"]},{"interval":[{"property":"starts_at"},{"property":"ends_at"}]}]}
diff --git a/tests/expected/json/example55.txt b/tests/expected/json/example55.txt
new file mode 100644
index 0000000..0d38bb8
--- /dev/null
+++ b/tests/expected/json/example55.txt
@@ -0,0 +1,1 @@
+t_contains(INTERVAL('2000-01-01T00:00:00Z','2005-01-10T01:01:01.393216Z'), INTERVAL("starts_at","ends_at"))
diff --git a/tests/expected/json/example56.json b/tests/expected/json/example56.json
new file mode 100644
index 0000000..faf8fe7
--- /dev/null
+++ b/tests/expected/json/example56.json
@@ -0,0 +1,1 @@
+{"op":"t_disjoint","args":[{"interval":["..","2005-01-10T01:01:01.393216Z"]},{"interval":[{"property":"starts_at"},{"property":"ends_at"}]}]}
diff --git a/tests/expected/json/example56.txt b/tests/expected/json/example56.txt
new file mode 100644
index 0000000..3e8e4f4
--- /dev/null
+++ b/tests/expected/json/example56.txt
@@ -0,0 +1,1 @@
+t_disjoint(INTERVAL('..','2005-01-10T01:01:01.393216Z'), INTERVAL("starts_at","ends_at"))
diff --git a/tests/expected/json/example57.json b/tests/expected/json/example57.json
new file mode 100644
index 0000000..4d96d5a
--- /dev/null
+++ b/tests/expected/json/example57.json
@@ -0,0 +1,1 @@
+{"op":"t_during","args":[{"interval":[{"property":"starts_at"},{"property":"ends_at"}]},{"interval":["2005-01-10","2010-02-10"]}]}
diff --git a/tests/expected/json/example57.txt b/tests/expected/json/example57.txt
new file mode 100644
index 0000000..3ece6c7
--- /dev/null
+++ b/tests/expected/json/example57.txt
@@ -0,0 +1,1 @@
+t_during(INTERVAL("starts_at","ends_at"), INTERVAL('2005-01-10','2010-02-10'))
diff --git a/tests/expected/json/example58.json b/tests/expected/json/example58.json
new file mode 100644
index 0000000..5c28290
--- /dev/null
+++ b/tests/expected/json/example58.json
@@ -0,0 +1,1 @@
+{"op":"t_equals","args":[{"property":"updated_at"},{"date":"1851-04-29"}]}
diff --git a/tests/expected/json/example58.txt b/tests/expected/json/example58.txt
new file mode 100644
index 0000000..eca6a7f
--- /dev/null
+++ b/tests/expected/json/example58.txt
@@ -0,0 +1,1 @@
+t_equals("updated_at", DATE('1851-04-29'))
diff --git a/tests/expected/json/example59.json b/tests/expected/json/example59.json
new file mode 100644
index 0000000..c38432f
--- /dev/null
+++ b/tests/expected/json/example59.json
@@ -0,0 +1,1 @@
+{"op":"t_finishedBy","args":[{"interval":[{"property":"starts_at"},{"property":"ends_at"}]},{"interval":["1991-10-07T08:21:06.393262Z","2010-02-10T05:29:20.073225Z"]}]}
diff --git a/tests/expected/json/example59.txt b/tests/expected/json/example59.txt
new file mode 100644
index 0000000..a605c7d
--- /dev/null
+++ b/tests/expected/json/example59.txt
@@ -0,0 +1,1 @@
+t_finishedBy(INTERVAL("starts_at","ends_at"), INTERVAL('1991-10-07T08:21:06.393262Z','2010-02-10T05:29:20.073225Z'))
diff --git a/tests/expected/json/example60.json b/tests/expected/json/example60.json
new file mode 100644
index 0000000..b4baaad
--- /dev/null
+++ b/tests/expected/json/example60.json
@@ -0,0 +1,1 @@
+{"op":"t_finishes","args":[{"interval":[{"property":"starts_at"},{"property":"ends_at"}]},{"interval":["1991-10-07","2010-02-10T05:29:20.073225Z"]}]}
diff --git a/tests/expected/json/example60.txt b/tests/expected/json/example60.txt
new file mode 100644
index 0000000..1623e78
--- /dev/null
+++ b/tests/expected/json/example60.txt
@@ -0,0 +1,1 @@
+t_finishes(INTERVAL("starts_at","ends_at"), INTERVAL('1991-10-07','2010-02-10T05:29:20.073225Z'))
diff --git a/tests/expected/json/example61.json b/tests/expected/json/example61.json
new file mode 100644
index 0000000..0bc2a8f
--- /dev/null
+++ b/tests/expected/json/example61.json
@@ -0,0 +1,1 @@
+{"op":"t_intersects","args":[{"interval":[{"property":"starts_at"},{"property":"ends_at"}]},{"interval":["1991-10-07T08:21:06.393262Z","2010-02-10T05:29:20.073225Z"]}]}
diff --git a/tests/expected/json/example61.txt b/tests/expected/json/example61.txt
new file mode 100644
index 0000000..3991a60
--- /dev/null
+++ b/tests/expected/json/example61.txt
@@ -0,0 +1,1 @@
+t_intersects(INTERVAL("starts_at","ends_at"), INTERVAL('1991-10-07T08:21:06.393262Z','2010-02-10T05:29:20.073225Z'))
diff --git a/tests/expected/json/example62.json b/tests/expected/json/example62.json
new file mode 100644
index 0000000..b97c114
--- /dev/null
+++ b/tests/expected/json/example62.json
@@ -0,0 +1,1 @@
+{"op":"t_meets","args":[{"interval":["2005-01-10","2010-02-10"]},{"interval":[{"property":"starts_at"},{"property":"ends_at"}]}]}
diff --git a/tests/expected/json/example62.txt b/tests/expected/json/example62.txt
new file mode 100644
index 0000000..09c0680
--- /dev/null
+++ b/tests/expected/json/example62.txt
@@ -0,0 +1,1 @@
+t_meets(INTERVAL('2005-01-10','2010-02-10'), INTERVAL("starts_at","ends_at"))
diff --git a/tests/expected/json/example63.json b/tests/expected/json/example63.json
new file mode 100644
index 0000000..8e3aa82
--- /dev/null
+++ b/tests/expected/json/example63.json
@@ -0,0 +1,1 @@
+{"op":"t_metBy","args":[{"interval":["2010-02-10T05:29:20.073225Z","2010-10-07"]},{"interval":[{"property":"starts_at"},{"property":"ends_at"}]}]}
diff --git a/tests/expected/json/example63.txt b/tests/expected/json/example63.txt
new file mode 100644
index 0000000..25166d3
--- /dev/null
+++ b/tests/expected/json/example63.txt
@@ -0,0 +1,1 @@
+t_metBy(INTERVAL('2010-02-10T05:29:20.073225Z','2010-10-07'), INTERVAL("starts_at","ends_at"))
diff --git a/tests/expected/json/example64.json b/tests/expected/json/example64.json
new file mode 100644
index 0000000..ec45400
--- /dev/null
+++ b/tests/expected/json/example64.json
@@ -0,0 +1,1 @@
+{"op":"t_overlappedBy","args":[{"interval":["1991-10-07T08:21:06.393262Z","2010-02-10T05:29:20.073225Z"]},{"interval":[{"property":"starts_at"},{"property":"ends_at"}]}]}
diff --git a/tests/expected/json/example64.txt b/tests/expected/json/example64.txt
new file mode 100644
index 0000000..7552b48
--- /dev/null
+++ b/tests/expected/json/example64.txt
@@ -0,0 +1,1 @@
+t_overlappedBy(INTERVAL('1991-10-07T08:21:06.393262Z','2010-02-10T05:29:20.073225Z'), INTERVAL("starts_at","ends_at"))
diff --git a/tests/expected/json/example65.json b/tests/expected/json/example65.json
new file mode 100644
index 0000000..4d90a9b
--- /dev/null
+++ b/tests/expected/json/example65.json
@@ -0,0 +1,1 @@
+{"op":"t_overlaps","args":[{"interval":[{"property":"starts_at"},{"property":"ends_at"}]},{"interval":["1991-10-07T08:21:06.393262Z","1992-10-09T08:08:08.393473Z"]}]}
diff --git a/tests/expected/json/example65.txt b/tests/expected/json/example65.txt
new file mode 100644
index 0000000..9555c86
--- /dev/null
+++ b/tests/expected/json/example65.txt
@@ -0,0 +1,1 @@
+t_overlaps(INTERVAL("starts_at","ends_at"), INTERVAL('1991-10-07T08:21:06.393262Z','1992-10-09T08:08:08.393473Z'))
diff --git a/tests/expected/json/example66.json b/tests/expected/json/example66.json
new file mode 100644
index 0000000..c915800
--- /dev/null
+++ b/tests/expected/json/example66.json
@@ -0,0 +1,1 @@
+{"op":"t_startedBy","args":[{"interval":["1991-10-07T08:21:06.393262Z","2010-02-10T05:29:20.073225Z"]},{"interval":[{"property":"starts_at"},{"property":"ends_at"}]}]}
diff --git a/tests/expected/json/example66.txt b/tests/expected/json/example66.txt
new file mode 100644
index 0000000..b02ad02
--- /dev/null
+++ b/tests/expected/json/example66.txt
@@ -0,0 +1,1 @@
+t_startedBy(INTERVAL('1991-10-07T08:21:06.393262Z','2010-02-10T05:29:20.073225Z'), INTERVAL("starts_at","ends_at"))
diff --git a/tests/expected/json/example67.json b/tests/expected/json/example67.json
new file mode 100644
index 0000000..7087df4
--- /dev/null
+++ b/tests/expected/json/example67.json
@@ -0,0 +1,1 @@
+{"op":"t_starts","args":[{"interval":[{"property":"starts_at"},{"property":"ends_at"}]},{"interval":["1991-10-07T08:21:06.393262Z",".."]}]}
diff --git a/tests/expected/json/example67.txt b/tests/expected/json/example67.txt
new file mode 100644
index 0000000..d1686e8
--- /dev/null
+++ b/tests/expected/json/example67.txt
@@ -0,0 +1,1 @@
+t_starts(INTERVAL("starts_at","ends_at"), INTERVAL('1991-10-07T08:21:06.393262Z','..'))
diff --git a/tests/expected/json/example68.json b/tests/expected/json/example68.json
new file mode 100644
index 0000000..2f66a6a
--- /dev/null
+++ b/tests/expected/json/example68.json
@@ -0,0 +1,1 @@
+{"op":"=","args":[{"op":"Foo","args":[{"property":"geometry"}]},true]}
diff --git a/tests/expected/json/example68.txt b/tests/expected/json/example68.txt
new file mode 100644
index 0000000..5fa4c46
--- /dev/null
+++ b/tests/expected/json/example68.txt
@@ -0,0 +1,1 @@
+(Foo("geometry") = true)
diff --git a/tests/expected/json/example69.json b/tests/expected/json/example69.json
new file mode 100644
index 0000000..0e6c6ac
--- /dev/null
+++ b/tests/expected/json/example69.json
@@ -0,0 +1,1 @@
+{"op":"<>","args":[false,{"op":"Bar","args":[{"property":"geometry"},100.0,"a","b",false]}]}
diff --git a/tests/expected/json/example69.txt b/tests/expected/json/example69.txt
new file mode 100644
index 0000000..90e5559
--- /dev/null
+++ b/tests/expected/json/example69.txt
@@ -0,0 +1,1 @@
+(false <> Bar("geometry", 100, 'a', 'b', false))
diff --git a/tests/expected/json/example70.json b/tests/expected/json/example70.json
new file mode 100644
index 0000000..4a98289
--- /dev/null
+++ b/tests/expected/json/example70.json
@@ -0,0 +1,1 @@
+{"op":"=","args":[{"op":"accenti","args":[{"property":"owner"}]},{"op":"accenti","args":["Beyoncé"]}]}
diff --git a/tests/expected/json/example70.txt b/tests/expected/json/example70.txt
new file mode 100644
index 0000000..814053a
--- /dev/null
+++ b/tests/expected/json/example70.txt
@@ -0,0 +1,1 @@
+(accenti("owner") = accenti('Beyoncé'))
diff --git a/tests/expected/json/example71.json b/tests/expected/json/example71.json
new file mode 100644
index 0000000..9dc0968
--- /dev/null
+++ b/tests/expected/json/example71.json
@@ -0,0 +1,1 @@
+{"op":"=","args":[{"op":"casei","args":[{"property":"owner"}]},{"op":"casei","args":["somebody else"]}]}
diff --git a/tests/expected/json/example71.txt b/tests/expected/json/example71.txt
new file mode 100644
index 0000000..86fa908
--- /dev/null
+++ b/tests/expected/json/example71.txt
@@ -0,0 +1,1 @@
+(casei("owner") = casei('somebody else'))
diff --git a/tests/expected/json/example72.json b/tests/expected/json/example72.json
new file mode 100644
index 0000000..a881422
--- /dev/null
+++ b/tests/expected/json/example72.json
@@ -0,0 +1,1 @@
+{"op":">","args":[{"property":"value"},{"op":"+","args":[{"property":"foo"},10.0]}]}
diff --git a/tests/expected/json/example72.txt b/tests/expected/json/example72.txt
new file mode 100644
index 0000000..645c50e
--- /dev/null
+++ b/tests/expected/json/example72.txt
@@ -0,0 +1,1 @@
+("value" > ("foo" + 10))
diff --git a/tests/expected/json/example73.json b/tests/expected/json/example73.json
new file mode 100644
index 0000000..adc0291
--- /dev/null
+++ b/tests/expected/json/example73.json
@@ -0,0 +1,1 @@
+{"op":"<","args":[{"property":"value"},{"op":"-","args":[{"property":"foo"},10.0]}]}
diff --git a/tests/expected/json/example73.txt b/tests/expected/json/example73.txt
new file mode 100644
index 0000000..5ebc664
--- /dev/null
+++ b/tests/expected/json/example73.txt
@@ -0,0 +1,1 @@
+("value" < ("foo" - 10))
diff --git a/tests/expected/json/example74.json b/tests/expected/json/example74.json
new file mode 100644
index 0000000..e6d0daf
--- /dev/null
+++ b/tests/expected/json/example74.json
@@ -0,0 +1,1 @@
+{"op":"<>","args":[{"property":"value"},{"op":"*","args":[22.1,{"property":"foo"}]}]}
diff --git a/tests/expected/json/example74.txt b/tests/expected/json/example74.txt
new file mode 100644
index 0000000..a13f3c6
--- /dev/null
+++ b/tests/expected/json/example74.txt
@@ -0,0 +1,1 @@
+("value" <> (22.1 * "foo"))
diff --git a/tests/expected/json/example75.json b/tests/expected/json/example75.json
new file mode 100644
index 0000000..b0ccbc8
--- /dev/null
+++ b/tests/expected/json/example75.json
@@ -0,0 +1,1 @@
+{"op":"=","args":[{"property":"value"},{"op":"/","args":[2.0,{"property":"foo"}]}]}
diff --git a/tests/expected/json/example75.txt b/tests/expected/json/example75.txt
new file mode 100644
index 0000000..63b6f5c
--- /dev/null
+++ b/tests/expected/json/example75.txt
@@ -0,0 +1,1 @@
+("value" = (2 / "foo"))
diff --git a/tests/expected/json/example76.json b/tests/expected/json/example76.json
new file mode 100644
index 0000000..4f93e58
--- /dev/null
+++ b/tests/expected/json/example76.json
@@ -0,0 +1,1 @@
+{"op":"<=","args":[{"property":"value"},{"op":"^","args":[2.0,{"property":"foo"}]}]}
diff --git a/tests/expected/json/example76.txt b/tests/expected/json/example76.txt
new file mode 100644
index 0000000..7bb0e19
--- /dev/null
+++ b/tests/expected/json/example76.txt
@@ -0,0 +1,1 @@
+("value" <= (2 ^ "foo"))
diff --git a/tests/expected/json/example77.json b/tests/expected/json/example77.json
new file mode 100644
index 0000000..1af0d17
--- /dev/null
+++ b/tests/expected/json/example77.json
@@ -0,0 +1,1 @@
+{"op":"=","args":[0.0,{"op":"%","args":[{"property":"foo"},2.0]}]}
diff --git a/tests/expected/json/example77.txt b/tests/expected/json/example77.txt
new file mode 100644
index 0000000..65652b2
--- /dev/null
+++ b/tests/expected/json/example77.txt
@@ -0,0 +1,1 @@
+(0 = ("foo" % 2))
diff --git a/tests/expected/json/example78.json b/tests/expected/json/example78.json
new file mode 100644
index 0000000..844db58
--- /dev/null
+++ b/tests/expected/json/example78.json
@@ -0,0 +1,1 @@
+{"op":"=","args":[1.0,{"op":"div","args":[{"property":"foo"},2.0]}]}
diff --git a/tests/expected/json/example78.txt b/tests/expected/json/example78.txt
new file mode 100644
index 0000000..35cb1e9
--- /dev/null
+++ b/tests/expected/json/example78.txt
@@ -0,0 +1,1 @@
+(1 = div("foo", 2))
diff --git a/tests/expected/json/example79.json b/tests/expected/json/example79.json
new file mode 100644
index 0000000..1e64eaa
--- /dev/null
+++ b/tests/expected/json/example79.json
@@ -0,0 +1,1 @@
+{"op":"a_containedBy","args":[{"property":"values"},["a","b","c"]]}
diff --git a/tests/expected/json/example79.txt b/tests/expected/json/example79.txt
new file mode 100644
index 0000000..55a4224
--- /dev/null
+++ b/tests/expected/json/example79.txt
@@ -0,0 +1,1 @@
+a_containedBy("values", ('a', 'b', 'c'))
diff --git a/tests/expected/json/example80.json b/tests/expected/json/example80.json
new file mode 100644
index 0000000..92709df
--- /dev/null
+++ b/tests/expected/json/example80.json
@@ -0,0 +1,1 @@
+{"op":"a_contains","args":[{"property":"values"},["a","b","c"]]}
diff --git a/tests/expected/json/example80.txt b/tests/expected/json/example80.txt
new file mode 100644
index 0000000..499551b
--- /dev/null
+++ b/tests/expected/json/example80.txt
@@ -0,0 +1,1 @@
+a_contains("values", ('a', 'b', 'c'))
diff --git a/tests/expected/json/example81.json b/tests/expected/json/example81.json
new file mode 100644
index 0000000..e92d98c
--- /dev/null
+++ b/tests/expected/json/example81.json
@@ -0,0 +1,1 @@
+{"op":"a_equals","args":[["a",true,1.0,8.0],{"property":"values"}]}
diff --git a/tests/expected/json/example81.txt b/tests/expected/json/example81.txt
new file mode 100644
index 0000000..0183818
--- /dev/null
+++ b/tests/expected/json/example81.txt
@@ -0,0 +1,1 @@
+a_equals(('a', true, 1, 8), "values")
diff --git a/tests/expected/json/example82.json b/tests/expected/json/example82.json
new file mode 100644
index 0000000..ea8416a
--- /dev/null
+++ b/tests/expected/json/example82.json
@@ -0,0 +1,1 @@
+{"op":"a_overlaps","args":[{"property":"values"},[{"timestamp":"2012-08-10T05:30:00Z"},{"date":"2010-02-10"},false]]}
diff --git a/tests/expected/json/example82.txt b/tests/expected/json/example82.txt
new file mode 100644
index 0000000..3920190
--- /dev/null
+++ b/tests/expected/json/example82.txt
@@ -0,0 +1,1 @@
+a_overlaps("values", (TIMESTAMP('2012-08-10T05:30:00Z'), DATE('2010-02-10'), false))
diff --git a/tests/expected/json/example83.json b/tests/expected/json/example83.json
new file mode 100644
index 0000000..8cd0d1b
--- /dev/null
+++ b/tests/expected/json/example83.json
@@ -0,0 +1,1 @@
+{"op":"s_equals","args":[{"type":"MultiPoint","coordinates":[[180.0,-0.5],[179.0,-47.121701],[180.0,-0.0],[33.470475,-0.99999],[179.0,-15.333062]]},{"property":"geometry"}]}
diff --git a/tests/expected/json/example83.txt b/tests/expected/json/example83.txt
new file mode 100644
index 0000000..680973f
--- /dev/null
+++ b/tests/expected/json/example83.txt
@@ -0,0 +1,1 @@
+s_equals(MULTIPOINT(180 -0.5,179 -47.121701,180 -0,33.470475 -0.99999,179 -15.333062), "geometry")
diff --git a/tests/expected/json/example84.json b/tests/expected/json/example84.json
new file mode 100644
index 0000000..475c6e4
--- /dev/null
+++ b/tests/expected/json/example84.json
@@ -0,0 +1,1 @@
+{"op":"s_equals","args":[{"type":"GeometryCollection","geometries":[{"type":"Point","coordinates":[1.9,2.00001]},{"type":"Point","coordinates":[0.0,-2.00001]},{"type":"MultiLineString","coordinates":[[[-2.00001,-0.0],[-77.292642,-0.5],[-87.515626,-0.0],[-180.0,12.502773],[21.204842,-1.5],[-21.878857,-90.0]]]},{"type":"Point","coordinates":[1.9,0.5]},{"type":"LineString","coordinates":[[179.0,1.179148],[-148.192487,-65.007816],[0.5,0.333333]]}]},{"property":"geometry"}]}
diff --git a/tests/expected/json/example84.txt b/tests/expected/json/example84.txt
new file mode 100644
index 0000000..894380d
--- /dev/null
+++ b/tests/expected/json/example84.txt
@@ -0,0 +1,1 @@
+s_equals(GEOMETRYCOLLECTION(POINT(1.9 2.00001),POINT(0 -2.00001),MULTILINESTRING((-2.00001 -0,-77.292642 -0.5,-87.515626 -0,-180 12.502773,21.204842 -1.5,-21.878857 -90)),POINT(1.9 0.5),LINESTRING(179 1.179148,-148.192487 -65.007816,0.5 0.333333)), "geometry")
diff --git a/tests/expected/json/example85-alt01.json b/tests/expected/json/example85-alt01.json
new file mode 100644
index 0000000..13b9703
--- /dev/null
+++ b/tests/expected/json/example85-alt01.json
@@ -0,0 +1,1 @@
+{"op":"=","args":[{"property":"value"},{"op":"-","args":[{"op":"+","args":[{"op":"*","args":[{"op":"*","args":[-1.0,{"property":"foo"}]},2.0]},{"op":"/","args":[{"property":"bar"},6.1234]}]},{"op":"^","args":[{"property":"x"},2.0]}]}]}
diff --git a/tests/expected/json/example85.json b/tests/expected/json/example85.json
new file mode 100644
index 0000000..13b9703
--- /dev/null
+++ b/tests/expected/json/example85.json
@@ -0,0 +1,1 @@
+{"op":"=","args":[{"property":"value"},{"op":"-","args":[{"op":"+","args":[{"op":"*","args":[{"op":"*","args":[-1.0,{"property":"foo"}]},2.0]},{"op":"/","args":[{"property":"bar"},6.1234]}]},{"op":"^","args":[{"property":"x"},2.0]}]}]}
diff --git a/tests/expected/json/example85.txt b/tests/expected/json/example85.txt
new file mode 100644
index 0000000..fe6f575
--- /dev/null
+++ b/tests/expected/json/example85.txt
@@ -0,0 +1,1 @@
+("value" = ((((-1 * "foo") * 2) + ("bar" / 6.1234)) - ("x" ^ 2)))
diff --git a/tests/expected/json/example86.json b/tests/expected/json/example86.json
new file mode 100644
index 0000000..71c574a
--- /dev/null
+++ b/tests/expected/json/example86.json
@@ -0,0 +1,1 @@
+{"op":"like","args":[{"property":"name"},{"op":"casei","args":["FOO%"]}]}
diff --git a/tests/expected/json/example86.txt b/tests/expected/json/example86.txt
new file mode 100644
index 0000000..e648cfc
--- /dev/null
+++ b/tests/expected/json/example86.txt
@@ -0,0 +1,1 @@
+like("name", casei('FOO%'))
diff --git a/tests/expected/text/clause6_01.json b/tests/expected/text/clause6_01.json
new file mode 100644
index 0000000..fe3290a
--- /dev/null
+++ b/tests/expected/text/clause6_01.json
@@ -0,0 +1,1 @@
+{"op":"avg","args":[{"property":"windSpeed"}]}
diff --git a/tests/expected/text/clause6_01.txt b/tests/expected/text/clause6_01.txt
new file mode 100644
index 0000000..7da7915
--- /dev/null
+++ b/tests/expected/text/clause6_01.txt
@@ -0,0 +1,1 @@
+avg("windSpeed")
diff --git a/tests/expected/text/clause6_02a.json b/tests/expected/text/clause6_02a.json
new file mode 100644
index 0000000..21be46c
--- /dev/null
+++ b/tests/expected/text/clause6_02a.json
@@ -0,0 +1,1 @@
+{"op":"=","args":[{"property":"city"},"Toronto"]}
diff --git a/tests/expected/text/clause6_02a.txt b/tests/expected/text/clause6_02a.txt
new file mode 100644
index 0000000..9eadc2d
--- /dev/null
+++ b/tests/expected/text/clause6_02a.txt
@@ -0,0 +1,1 @@
+("city" = 'Toronto')
diff --git a/tests/expected/text/clause6_02b.json b/tests/expected/text/clause6_02b.json
new file mode 100644
index 0000000..7f5a3ea
--- /dev/null
+++ b/tests/expected/text/clause6_02b.json
@@ -0,0 +1,1 @@
+{"op":"<","args":[{"op":"avg","args":[{"property":"windSpeed"}]},4.0]}
diff --git a/tests/expected/text/clause6_02b.txt b/tests/expected/text/clause6_02b.txt
new file mode 100644
index 0000000..8e74c1c
--- /dev/null
+++ b/tests/expected/text/clause6_02b.txt
@@ -0,0 +1,1 @@
+(avg("windSpeed") < 4)
diff --git a/tests/expected/text/clause6_02c.json b/tests/expected/text/clause6_02c.json
new file mode 100644
index 0000000..9f04c8b
--- /dev/null
+++ b/tests/expected/text/clause6_02c.json
@@ -0,0 +1,1 @@
+{"op":">","args":[{"op":"-","args":[{"property":"balance"},150.0]},0.0]}
diff --git a/tests/expected/text/clause6_02c.txt b/tests/expected/text/clause6_02c.txt
new file mode 100644
index 0000000..04a3306
--- /dev/null
+++ b/tests/expected/text/clause6_02c.txt
@@ -0,0 +1,1 @@
+(("balance" - 150) > 0)
diff --git a/tests/expected/text/clause6_02d.json b/tests/expected/text/clause6_02d.json
new file mode 100644
index 0000000..87d2bd3
--- /dev/null
+++ b/tests/expected/text/clause6_02d.json
@@ -0,0 +1,1 @@
+{"op":">=","args":[{"property":"updated"},{"date":"1970-01-01"}]}
diff --git a/tests/expected/text/clause6_02d.txt b/tests/expected/text/clause6_02d.txt
new file mode 100644
index 0000000..652b385
--- /dev/null
+++ b/tests/expected/text/clause6_02d.txt
@@ -0,0 +1,1 @@
+("updated" >= DATE('1970-01-01'))
diff --git a/tests/expected/text/clause6_03.json b/tests/expected/text/clause6_03.json
new file mode 100644
index 0000000..c5ae41c
--- /dev/null
+++ b/tests/expected/text/clause6_03.json
@@ -0,0 +1,1 @@
+{"op":"isNull","args":[{"property":"geometry"}]}
diff --git a/tests/expected/text/clause6_03.txt b/tests/expected/text/clause6_03.txt
new file mode 100644
index 0000000..37bb3e2
--- /dev/null
+++ b/tests/expected/text/clause6_03.txt
@@ -0,0 +1,1 @@
+isNull("geometry")
diff --git a/tests/expected/text/clause7_01.json b/tests/expected/text/clause7_01.json
new file mode 100644
index 0000000..2b121e5
--- /dev/null
+++ b/tests/expected/text/clause7_01.json
@@ -0,0 +1,1 @@
+{"op":"like","args":[{"property":"name"},"Smith%"]}
diff --git a/tests/expected/text/clause7_01.txt b/tests/expected/text/clause7_01.txt
new file mode 100644
index 0000000..5775a98
--- /dev/null
+++ b/tests/expected/text/clause7_01.txt
@@ -0,0 +1,1 @@
+like("name", 'Smith%')
diff --git a/tests/expected/text/clause7_02.json b/tests/expected/text/clause7_02.json
new file mode 100644
index 0000000..1493b69
--- /dev/null
+++ b/tests/expected/text/clause7_02.json
@@ -0,0 +1,1 @@
+{"op":"between","args":[{"property":"depth"},100.0,150.0]}
diff --git a/tests/expected/text/clause7_02.txt b/tests/expected/text/clause7_02.txt
new file mode 100644
index 0000000..2ef194b
--- /dev/null
+++ b/tests/expected/text/clause7_02.txt
@@ -0,0 +1,1 @@
+("depth" BETWEEN 100 AND 150)
diff --git a/tests/expected/text/clause7_03a.json b/tests/expected/text/clause7_03a.json
new file mode 100644
index 0000000..2e6269b
--- /dev/null
+++ b/tests/expected/text/clause7_03a.json
@@ -0,0 +1,1 @@
+{"op":"in","args":[{"property":"cityName"},["Toronto","Frankfurt","Tokyo","New York"]]}
diff --git a/tests/expected/text/clause7_03a.txt b/tests/expected/text/clause7_03a.txt
new file mode 100644
index 0000000..2db8c38
--- /dev/null
+++ b/tests/expected/text/clause7_03a.txt
@@ -0,0 +1,1 @@
+in("cityName", ('Toronto', 'Frankfurt', 'Tokyo', 'New York'))
diff --git a/tests/expected/text/clause7_03b.json b/tests/expected/text/clause7_03b.json
new file mode 100644
index 0000000..9bda911
--- /dev/null
+++ b/tests/expected/text/clause7_03b.json
@@ -0,0 +1,1 @@
+{"op":"not","args":[{"op":"in","args":[{"property":"category"},[1.0,2.0,3.0,4.0]]}]}
diff --git a/tests/expected/text/clause7_03b.txt b/tests/expected/text/clause7_03b.txt
new file mode 100644
index 0000000..d6823b3
--- /dev/null
+++ b/tests/expected/text/clause7_03b.txt
@@ -0,0 +1,1 @@
+(NOT in("category", (1, 2, 3, 4)))
diff --git a/tests/expected/text/clause7_04.json b/tests/expected/text/clause7_04.json
new file mode 100644
index 0000000..918f401
--- /dev/null
+++ b/tests/expected/text/clause7_04.json
@@ -0,0 +1,1 @@
+{"op":"in","args":[{"op":"casei","args":[{"property":"road_class"}]},[{"op":"casei","args":["Οδος"]},{"op":"casei","args":["Straße"]}]]}
diff --git a/tests/expected/text/clause7_04.txt b/tests/expected/text/clause7_04.txt
new file mode 100644
index 0000000..cf16575
--- /dev/null
+++ b/tests/expected/text/clause7_04.txt
@@ -0,0 +1,1 @@
+in(casei("road_class"), (casei('Οδος'), casei('Straße')))
diff --git a/tests/expected/text/clause7_05.json b/tests/expected/text/clause7_05.json
new file mode 100644
index 0000000..5903327
--- /dev/null
+++ b/tests/expected/text/clause7_05.json
@@ -0,0 +1,1 @@
+{"op":"=","args":[{"op":"accenti","args":[{"property":"etat_vol"}]},{"op":"accenti","args":["débárquér"]}]}
diff --git a/tests/expected/text/clause7_05.txt b/tests/expected/text/clause7_05.txt
new file mode 100644
index 0000000..2899d9e
--- /dev/null
+++ b/tests/expected/text/clause7_05.txt
@@ -0,0 +1,1 @@
+(accenti("etat_vol") = accenti('débárquér'))
diff --git a/tests/expected/text/clause7_07.json b/tests/expected/text/clause7_07.json
new file mode 100644
index 0000000..466c96e
--- /dev/null
+++ b/tests/expected/text/clause7_07.json
@@ -0,0 +1,1 @@
+{"op":"s_intersects","args":[{"property":"geometry"},{"type":"Point","coordinates":[36.319836,32.288087]}]}
diff --git a/tests/expected/text/clause7_07.txt b/tests/expected/text/clause7_07.txt
new file mode 100644
index 0000000..eeb90f9
--- /dev/null
+++ b/tests/expected/text/clause7_07.txt
@@ -0,0 +1,1 @@
+s_intersects("geometry", POINT(36.319836 32.288087))
diff --git a/tests/expected/text/clause7_10.json b/tests/expected/text/clause7_10.json
new file mode 100644
index 0000000..c71f5ff
--- /dev/null
+++ b/tests/expected/text/clause7_10.json
@@ -0,0 +1,1 @@
+{"op":"s_crosses","args":[{"property":"road"},{"type":"Polygon","coordinates":[[[43.7286,-79.2986],[43.7311,-79.2996],[43.7323,-79.2972],[43.7326,-79.2971],[43.735,-79.2981],[43.735,-79.2982],[43.7352,-79.2982],[43.7357,-79.2956],[43.7337,-79.2948],[43.7343,-79.2933],[43.7339,-79.2923],[43.7327,-79.2947],[43.732,-79.2942],[43.7322,-79.2937],[43.7306,-79.293],[43.7303,-79.293],[43.7299,-79.2928],[43.7286,-79.2986]]]}]}
diff --git a/tests/expected/text/clause7_10.txt b/tests/expected/text/clause7_10.txt
new file mode 100644
index 0000000..3286a73
--- /dev/null
+++ b/tests/expected/text/clause7_10.txt
@@ -0,0 +1,1 @@
+s_crosses("road", POLYGON((43.7286 -79.2986,43.7311 -79.2996,43.7323 -79.2972,43.7326 -79.2971,43.735 -79.2981,43.735 -79.2982,43.7352 -79.2982,43.7357 -79.2956,43.7337 -79.2948,43.7343 -79.2933,43.7339 -79.2923,43.7327 -79.2947,43.732 -79.2942,43.7322 -79.2937,43.7306 -79.293,43.7303 -79.293,43.7299 -79.2928,43.7286 -79.2986)))
diff --git a/tests/expected/text/clause7_12.json b/tests/expected/text/clause7_12.json
new file mode 100644
index 0000000..281c144
--- /dev/null
+++ b/tests/expected/text/clause7_12.json
@@ -0,0 +1,1 @@
+{"op":"t_intersects","args":[{"property":"event_time"},{"interval":["1969-07-16T05:32:00Z","1969-07-24T16:50:35Z"]}]}
diff --git a/tests/expected/text/clause7_12.txt b/tests/expected/text/clause7_12.txt
new file mode 100644
index 0000000..4dc5306
--- /dev/null
+++ b/tests/expected/text/clause7_12.txt
@@ -0,0 +1,1 @@
+t_intersects("event_time", INTERVAL('1969-07-16T05:32:00Z','1969-07-24T16:50:35Z'))
diff --git a/tests/expected/text/clause7_13.json b/tests/expected/text/clause7_13.json
new file mode 100644
index 0000000..29d93dd
--- /dev/null
+++ b/tests/expected/text/clause7_13.json
@@ -0,0 +1,1 @@
+{"op":"t_during","args":[{"interval":[{"property":"touchdown"},{"property":"liftOff"}]},{"interval":["1969-07-16T13:32:00Z","1969-07-24T16:50:35Z"]}]}
diff --git a/tests/expected/text/clause7_13.txt b/tests/expected/text/clause7_13.txt
new file mode 100644
index 0000000..bb6c3dc
--- /dev/null
+++ b/tests/expected/text/clause7_13.txt
@@ -0,0 +1,1 @@
+t_during(INTERVAL("touchdown","liftOff"), INTERVAL('1969-07-16T13:32:00Z','1969-07-24T16:50:35Z'))
diff --git a/tests/expected/text/clause7_15.json b/tests/expected/text/clause7_15.json
new file mode 100644
index 0000000..c88bf36
--- /dev/null
+++ b/tests/expected/text/clause7_15.json
@@ -0,0 +1,1 @@
+{"op":"a_contains","args":[{"property":"layer:ids"},["layers-ca","layers-us"]]}
diff --git a/tests/expected/text/clause7_15.txt b/tests/expected/text/clause7_15.txt
new file mode 100644
index 0000000..53d5bb4
--- /dev/null
+++ b/tests/expected/text/clause7_15.txt
@@ -0,0 +1,1 @@
+a_contains("layer:ids", ('layers-ca', 'layers-us'))
diff --git a/tests/expected/text/clause7_16.json b/tests/expected/text/clause7_16.json
new file mode 100644
index 0000000..8b03b4c
--- /dev/null
+++ b/tests/expected/text/clause7_16.json
@@ -0,0 +1,1 @@
+{"op":"s_crosses","args":[{"type":"LineString","coordinates":[[43.72992,-79.2998],[43.73005,-79.2991],[43.73006,-79.2984],[43.7314,-79.2956],[43.73259,-79.295],[43.73266,-79.2945],[43.7332,-79.2936],[43.73378,-79.2936],[43.73486,-79.2917]]},{"type":"Polygon","coordinates":[[[43.7286,-79.2986],[43.7311,-79.2996],[43.7323,-79.2972],[43.7326,-79.2971],[43.735,-79.2981],[43.735,-79.2982],[43.7352,-79.2982],[43.7357,-79.2956],[43.7337,-79.2948],[43.7343,-79.2933],[43.7339,-79.2923],[43.7327,-79.2947],[43.732,-79.2942],[43.7322,-79.2937],[43.7306,-79.293],[43.7303,-79.293],[43.7299,-79.2928],[43.7286,-79.2986]]]}]}
diff --git a/tests/expected/text/clause7_16.txt b/tests/expected/text/clause7_16.txt
new file mode 100644
index 0000000..0072784
--- /dev/null
+++ b/tests/expected/text/clause7_16.txt
@@ -0,0 +1,1 @@
+s_crosses(LINESTRING(43.72992 -79.2998,43.73005 -79.2991,43.73006 -79.2984,43.7314 -79.2956,43.73259 -79.295,43.73266 -79.2945,43.7332 -79.2936,43.73378 -79.2936,43.73486 -79.2917), POLYGON((43.7286 -79.2986,43.7311 -79.2996,43.7323 -79.2972,43.7326 -79.2971,43.735 -79.2981,43.735 -79.2982,43.7352 -79.2982,43.7357 -79.2956,43.7337 -79.2948,43.7343 -79.2933,43.7339 -79.2923,43.7327 -79.2947,43.732 -79.2942,43.7322 -79.2937,43.7306 -79.293,43.7303 -79.293,43.7299 -79.2928,43.7286 -79.2986)))
diff --git a/tests/expected/text/clause7_17.json b/tests/expected/text/clause7_17.json
new file mode 100644
index 0000000..325540c
--- /dev/null
+++ b/tests/expected/text/clause7_17.json
@@ -0,0 +1,1 @@
+{"op":"t_during","args":[{"interval":["1969-07-20T20:17:40Z","1969-07-21T17:54:00Z"]},{"interval":["1969-07-16T13:32:00Z","1969-07-24T16:50:35Z"]}]}
diff --git a/tests/expected/text/clause7_17.txt b/tests/expected/text/clause7_17.txt
new file mode 100644
index 0000000..1a5313e
--- /dev/null
+++ b/tests/expected/text/clause7_17.txt
@@ -0,0 +1,1 @@
+t_during(INTERVAL('1969-07-20T20:17:40Z','1969-07-21T17:54:00Z'), INTERVAL('1969-07-16T13:32:00Z','1969-07-24T16:50:35Z'))
diff --git a/tests/expected/text/clause7_18.json b/tests/expected/text/clause7_18.json
new file mode 100644
index 0000000..022648d
--- /dev/null
+++ b/tests/expected/text/clause7_18.json
@@ -0,0 +1,1 @@
+{"op":"s_within","args":[{"property":"road"},{"op":"buffer","args":[{"property":"geometry"},10.0,"m"]}]}
diff --git a/tests/expected/text/clause7_18.txt b/tests/expected/text/clause7_18.txt
new file mode 100644
index 0000000..a15b9a6
--- /dev/null
+++ b/tests/expected/text/clause7_18.txt
@@ -0,0 +1,1 @@
+s_within("road", buffer("geometry", 10, 'm'))
diff --git a/tests/expected/text/clause7_19.json b/tests/expected/text/clause7_19.json
new file mode 100644
index 0000000..a07993f
--- /dev/null
+++ b/tests/expected/text/clause7_19.json
@@ -0,0 +1,1 @@
+{"op":">","args":[{"property":"vehicle_height"},{"op":"-","args":[{"property":"bridge_clearance"},1.0]}]}
diff --git a/tests/expected/text/clause7_19.txt b/tests/expected/text/clause7_19.txt
new file mode 100644
index 0000000..2401b91
--- /dev/null
+++ b/tests/expected/text/clause7_19.txt
@@ -0,0 +1,1 @@
+("vehicle_height" > ("bridge_clearance" - 1))
diff --git a/tests/expected/text/example01.json b/tests/expected/text/example01.json
new file mode 100644
index 0000000..b5de01a
--- /dev/null
+++ b/tests/expected/text/example01.json
@@ -0,0 +1,1 @@
+{"op":"=","args":[{"property":"landsat:scene_id"},"LC82030282019133LGN00"]}
diff --git a/tests/expected/text/example01.txt b/tests/expected/text/example01.txt
new file mode 100644
index 0000000..8ea0134
--- /dev/null
+++ b/tests/expected/text/example01.txt
@@ -0,0 +1,1 @@
+("landsat:scene_id" = 'LC82030282019133LGN00')
diff --git a/tests/expected/text/example02.json b/tests/expected/text/example02.json
new file mode 100644
index 0000000..001ff68
--- /dev/null
+++ b/tests/expected/text/example02.json
@@ -0,0 +1,1 @@
+{"op":"like","args":[{"property":"eo:instrument"},"OLI%"]}
diff --git a/tests/expected/text/example02.txt b/tests/expected/text/example02.txt
new file mode 100644
index 0000000..c7b9388
--- /dev/null
+++ b/tests/expected/text/example02.txt
@@ -0,0 +1,1 @@
+like("eo:instrument", 'OLI%')
diff --git a/tests/expected/text/example03.json b/tests/expected/text/example03.json
new file mode 100644
index 0000000..a3a8e9d
--- /dev/null
+++ b/tests/expected/text/example03.json
@@ -0,0 +1,1 @@
+{"op":"in","args":[{"property":"landsat:wrs_path"},["153","154","15X"]]}
diff --git a/tests/expected/text/example03.txt b/tests/expected/text/example03.txt
new file mode 100644
index 0000000..51dd73b
--- /dev/null
+++ b/tests/expected/text/example03.txt
@@ -0,0 +1,1 @@
+in("landsat:wrs_path", ('153', '154', '15X'))
diff --git a/tests/expected/text/example04.json b/tests/expected/text/example04.json
new file mode 100644
index 0000000..f2df389
--- /dev/null
+++ b/tests/expected/text/example04.json
@@ -0,0 +1,1 @@
+{"op":"and","args":[{"op":"<","args":[{"property":"eo:cloud_cover"},0.1]},{"op":"=","args":[{"property":"landsat:wrs_row"},28.0]},{"op":"=","args":[{"property":"landsat:wrs_path"},203.0]}]}
diff --git a/tests/expected/text/example04.txt b/tests/expected/text/example04.txt
new file mode 100644
index 0000000..a3b155c
--- /dev/null
+++ b/tests/expected/text/example04.txt
@@ -0,0 +1,1 @@
+(("eo:cloud_cover" < 0.1) AND ("landsat:wrs_row" = 28) AND ("landsat:wrs_path" = 203))
diff --git a/tests/expected/text/example05a.json b/tests/expected/text/example05a.json
new file mode 100644
index 0000000..29e996b
--- /dev/null
+++ b/tests/expected/text/example05a.json
@@ -0,0 +1,1 @@
+{"op":"or","args":[{"op":"=","args":[{"property":"eo:cloud_cover"},0.1]},{"op":"=","args":[{"property":"eo:cloud_cover"},0.2]}]}
diff --git a/tests/expected/text/example05a.txt b/tests/expected/text/example05a.txt
new file mode 100644
index 0000000..203915c
--- /dev/null
+++ b/tests/expected/text/example05a.txt
@@ -0,0 +1,1 @@
+(("eo:cloud_cover" = 0.1) OR ("eo:cloud_cover" = 0.2))
diff --git a/tests/expected/text/example05b.json b/tests/expected/text/example05b.json
new file mode 100644
index 0000000..22874a2
--- /dev/null
+++ b/tests/expected/text/example05b.json
@@ -0,0 +1,1 @@
+{"op":"in","args":[{"property":"eo:cloud_cover"},[0.1,0.2]]}
diff --git a/tests/expected/text/example05b.txt b/tests/expected/text/example05b.txt
new file mode 100644
index 0000000..d86d13f
--- /dev/null
+++ b/tests/expected/text/example05b.txt
@@ -0,0 +1,1 @@
+in("eo:cloud_cover", (0.1, 0.2))
diff --git a/tests/expected/text/example06a.json b/tests/expected/text/example06a.json
new file mode 100644
index 0000000..8838489
--- /dev/null
+++ b/tests/expected/text/example06a.json
@@ -0,0 +1,1 @@
+{"op":"between","args":[{"property":"eo:cloud_cover"},0.1,0.2]}
diff --git a/tests/expected/text/example06a.txt b/tests/expected/text/example06a.txt
new file mode 100644
index 0000000..048ae4e
--- /dev/null
+++ b/tests/expected/text/example06a.txt
@@ -0,0 +1,1 @@
+("eo:cloud_cover" BETWEEN 0.1 AND 0.2)
diff --git a/tests/expected/text/example06b.json b/tests/expected/text/example06b.json
new file mode 100644
index 0000000..f986256
--- /dev/null
+++ b/tests/expected/text/example06b.json
@@ -0,0 +1,1 @@
+{"op":"and","args":[{"op":">=","args":[{"property":"eo:cloud_cover"},0.1]},{"op":"<=","args":[{"property":"eo:cloud_cover"},0.2]},{"op":"=","args":[{"property":"landsat:wrs_row"},28.0]},{"op":"=","args":[{"property":"landsat:wrs_path"},203.0]}]}
diff --git a/tests/expected/text/example06b.txt b/tests/expected/text/example06b.txt
new file mode 100644
index 0000000..f369547
--- /dev/null
+++ b/tests/expected/text/example06b.txt
@@ -0,0 +1,1 @@
+(("eo:cloud_cover" >= 0.1) AND ("eo:cloud_cover" <= 0.2) AND ("landsat:wrs_row" = 28) AND ("landsat:wrs_path" = 203))
diff --git a/tests/expected/text/example07.json b/tests/expected/text/example07.json
new file mode 100644
index 0000000..8b7ec9f
--- /dev/null
+++ b/tests/expected/text/example07.json
@@ -0,0 +1,1 @@
+{"op":"and","args":[{"op":"like","args":[{"property":"eo:instrument"},"OLI%"]},{"op":"s_intersects","args":[{"property":"footprint"},{"type":"Polygon","coordinates":[[[43.5845,-79.5442],[43.6079,-79.4893],[43.5677,-79.4632],[43.6129,-79.3925],[43.6223,-79.3238],[43.6576,-79.3163],[43.7945,-79.1178],[43.8144,-79.1542],[43.8555,-79.1714],[43.7509,-79.639],[43.5845,-79.5442]]]}]}]}
diff --git a/tests/expected/text/example07.txt b/tests/expected/text/example07.txt
new file mode 100644
index 0000000..e7f6d32
--- /dev/null
+++ b/tests/expected/text/example07.txt
@@ -0,0 +1,1 @@
+(like("eo:instrument", 'OLI%') AND s_intersects("footprint", POLYGON((43.5845 -79.5442,43.6079 -79.4893,43.5677 -79.4632,43.6129 -79.3925,43.6223 -79.3238,43.6576 -79.3163,43.7945 -79.1178,43.8144 -79.1542,43.8555 -79.1714,43.7509 -79.639,43.5845 -79.5442))))
diff --git a/tests/expected/text/example08.json b/tests/expected/text/example08.json
new file mode 100644
index 0000000..7193360
--- /dev/null
+++ b/tests/expected/text/example08.json
@@ -0,0 +1,1 @@
+{"op":"and","args":[{"op":"=","args":[{"property":"beamMode"},"ScanSAR Narrow"]},{"op":"=","args":[{"property":"swathDirection"},"ascending"]},{"op":"=","args":[{"property":"polarization"},"HH+VV+HV+VH"]},{"op":"s_intersects","args":[{"property":"footprint"},{"type":"Polygon","coordinates":[[[-77.117938,38.93686],[-77.040604,39.995648],[-76.910536,38.892912],[-77.039359,38.791753],[-77.047906,38.841462],[-77.034183,38.840655],[-77.033142,38.85749],[-77.117938,38.93686]]]}]}]}
diff --git a/tests/expected/text/example08.txt b/tests/expected/text/example08.txt
new file mode 100644
index 0000000..3b5001b
--- /dev/null
+++ b/tests/expected/text/example08.txt
@@ -0,0 +1,1 @@
+(("beamMode" = 'ScanSAR Narrow') AND ("swathDirection" = 'ascending') AND ("polarization" = 'HH+VV+HV+VH') AND s_intersects("footprint", POLYGON((-77.117938 38.93686,-77.040604 39.995648,-76.910536 38.892912,-77.039359 38.791753,-77.047906 38.841462,-77.034183 38.840655,-77.033142 38.85749,-77.117938 38.93686))))
diff --git a/tests/expected/text/example09.json b/tests/expected/text/example09.json
new file mode 100644
index 0000000..9fc6caa
--- /dev/null
+++ b/tests/expected/text/example09.json
@@ -0,0 +1,1 @@
+{"op":">","args":[{"property":"floors"},5.0]}
diff --git a/tests/expected/text/example09.txt b/tests/expected/text/example09.txt
new file mode 100644
index 0000000..c8147f0
--- /dev/null
+++ b/tests/expected/text/example09.txt
@@ -0,0 +1,1 @@
+("floors" > 5)
diff --git a/tests/expected/text/example10.json b/tests/expected/text/example10.json
new file mode 100644
index 0000000..1dd499d
--- /dev/null
+++ b/tests/expected/text/example10.json
@@ -0,0 +1,1 @@
+{"op":"<=","args":[{"property":"taxes"},500.0]}
diff --git a/tests/expected/text/example10.txt b/tests/expected/text/example10.txt
new file mode 100644
index 0000000..281c134
--- /dev/null
+++ b/tests/expected/text/example10.txt
@@ -0,0 +1,1 @@
+("taxes" <= 500)
diff --git a/tests/expected/text/example11.json b/tests/expected/text/example11.json
new file mode 100644
index 0000000..c690b9a
--- /dev/null
+++ b/tests/expected/text/example11.json
@@ -0,0 +1,1 @@
+{"op":"like","args":[{"property":"owner"},"%Jones%"]}
diff --git a/tests/expected/text/example11.txt b/tests/expected/text/example11.txt
new file mode 100644
index 0000000..294411f
--- /dev/null
+++ b/tests/expected/text/example11.txt
@@ -0,0 +1,1 @@
+like("owner", '%Jones%')
diff --git a/tests/expected/text/example12.json b/tests/expected/text/example12.json
new file mode 100644
index 0000000..a52bf05
--- /dev/null
+++ b/tests/expected/text/example12.json
@@ -0,0 +1,1 @@
+{"op":"like","args":[{"property":"owner"},"Mike%"]}
diff --git a/tests/expected/text/example12.txt b/tests/expected/text/example12.txt
new file mode 100644
index 0000000..2415deb
--- /dev/null
+++ b/tests/expected/text/example12.txt
@@ -0,0 +1,1 @@
+like("owner", 'Mike%')
diff --git a/tests/expected/text/example13.json b/tests/expected/text/example13.json
new file mode 100644
index 0000000..7395264
--- /dev/null
+++ b/tests/expected/text/example13.json
@@ -0,0 +1,1 @@
+{"op":"not","args":[{"op":"like","args":[{"property":"owner"},"%Mike%"]}]}
diff --git a/tests/expected/text/example13.txt b/tests/expected/text/example13.txt
new file mode 100644
index 0000000..c2a78da
--- /dev/null
+++ b/tests/expected/text/example13.txt
@@ -0,0 +1,1 @@
+(NOT like("owner", '%Mike%'))
diff --git a/tests/expected/text/example14.json b/tests/expected/text/example14.json
new file mode 100644
index 0000000..ca167d2
--- /dev/null
+++ b/tests/expected/text/example14.json
@@ -0,0 +1,1 @@
+{"op":"=","args":[{"property":"swimming_pool"},true]}
diff --git a/tests/expected/text/example14.txt b/tests/expected/text/example14.txt
new file mode 100644
index 0000000..bcec8de
--- /dev/null
+++ b/tests/expected/text/example14.txt
@@ -0,0 +1,1 @@
+("swimming_pool" = true)
diff --git a/tests/expected/text/example15.json b/tests/expected/text/example15.json
new file mode 100644
index 0000000..97d1cd3
--- /dev/null
+++ b/tests/expected/text/example15.json
@@ -0,0 +1,1 @@
+{"op":"and","args":[{"op":">","args":[{"property":"floors"},5.0]},{"op":"=","args":[{"property":"swimming_pool"},true]}]}
diff --git a/tests/expected/text/example15.txt b/tests/expected/text/example15.txt
new file mode 100644
index 0000000..2ead8f9
--- /dev/null
+++ b/tests/expected/text/example15.txt
@@ -0,0 +1,1 @@
+(("floors" > 5) AND ("swimming_pool" = true))
diff --git a/tests/expected/text/example16.json b/tests/expected/text/example16.json
new file mode 100644
index 0000000..399cd34
--- /dev/null
+++ b/tests/expected/text/example16.json
@@ -0,0 +1,1 @@
+{"op":"and","args":[{"op":"=","args":[{"property":"swimming_pool"},true]},{"op":"or","args":[{"op":"or","args":[{"op":">","args":[{"property":"floors"},5.0]},{"op":"like","args":[{"property":"material"},"brick%"]}]},{"op":"like","args":[{"property":"material"},"%brick"]}]}]}
diff --git a/tests/expected/text/example16.txt b/tests/expected/text/example16.txt
new file mode 100644
index 0000000..5e9a01a
--- /dev/null
+++ b/tests/expected/text/example16.txt
@@ -0,0 +1,1 @@
+(("swimming_pool" = true) AND ((("floors" > 5) OR like("material", 'brick%')) OR like("material", '%brick')))
diff --git a/tests/expected/text/example17.json b/tests/expected/text/example17.json
new file mode 100644
index 0000000..496875c
--- /dev/null
+++ b/tests/expected/text/example17.json
@@ -0,0 +1,1 @@
+{"op":"and","args":[{"op":">","args":[{"property":"floors"},5.0]},{"op":"=","args":[{"property":"material"},"brick"]},{"op":"=","args":[{"property":"swimming_pool"},true]}]}
diff --git a/tests/expected/text/example17.txt b/tests/expected/text/example17.txt
new file mode 100644
index 0000000..72a912d
--- /dev/null
+++ b/tests/expected/text/example17.txt
@@ -0,0 +1,1 @@
+(("floors" > 5) AND ("material" = 'brick') AND ("swimming_pool" = true))
diff --git a/tests/expected/text/example18.json b/tests/expected/text/example18.json
new file mode 100644
index 0000000..79a847a
--- /dev/null
+++ b/tests/expected/text/example18.json
@@ -0,0 +1,1 @@
+{"op":"or","args":[{"op":"not","args":[{"op":"<","args":[{"property":"floors"},5.0]}]},{"op":"=","args":[{"property":"swimming_pool"},true]}]}
diff --git a/tests/expected/text/example18.txt b/tests/expected/text/example18.txt
new file mode 100644
index 0000000..fee5683
--- /dev/null
+++ b/tests/expected/text/example18.txt
@@ -0,0 +1,1 @@
+((NOT ("floors" < 5)) OR ("swimming_pool" = true))
diff --git a/tests/expected/text/example19.json b/tests/expected/text/example19.json
new file mode 100644
index 0000000..b619042
--- /dev/null
+++ b/tests/expected/text/example19.json
@@ -0,0 +1,1 @@
+{"op":"and","args":[{"op":"or","args":[{"op":"like","args":[{"property":"owner"},"mike%"]},{"op":"like","args":[{"property":"owner"},"Mike%"]}]},{"op":"<","args":[{"property":"floors"},4.0]}]}
diff --git a/tests/expected/text/example19.txt b/tests/expected/text/example19.txt
new file mode 100644
index 0000000..ef51aab
--- /dev/null
+++ b/tests/expected/text/example19.txt
@@ -0,0 +1,1 @@
+((like("owner", 'mike%') OR like("owner", 'Mike%')) AND ("floors" < 4))
diff --git a/tests/expected/text/example20.json b/tests/expected/text/example20.json
new file mode 100644
index 0000000..facdd89
--- /dev/null
+++ b/tests/expected/text/example20.json
@@ -0,0 +1,1 @@
+{"op":"t_before","args":[{"property":"built"},{"date":"2015-01-01"}]}
diff --git a/tests/expected/text/example20.txt b/tests/expected/text/example20.txt
new file mode 100644
index 0000000..dc901d8
--- /dev/null
+++ b/tests/expected/text/example20.txt
@@ -0,0 +1,1 @@
+t_before("built", DATE('2015-01-01'))
diff --git a/tests/expected/text/example21.json b/tests/expected/text/example21.json
new file mode 100644
index 0000000..34d7afe
--- /dev/null
+++ b/tests/expected/text/example21.json
@@ -0,0 +1,1 @@
+{"op":"t_after","args":[{"property":"built"},{"date":"2012-06-05"}]}
diff --git a/tests/expected/text/example21.txt b/tests/expected/text/example21.txt
new file mode 100644
index 0000000..d16a195
--- /dev/null
+++ b/tests/expected/text/example21.txt
@@ -0,0 +1,1 @@
+t_after("built", DATE('2012-06-05'))
diff --git a/tests/expected/text/example22.json b/tests/expected/text/example22.json
new file mode 100644
index 0000000..23d224e
--- /dev/null
+++ b/tests/expected/text/example22.json
@@ -0,0 +1,1 @@
+{"op":"t_during","args":[{"interval":[{"property":"starts_at"},{"property":"ends_at"}]},{"interval":["2017-06-10T07:30:00Z","2017-06-11T10:30:00Z"]}]}
diff --git a/tests/expected/text/example22.txt b/tests/expected/text/example22.txt
new file mode 100644
index 0000000..01aab7d
--- /dev/null
+++ b/tests/expected/text/example22.txt
@@ -0,0 +1,1 @@
+t_during(INTERVAL("starts_at","ends_at"), INTERVAL('2017-06-10T07:30:00Z','2017-06-11T10:30:00Z'))
diff --git a/tests/expected/text/example23.json b/tests/expected/text/example23.json
new file mode 100644
index 0000000..fdffec9
--- /dev/null
+++ b/tests/expected/text/example23.json
@@ -0,0 +1,1 @@
+{"op":"s_within","args":[{"property":"location"},{"op":"bbox","args":[{"op":"*","args":[-1.0,118.0]},33.8,{"op":"*","args":[-1.0,117.9]},34.0]}]}
diff --git a/tests/expected/text/example23.txt b/tests/expected/text/example23.txt
new file mode 100644
index 0000000..b9b17a5
--- /dev/null
+++ b/tests/expected/text/example23.txt
@@ -0,0 +1,1 @@
+s_within("location", bbox((-1 * 118), 33.8, (-1 * 117.9), 34))
diff --git a/tests/expected/text/example24.json b/tests/expected/text/example24.json
new file mode 100644
index 0000000..e0bdf87
--- /dev/null
+++ b/tests/expected/text/example24.json
@@ -0,0 +1,1 @@
+{"op":"s_intersects","args":[{"property":"geometry"},{"type":"Polygon","coordinates":[[[-10,-10],[10,-10],[10,10],[-10,-10]]]}]}
diff --git a/tests/expected/text/example24.txt b/tests/expected/text/example24.txt
new file mode 100644
index 0000000..c895573
--- /dev/null
+++ b/tests/expected/text/example24.txt
@@ -0,0 +1,1 @@
+s_intersects("geometry", POLYGON((-10 -10,10 -10,10 10,-10 -10)))
diff --git a/tests/expected/text/example25.json b/tests/expected/text/example25.json
new file mode 100644
index 0000000..e6c01d2
--- /dev/null
+++ b/tests/expected/text/example25.json
@@ -0,0 +1,1 @@
+{"op":"and","args":[{"op":">","args":[{"property":"floors"},5.0]},{"op":"s_within","args":[{"property":"geometry"},{"op":"bbox","args":[{"op":"*","args":[-1.0,118.0]},33.8,{"op":"*","args":[-1.0,117.9]},34.0]}]}]}
diff --git a/tests/expected/text/example25.txt b/tests/expected/text/example25.txt
new file mode 100644
index 0000000..27ceecd
--- /dev/null
+++ b/tests/expected/text/example25.txt
@@ -0,0 +1,1 @@
+(("floors" > 5) AND s_within("geometry", bbox((-1 * 118), 33.8, (-1 * 117.9), 34)))
diff --git a/tests/expected/text/example26.json b/tests/expected/text/example26.json
new file mode 100644
index 0000000..918f401
--- /dev/null
+++ b/tests/expected/text/example26.json
@@ -0,0 +1,1 @@
+{"op":"in","args":[{"op":"casei","args":[{"property":"road_class"}]},[{"op":"casei","args":["Οδος"]},{"op":"casei","args":["Straße"]}]]}
diff --git a/tests/expected/text/example26.txt b/tests/expected/text/example26.txt
new file mode 100644
index 0000000..cf16575
--- /dev/null
+++ b/tests/expected/text/example26.txt
@@ -0,0 +1,1 @@
+in(casei("road_class"), (casei('Οδος'), casei('Straße')))
diff --git a/tests/expected/text/example27.json b/tests/expected/text/example27.json
new file mode 100644
index 0000000..5903327
--- /dev/null
+++ b/tests/expected/text/example27.json
@@ -0,0 +1,1 @@
+{"op":"=","args":[{"op":"accenti","args":[{"property":"etat_vol"}]},{"op":"accenti","args":["débárquér"]}]}
diff --git a/tests/expected/text/example27.txt b/tests/expected/text/example27.txt
new file mode 100644
index 0000000..2899d9e
--- /dev/null
+++ b/tests/expected/text/example27.txt
@@ -0,0 +1,1 @@
+(accenti("etat_vol") = accenti('débárquér'))
diff --git a/tests/expected/text/example28.json b/tests/expected/text/example28.json
new file mode 100644
index 0000000..cf06616
--- /dev/null
+++ b/tests/expected/text/example28.json
@@ -0,0 +1,1 @@
+{"op":"like","args":[{"op":"casei","args":[{"property":"geophys:SURVEY_NAME"}]},{"op":"casei","args":["%calcutta%"]}]}
diff --git a/tests/expected/text/example28.txt b/tests/expected/text/example28.txt
new file mode 100644
index 0000000..8e9d36a
--- /dev/null
+++ b/tests/expected/text/example28.txt
@@ -0,0 +1,1 @@
+like(casei("geophys:SURVEY_NAME"), casei('%calcutta%'))
diff --git a/tests/expected/text/example29.json b/tests/expected/text/example29.json
new file mode 100644
index 0000000..a6d759e
--- /dev/null
+++ b/tests/expected/text/example29.json
@@ -0,0 +1,1 @@
+{"op":"=","args":[{"property":"id"},"fa7e1920-9107-422d-a3db-c468cbc5d6df"]}
diff --git a/tests/expected/text/example29.txt b/tests/expected/text/example29.txt
new file mode 100644
index 0000000..80f33e9
--- /dev/null
+++ b/tests/expected/text/example29.txt
@@ -0,0 +1,1 @@
+("id" = 'fa7e1920-9107-422d-a3db-c468cbc5d6df')
diff --git a/tests/expected/text/example30.json b/tests/expected/text/example30.json
new file mode 100644
index 0000000..55c1252
--- /dev/null
+++ b/tests/expected/text/example30.json
@@ -0,0 +1,1 @@
+{"op":"<>","args":[{"property":"id"},"fa7e1920-9107-422d-a3db-c468cbc5d6df"]}
diff --git a/tests/expected/text/example30.txt b/tests/expected/text/example30.txt
new file mode 100644
index 0000000..0578a6f
--- /dev/null
+++ b/tests/expected/text/example30.txt
@@ -0,0 +1,1 @@
+("id" <> 'fa7e1920-9107-422d-a3db-c468cbc5d6df')
diff --git a/tests/expected/text/example31.json b/tests/expected/text/example31.json
new file mode 100644
index 0000000..c0ace76
--- /dev/null
+++ b/tests/expected/text/example31.json
@@ -0,0 +1,1 @@
+{"op":"<","args":[{"property":"value"},10.0]}
diff --git a/tests/expected/text/example31.txt b/tests/expected/text/example31.txt
new file mode 100644
index 0000000..d65390e
--- /dev/null
+++ b/tests/expected/text/example31.txt
@@ -0,0 +1,1 @@
+("value" < 10)
diff --git a/tests/expected/text/example32.json b/tests/expected/text/example32.json
new file mode 100644
index 0000000..7246dea
--- /dev/null
+++ b/tests/expected/text/example32.json
@@ -0,0 +1,1 @@
+{"op":">","args":[{"property":"value"},10.0]}
diff --git a/tests/expected/text/example32.txt b/tests/expected/text/example32.txt
new file mode 100644
index 0000000..a89adf5
--- /dev/null
+++ b/tests/expected/text/example32.txt
@@ -0,0 +1,1 @@
+("value" > 10)
diff --git a/tests/expected/text/example33.json b/tests/expected/text/example33.json
new file mode 100644
index 0000000..cce72a7
--- /dev/null
+++ b/tests/expected/text/example33.json
@@ -0,0 +1,1 @@
+{"op":"<=","args":[{"property":"value"},10.0]}
diff --git a/tests/expected/text/example33.txt b/tests/expected/text/example33.txt
new file mode 100644
index 0000000..43f85fc
--- /dev/null
+++ b/tests/expected/text/example33.txt
@@ -0,0 +1,1 @@
+("value" <= 10)
diff --git a/tests/expected/text/example34.json b/tests/expected/text/example34.json
new file mode 100644
index 0000000..0039003
--- /dev/null
+++ b/tests/expected/text/example34.json
@@ -0,0 +1,1 @@
+{"op":">=","args":[{"property":"value"},10.0]}
diff --git a/tests/expected/text/example34.txt b/tests/expected/text/example34.txt
new file mode 100644
index 0000000..c822d1b
--- /dev/null
+++ b/tests/expected/text/example34.txt
@@ -0,0 +1,1 @@
+("value" >= 10)
diff --git a/tests/expected/text/example35.json b/tests/expected/text/example35.json
new file mode 100644
index 0000000..3f84e73
--- /dev/null
+++ b/tests/expected/text/example35.json
@@ -0,0 +1,1 @@
+{"op":"like","args":[{"property":"name"},"foo%"]}
diff --git a/tests/expected/text/example35.txt b/tests/expected/text/example35.txt
new file mode 100644
index 0000000..ace7a16
--- /dev/null
+++ b/tests/expected/text/example35.txt
@@ -0,0 +1,1 @@
+like("name", 'foo%')
diff --git a/tests/expected/text/example36-alt01.json b/tests/expected/text/example36-alt01.json
new file mode 100644
index 0000000..d2fa835
--- /dev/null
+++ b/tests/expected/text/example36-alt01.json
@@ -0,0 +1,1 @@
+{"op":"not","args":[{"op":"like","args":[{"property":"name"},"foo%"]}]}
diff --git a/tests/expected/text/example36-alt01.txt b/tests/expected/text/example36-alt01.txt
new file mode 100644
index 0000000..2dc6954
--- /dev/null
+++ b/tests/expected/text/example36-alt01.txt
@@ -0,0 +1,1 @@
+(NOT like("name", 'foo%'))
diff --git a/tests/expected/text/example36.json b/tests/expected/text/example36.json
new file mode 100644
index 0000000..d2fa835
--- /dev/null
+++ b/tests/expected/text/example36.json
@@ -0,0 +1,1 @@
+{"op":"not","args":[{"op":"like","args":[{"property":"name"},"foo%"]}]}
diff --git a/tests/expected/text/example36.txt b/tests/expected/text/example36.txt
new file mode 100644
index 0000000..2dc6954
--- /dev/null
+++ b/tests/expected/text/example36.txt
@@ -0,0 +1,1 @@
+(NOT like("name", 'foo%'))
diff --git a/tests/expected/text/example37.json b/tests/expected/text/example37.json
new file mode 100644
index 0000000..2f6a943
--- /dev/null
+++ b/tests/expected/text/example37.json
@@ -0,0 +1,1 @@
+{"op":"between","args":[{"property":"value"},10.0,20.0]}
diff --git a/tests/expected/text/example37.txt b/tests/expected/text/example37.txt
new file mode 100644
index 0000000..3c7e2d9
--- /dev/null
+++ b/tests/expected/text/example37.txt
@@ -0,0 +1,1 @@
+("value" BETWEEN 10 AND 20)
diff --git a/tests/expected/text/example38-alt01.json b/tests/expected/text/example38-alt01.json
new file mode 100644
index 0000000..c7399bf
--- /dev/null
+++ b/tests/expected/text/example38-alt01.json
@@ -0,0 +1,1 @@
+{"op":"not","args":[{"op":"between","args":[{"property":"value"},10.0,20.0]}]}
diff --git a/tests/expected/text/example38-alt01.txt b/tests/expected/text/example38-alt01.txt
new file mode 100644
index 0000000..ea5ce7d
--- /dev/null
+++ b/tests/expected/text/example38-alt01.txt
@@ -0,0 +1,1 @@
+(NOT ("value" BETWEEN 10 AND 20))
diff --git a/tests/expected/text/example38.json b/tests/expected/text/example38.json
new file mode 100644
index 0000000..c7399bf
--- /dev/null
+++ b/tests/expected/text/example38.json
@@ -0,0 +1,1 @@
+{"op":"not","args":[{"op":"between","args":[{"property":"value"},10.0,20.0]}]}
diff --git a/tests/expected/text/example38.txt b/tests/expected/text/example38.txt
new file mode 100644
index 0000000..ea5ce7d
--- /dev/null
+++ b/tests/expected/text/example38.txt
@@ -0,0 +1,1 @@
+(NOT ("value" BETWEEN 10 AND 20))
diff --git a/tests/expected/text/example39.json b/tests/expected/text/example39.json
new file mode 100644
index 0000000..2ae873d
--- /dev/null
+++ b/tests/expected/text/example39.json
@@ -0,0 +1,1 @@
+{"op":"in","args":[{"property":"value"},[1.0,2.0,3.0]]}
diff --git a/tests/expected/text/example39.txt b/tests/expected/text/example39.txt
new file mode 100644
index 0000000..a5e9ecd
--- /dev/null
+++ b/tests/expected/text/example39.txt
@@ -0,0 +1,1 @@
+in("value", (1, 2, 3))
diff --git a/tests/expected/text/example40-alt01.json b/tests/expected/text/example40-alt01.json
new file mode 100644
index 0000000..6332a99
--- /dev/null
+++ b/tests/expected/text/example40-alt01.json
@@ -0,0 +1,1 @@
+{"op":"not","args":[{"op":"in","args":[{"property":"value"},["a","b","c"]]}]}
diff --git a/tests/expected/text/example40-alt01.txt b/tests/expected/text/example40-alt01.txt
new file mode 100644
index 0000000..9f12f73
--- /dev/null
+++ b/tests/expected/text/example40-alt01.txt
@@ -0,0 +1,1 @@
+(NOT in("value", ('a', 'b', 'c')))
diff --git a/tests/expected/text/example40.json b/tests/expected/text/example40.json
new file mode 100644
index 0000000..6332a99
--- /dev/null
+++ b/tests/expected/text/example40.json
@@ -0,0 +1,1 @@
+{"op":"not","args":[{"op":"in","args":[{"property":"value"},["a","b","c"]]}]}
diff --git a/tests/expected/text/example40.txt b/tests/expected/text/example40.txt
new file mode 100644
index 0000000..9f12f73
--- /dev/null
+++ b/tests/expected/text/example40.txt
@@ -0,0 +1,1 @@
+(NOT in("value", ('a', 'b', 'c')))
diff --git a/tests/expected/text/example41.json b/tests/expected/text/example41.json
new file mode 100644
index 0000000..565934d
--- /dev/null
+++ b/tests/expected/text/example41.json
@@ -0,0 +1,1 @@
+{"op":"isNull","args":[{"property":"value"}]}
diff --git a/tests/expected/text/example41.txt b/tests/expected/text/example41.txt
new file mode 100644
index 0000000..31a61df
--- /dev/null
+++ b/tests/expected/text/example41.txt
@@ -0,0 +1,1 @@
+isNull("value")
diff --git a/tests/expected/text/example42-alt01.json b/tests/expected/text/example42-alt01.json
new file mode 100644
index 0000000..565934d
--- /dev/null
+++ b/tests/expected/text/example42-alt01.json
@@ -0,0 +1,1 @@
+{"op":"isNull","args":[{"property":"value"}]}
diff --git a/tests/expected/text/example42-alt01.txt b/tests/expected/text/example42-alt01.txt
new file mode 100644
index 0000000..31a61df
--- /dev/null
+++ b/tests/expected/text/example42-alt01.txt
@@ -0,0 +1,1 @@
+isNull("value")
diff --git a/tests/expected/text/example42.json b/tests/expected/text/example42.json
new file mode 100644
index 0000000..aeb39ba
--- /dev/null
+++ b/tests/expected/text/example42.json
@@ -0,0 +1,1 @@
+{"op":"not","args":[{"op":"isNull","args":[{"property":"value"}]}]}
diff --git a/tests/expected/text/example42.txt b/tests/expected/text/example42.txt
new file mode 100644
index 0000000..a8e0524
--- /dev/null
+++ b/tests/expected/text/example42.txt
@@ -0,0 +1,1 @@
+(NOT isNull("value"))
diff --git a/tests/expected/text/example43-alt01.json b/tests/expected/text/example43-alt01.json
new file mode 100644
index 0000000..8fcc319
--- /dev/null
+++ b/tests/expected/text/example43-alt01.json
@@ -0,0 +1,1 @@
+{"op":"and","args":[{"op":"not","args":[{"op":"like","args":[{"property":"name"},"foo%"]}]},{"op":">","args":[{"property":"value"},10.0]}]}
diff --git a/tests/expected/text/example43-alt01.txt b/tests/expected/text/example43-alt01.txt
new file mode 100644
index 0000000..2ca4815
--- /dev/null
+++ b/tests/expected/text/example43-alt01.txt
@@ -0,0 +1,1 @@
+((NOT like("name", 'foo%')) AND ("value" > 10))
diff --git a/tests/expected/text/example43.json b/tests/expected/text/example43.json
new file mode 100644
index 0000000..8fcc319
--- /dev/null
+++ b/tests/expected/text/example43.json
@@ -0,0 +1,1 @@
+{"op":"and","args":[{"op":"not","args":[{"op":"like","args":[{"property":"name"},"foo%"]}]},{"op":">","args":[{"property":"value"},10.0]}]}
diff --git a/tests/expected/text/example43.txt b/tests/expected/text/example43.txt
new file mode 100644
index 0000000..2ca4815
--- /dev/null
+++ b/tests/expected/text/example43.txt
@@ -0,0 +1,1 @@
+((NOT like("name", 'foo%')) AND ("value" > 10))
diff --git a/tests/expected/text/example44-alt01.json b/tests/expected/text/example44-alt01.json
new file mode 100644
index 0000000..37bc6b3
--- /dev/null
+++ b/tests/expected/text/example44-alt01.json
@@ -0,0 +1,1 @@
+{"op":"or","args":[{"op":"isNull","args":[{"property":"value"}]},{"op":"between","args":[{"property":"value"},10.0,20.0]}]}
diff --git a/tests/expected/text/example44-alt01.txt b/tests/expected/text/example44-alt01.txt
new file mode 100644
index 0000000..e6a1ef6
--- /dev/null
+++ b/tests/expected/text/example44-alt01.txt
@@ -0,0 +1,1 @@
+(isNull("value") OR ("value" BETWEEN 10 AND 20))
diff --git a/tests/expected/text/example44.json b/tests/expected/text/example44.json
new file mode 100644
index 0000000..37bc6b3
--- /dev/null
+++ b/tests/expected/text/example44.json
@@ -0,0 +1,1 @@
+{"op":"or","args":[{"op":"isNull","args":[{"property":"value"}]},{"op":"between","args":[{"property":"value"},10.0,20.0]}]}
diff --git a/tests/expected/text/example44.txt b/tests/expected/text/example44.txt
new file mode 100644
index 0000000..e6a1ef6
--- /dev/null
+++ b/tests/expected/text/example44.txt
@@ -0,0 +1,1 @@
+(isNull("value") OR ("value" BETWEEN 10 AND 20))
diff --git a/tests/expected/text/example45.json b/tests/expected/text/example45.json
new file mode 100644
index 0000000..412a747
--- /dev/null
+++ b/tests/expected/text/example45.json
@@ -0,0 +1,1 @@
+{"op":"s_intersects","args":[{"property":"geometry"},{"op":"bbox","args":[{"op":"*","args":[-1.0,128.098193]},{"op":"*","args":[-1.0,1.1]},{"op":"*","args":[-1.0,99999.0]},180.0,90.0,100000.0]}]}
diff --git a/tests/expected/text/example45.txt b/tests/expected/text/example45.txt
new file mode 100644
index 0000000..78253eb
--- /dev/null
+++ b/tests/expected/text/example45.txt
@@ -0,0 +1,1 @@
+s_intersects("geometry", bbox((-1 * 128.098193), (-1 * 1.1), (-1 * 99999), 180, 90, 100000))
diff --git a/tests/expected/text/example46-alt01.json b/tests/expected/text/example46-alt01.json
new file mode 100644
index 0000000..f887385
--- /dev/null
+++ b/tests/expected/text/example46-alt01.json
@@ -0,0 +1,1 @@
+{"op":"s_equals","args":[{"type":"Polygon","coordinates":[[[-0.333333,89],[-102.723546,-0.5],[-179,-89],[-1.9,89],[-0.0,89],[2.00001,-1.9],[-0.333333,89]]]},{"property":"geometry"}]}
diff --git a/tests/expected/text/example46-alt01.txt b/tests/expected/text/example46-alt01.txt
new file mode 100644
index 0000000..bb9567f
--- /dev/null
+++ b/tests/expected/text/example46-alt01.txt
@@ -0,0 +1,1 @@
+s_equals(POLYGON((-0.333333 89,-102.723546 -0.5,-179 -89,-1.9 89,-0 89,2.00001 -1.9,-0.333333 89)), "geometry")
diff --git a/tests/expected/text/example46.json b/tests/expected/text/example46.json
new file mode 100644
index 0000000..f887385
--- /dev/null
+++ b/tests/expected/text/example46.json
@@ -0,0 +1,1 @@
+{"op":"s_equals","args":[{"type":"Polygon","coordinates":[[[-0.333333,89],[-102.723546,-0.5],[-179,-89],[-1.9,89],[-0.0,89],[2.00001,-1.9],[-0.333333,89]]]},{"property":"geometry"}]}
diff --git a/tests/expected/text/example46.txt b/tests/expected/text/example46.txt
new file mode 100644
index 0000000..bb9567f
--- /dev/null
+++ b/tests/expected/text/example46.txt
@@ -0,0 +1,1 @@
+s_equals(POLYGON((-0.333333 89,-102.723546 -0.5,-179 -89,-1.9 89,-0 89,2.00001 -1.9,-0.333333 89)), "geometry")
diff --git a/tests/expected/text/example47.json b/tests/expected/text/example47.json
new file mode 100644
index 0000000..6937f7a
--- /dev/null
+++ b/tests/expected/text/example47.json
@@ -0,0 +1,1 @@
+{"op":"s_disjoint","args":[{"property":"geometry"},{"type":"MultiPolygon","coordinates":[[[[144.022387,45.176126],[-1.1,0],[180,47.808086],[144.022387,45.176126]]]]}]}
diff --git a/tests/expected/text/example47.txt b/tests/expected/text/example47.txt
new file mode 100644
index 0000000..0f33e66
--- /dev/null
+++ b/tests/expected/text/example47.txt
@@ -0,0 +1,1 @@
+s_disjoint("geometry", MULTIPOLYGON(((144.022387 45.176126,-1.1 0,180 47.808086,144.022387 45.176126))))
diff --git a/tests/expected/text/example48.json b/tests/expected/text/example48.json
new file mode 100644
index 0000000..a0be44d
--- /dev/null
+++ b/tests/expected/text/example48.json
@@ -0,0 +1,1 @@
+{"op":"s_touches","args":[{"property":"geometry"},{"type":"MultiLineString","coordinates":[[[-1.9,-0.99999],[75.292574,1.5],[-0.5,-4.016458],[-31.708594,-74.743801],[179,-90]],[[-1.9,-1.1],[1.5,8.547371]]]}]}
diff --git a/tests/expected/text/example48.txt b/tests/expected/text/example48.txt
new file mode 100644
index 0000000..70b9299
--- /dev/null
+++ b/tests/expected/text/example48.txt
@@ -0,0 +1,1 @@
+s_touches("geometry", MULTILINESTRING((-1.9 -0.99999,75.292574 1.5,-0.5 -4.016458,-31.708594 -74.743801,179 -90),(-1.9 -1.1,1.5 8.547371)))
diff --git a/tests/expected/text/example49-alt01.json b/tests/expected/text/example49-alt01.json
new file mode 100644
index 0000000..347a400
--- /dev/null
+++ b/tests/expected/text/example49-alt01.json
@@ -0,0 +1,1 @@
+{"op":"s_within","args":[{"type":"Polygon","coordinates":[[[-49.88024,0.5],[-1.5,-0.99999],[0,0.5],[-49.88024,0.5]],[[-65.887123,2.00001],[0.333333,-53.017711],[180,0],[-65.887123,2.00001]]]},{"property":"geometry"}]}
diff --git a/tests/expected/text/example49-alt01.txt b/tests/expected/text/example49-alt01.txt
new file mode 100644
index 0000000..566c287
--- /dev/null
+++ b/tests/expected/text/example49-alt01.txt
@@ -0,0 +1,1 @@
+s_within(POLYGON((-49.88024 0.5,-1.5 -0.99999,0 0.5,-49.88024 0.5),(-65.887123 2.00001,0.333333 -53.017711,180 0,-65.887123 2.00001)), "geometry")
diff --git a/tests/expected/text/example49.json b/tests/expected/text/example49.json
new file mode 100644
index 0000000..347a400
--- /dev/null
+++ b/tests/expected/text/example49.json
@@ -0,0 +1,1 @@
+{"op":"s_within","args":[{"type":"Polygon","coordinates":[[[-49.88024,0.5],[-1.5,-0.99999],[0,0.5],[-49.88024,0.5]],[[-65.887123,2.00001],[0.333333,-53.017711],[180,0],[-65.887123,2.00001]]]},{"property":"geometry"}]}
diff --git a/tests/expected/text/example49.txt b/tests/expected/text/example49.txt
new file mode 100644
index 0000000..566c287
--- /dev/null
+++ b/tests/expected/text/example49.txt
@@ -0,0 +1,1 @@
+s_within(POLYGON((-49.88024 0.5,-1.5 -0.99999,0 0.5,-49.88024 0.5),(-65.887123 2.00001,0.333333 -53.017711,180 0,-65.887123 2.00001)), "geometry")
diff --git a/tests/expected/text/example50.json b/tests/expected/text/example50.json
new file mode 100644
index 0000000..d854b94
--- /dev/null
+++ b/tests/expected/text/example50.json
@@ -0,0 +1,1 @@
+{"op":"s_overlaps","args":[{"property":"geometry"},{"op":"bbox","args":[{"op":"*","args":[-1.0,179.912109]},1.9,180.0,16.897016]}]}
diff --git a/tests/expected/text/example50.txt b/tests/expected/text/example50.txt
new file mode 100644
index 0000000..b708743
--- /dev/null
+++ b/tests/expected/text/example50.txt
@@ -0,0 +1,1 @@
+s_overlaps("geometry", bbox((-1 * 179.912109), 1.9, 180, 16.897016))
diff --git a/tests/expected/text/example51.json b/tests/expected/text/example51.json
new file mode 100644
index 0000000..5c66f70
--- /dev/null
+++ b/tests/expected/text/example51.json
@@ -0,0 +1,1 @@
+{"op":"s_crosses","args":[{"property":"geometry"},{"type":"LineString","coordinates":[[172.03086,1.5],[1.1,-90],[-159.757695,0.99999],[-180,0.5],[-12.111235,81.336403],[-0.5,64.43958],[0,81.991815],[-155.93831,90]]}]}
diff --git a/tests/expected/text/example51.txt b/tests/expected/text/example51.txt
new file mode 100644
index 0000000..43f9619
--- /dev/null
+++ b/tests/expected/text/example51.txt
@@ -0,0 +1,1 @@
+s_crosses("geometry", LINESTRING(172.03086 1.5,1.1 -90,-159.757695 0.99999,-180 0.5,-12.111235 81.336403,-0.5 64.43958,0 81.991815,-155.93831 90))
diff --git a/tests/expected/text/example52.json b/tests/expected/text/example52.json
new file mode 100644
index 0000000..45e115d
--- /dev/null
+++ b/tests/expected/text/example52.json
@@ -0,0 +1,1 @@
+{"op":"s_contains","args":[{"property":"geometry"},{"type":"Point","coordinates":[-3.508362,-1.754181]}]}
diff --git a/tests/expected/text/example52.txt b/tests/expected/text/example52.txt
new file mode 100644
index 0000000..d970c3f
--- /dev/null
+++ b/tests/expected/text/example52.txt
@@ -0,0 +1,1 @@
+s_contains("geometry", POINT(-3.508362 -1.754181))
diff --git a/tests/expected/text/example53.json b/tests/expected/text/example53.json
new file mode 100644
index 0000000..d80d04b
--- /dev/null
+++ b/tests/expected/text/example53.json
@@ -0,0 +1,1 @@
+{"op":"t_after","args":[{"property":"updated_at"},{"date":"2010-02-10"}]}
diff --git a/tests/expected/text/example53.txt b/tests/expected/text/example53.txt
new file mode 100644
index 0000000..d6a5f63
--- /dev/null
+++ b/tests/expected/text/example53.txt
@@ -0,0 +1,1 @@
+t_after("updated_at", DATE('2010-02-10'))
diff --git a/tests/expected/text/example54-alt01.json b/tests/expected/text/example54-alt01.json
new file mode 100644
index 0000000..236abaf
--- /dev/null
+++ b/tests/expected/text/example54-alt01.json
@@ -0,0 +1,1 @@
+{"op":"t_before","args":[{"property":"updated_at"},{"timestamp":"2012-08-10T05:30:00Z"}]}
diff --git a/tests/expected/text/example54-alt01.txt b/tests/expected/text/example54-alt01.txt
new file mode 100644
index 0000000..68b5d2f
--- /dev/null
+++ b/tests/expected/text/example54-alt01.txt
@@ -0,0 +1,1 @@
+t_before("updated_at", TIMESTAMP('2012-08-10T05:30:00Z'))
diff --git a/tests/expected/text/example54.json b/tests/expected/text/example54.json
new file mode 100644
index 0000000..46ff37b
--- /dev/null
+++ b/tests/expected/text/example54.json
@@ -0,0 +1,1 @@
+{"op":"t_before","args":[{"property":"updated_at"},{"timestamp":"2012-08-10T05:30:00.000000Z"}]}
diff --git a/tests/expected/text/example54.txt b/tests/expected/text/example54.txt
new file mode 100644
index 0000000..06d9402
--- /dev/null
+++ b/tests/expected/text/example54.txt
@@ -0,0 +1,1 @@
+t_before("updated_at", TIMESTAMP('2012-08-10T05:30:00.000000Z'))
diff --git a/tests/expected/text/example55-alt01.json b/tests/expected/text/example55-alt01.json
new file mode 100644
index 0000000..66c10b7
--- /dev/null
+++ b/tests/expected/text/example55-alt01.json
@@ -0,0 +1,1 @@
+{"op":"t_contains","args":[{"interval":["2000-01-01T00:00:00Z","2005-01-10T01:01:01.393216Z"]},{"interval":[{"property":"starts_at"},{"property":"ends_at"}]}]}
diff --git a/tests/expected/text/example55-alt01.txt b/tests/expected/text/example55-alt01.txt
new file mode 100644
index 0000000..0d38bb8
--- /dev/null
+++ b/tests/expected/text/example55-alt01.txt
@@ -0,0 +1,1 @@
+t_contains(INTERVAL('2000-01-01T00:00:00Z','2005-01-10T01:01:01.393216Z'), INTERVAL("starts_at","ends_at"))
diff --git a/tests/expected/text/example55.json b/tests/expected/text/example55.json
new file mode 100644
index 0000000..50fe3d9
--- /dev/null
+++ b/tests/expected/text/example55.json
@@ -0,0 +1,1 @@
+{"op":"t_contains","args":[{"interval":["2000-01-01T00:00:00.000000Z","2005-01-10T01:01:01.393216Z"]},{"interval":[{"property":"starts_at"},{"property":"ends_at"}]}]}
diff --git a/tests/expected/text/example55.txt b/tests/expected/text/example55.txt
new file mode 100644
index 0000000..88ae33f
--- /dev/null
+++ b/tests/expected/text/example55.txt
@@ -0,0 +1,1 @@
+t_contains(INTERVAL('2000-01-01T00:00:00.000000Z','2005-01-10T01:01:01.393216Z'), INTERVAL("starts_at","ends_at"))
diff --git a/tests/expected/text/example56.json b/tests/expected/text/example56.json
new file mode 100644
index 0000000..faf8fe7
--- /dev/null
+++ b/tests/expected/text/example56.json
@@ -0,0 +1,1 @@
+{"op":"t_disjoint","args":[{"interval":["..","2005-01-10T01:01:01.393216Z"]},{"interval":[{"property":"starts_at"},{"property":"ends_at"}]}]}
diff --git a/tests/expected/text/example56.txt b/tests/expected/text/example56.txt
new file mode 100644
index 0000000..3e8e4f4
--- /dev/null
+++ b/tests/expected/text/example56.txt
@@ -0,0 +1,1 @@
+t_disjoint(INTERVAL('..','2005-01-10T01:01:01.393216Z'), INTERVAL("starts_at","ends_at"))
diff --git a/tests/expected/text/example57.json b/tests/expected/text/example57.json
new file mode 100644
index 0000000..4d96d5a
--- /dev/null
+++ b/tests/expected/text/example57.json
@@ -0,0 +1,1 @@
+{"op":"t_during","args":[{"interval":[{"property":"starts_at"},{"property":"ends_at"}]},{"interval":["2005-01-10","2010-02-10"]}]}
diff --git a/tests/expected/text/example57.txt b/tests/expected/text/example57.txt
new file mode 100644
index 0000000..3ece6c7
--- /dev/null
+++ b/tests/expected/text/example57.txt
@@ -0,0 +1,1 @@
+t_during(INTERVAL("starts_at","ends_at"), INTERVAL('2005-01-10','2010-02-10'))
diff --git a/tests/expected/text/example58.json b/tests/expected/text/example58.json
new file mode 100644
index 0000000..5c28290
--- /dev/null
+++ b/tests/expected/text/example58.json
@@ -0,0 +1,1 @@
+{"op":"t_equals","args":[{"property":"updated_at"},{"date":"1851-04-29"}]}
diff --git a/tests/expected/text/example58.txt b/tests/expected/text/example58.txt
new file mode 100644
index 0000000..eca6a7f
--- /dev/null
+++ b/tests/expected/text/example58.txt
@@ -0,0 +1,1 @@
+t_equals("updated_at", DATE('1851-04-29'))
diff --git a/tests/expected/text/example59.json b/tests/expected/text/example59.json
new file mode 100644
index 0000000..8a938b8
--- /dev/null
+++ b/tests/expected/text/example59.json
@@ -0,0 +1,1 @@
+{"op":"t_finishedby","args":[{"interval":[{"property":"starts_at"},{"property":"ends_at"}]},{"interval":["1991-10-07T08:21:06.393262Z","2010-02-10T05:29:20.073225Z"]}]}
diff --git a/tests/expected/text/example59.txt b/tests/expected/text/example59.txt
new file mode 100644
index 0000000..0cd8a05
--- /dev/null
+++ b/tests/expected/text/example59.txt
@@ -0,0 +1,1 @@
+t_finishedby(INTERVAL("starts_at","ends_at"), INTERVAL('1991-10-07T08:21:06.393262Z','2010-02-10T05:29:20.073225Z'))
diff --git a/tests/expected/text/example60.json b/tests/expected/text/example60.json
new file mode 100644
index 0000000..b4baaad
--- /dev/null
+++ b/tests/expected/text/example60.json
@@ -0,0 +1,1 @@
+{"op":"t_finishes","args":[{"interval":[{"property":"starts_at"},{"property":"ends_at"}]},{"interval":["1991-10-07","2010-02-10T05:29:20.073225Z"]}]}
diff --git a/tests/expected/text/example60.txt b/tests/expected/text/example60.txt
new file mode 100644
index 0000000..1623e78
--- /dev/null
+++ b/tests/expected/text/example60.txt
@@ -0,0 +1,1 @@
+t_finishes(INTERVAL("starts_at","ends_at"), INTERVAL('1991-10-07','2010-02-10T05:29:20.073225Z'))
diff --git a/tests/expected/text/example61.json b/tests/expected/text/example61.json
new file mode 100644
index 0000000..0bc2a8f
--- /dev/null
+++ b/tests/expected/text/example61.json
@@ -0,0 +1,1 @@
+{"op":"t_intersects","args":[{"interval":[{"property":"starts_at"},{"property":"ends_at"}]},{"interval":["1991-10-07T08:21:06.393262Z","2010-02-10T05:29:20.073225Z"]}]}
diff --git a/tests/expected/text/example61.txt b/tests/expected/text/example61.txt
new file mode 100644
index 0000000..3991a60
--- /dev/null
+++ b/tests/expected/text/example61.txt
@@ -0,0 +1,1 @@
+t_intersects(INTERVAL("starts_at","ends_at"), INTERVAL('1991-10-07T08:21:06.393262Z','2010-02-10T05:29:20.073225Z'))
diff --git a/tests/expected/text/example62.json b/tests/expected/text/example62.json
new file mode 100644
index 0000000..b97c114
--- /dev/null
+++ b/tests/expected/text/example62.json
@@ -0,0 +1,1 @@
+{"op":"t_meets","args":[{"interval":["2005-01-10","2010-02-10"]},{"interval":[{"property":"starts_at"},{"property":"ends_at"}]}]}
diff --git a/tests/expected/text/example62.txt b/tests/expected/text/example62.txt
new file mode 100644
index 0000000..09c0680
--- /dev/null
+++ b/tests/expected/text/example62.txt
@@ -0,0 +1,1 @@
+t_meets(INTERVAL('2005-01-10','2010-02-10'), INTERVAL("starts_at","ends_at"))
diff --git a/tests/expected/text/example63.json b/tests/expected/text/example63.json
new file mode 100644
index 0000000..8c963f4
--- /dev/null
+++ b/tests/expected/text/example63.json
@@ -0,0 +1,1 @@
+{"op":"t_metby","args":[{"interval":["2010-02-10T05:29:20.073225Z","2010-10-07"]},{"interval":[{"property":"starts_at"},{"property":"ends_at"}]}]}
diff --git a/tests/expected/text/example63.txt b/tests/expected/text/example63.txt
new file mode 100644
index 0000000..b31542d
--- /dev/null
+++ b/tests/expected/text/example63.txt
@@ -0,0 +1,1 @@
+t_metby(INTERVAL('2010-02-10T05:29:20.073225Z','2010-10-07'), INTERVAL("starts_at","ends_at"))
diff --git a/tests/expected/text/example64.json b/tests/expected/text/example64.json
new file mode 100644
index 0000000..00df7c5
--- /dev/null
+++ b/tests/expected/text/example64.json
@@ -0,0 +1,1 @@
+{"op":"t_overlappedby","args":[{"interval":["1991-10-07T08:21:06.393262Z","2010-02-10T05:29:20.073225Z"]},{"interval":[{"property":"starts_at"},{"property":"ends_at"}]}]}
diff --git a/tests/expected/text/example64.txt b/tests/expected/text/example64.txt
new file mode 100644
index 0000000..c9b9e72
--- /dev/null
+++ b/tests/expected/text/example64.txt
@@ -0,0 +1,1 @@
+t_overlappedby(INTERVAL('1991-10-07T08:21:06.393262Z','2010-02-10T05:29:20.073225Z'), INTERVAL("starts_at","ends_at"))
diff --git a/tests/expected/text/example65.json b/tests/expected/text/example65.json
new file mode 100644
index 0000000..4d90a9b
--- /dev/null
+++ b/tests/expected/text/example65.json
@@ -0,0 +1,1 @@
+{"op":"t_overlaps","args":[{"interval":[{"property":"starts_at"},{"property":"ends_at"}]},{"interval":["1991-10-07T08:21:06.393262Z","1992-10-09T08:08:08.393473Z"]}]}
diff --git a/tests/expected/text/example65.txt b/tests/expected/text/example65.txt
new file mode 100644
index 0000000..9555c86
--- /dev/null
+++ b/tests/expected/text/example65.txt
@@ -0,0 +1,1 @@
+t_overlaps(INTERVAL("starts_at","ends_at"), INTERVAL('1991-10-07T08:21:06.393262Z','1992-10-09T08:08:08.393473Z'))
diff --git a/tests/expected/text/example66.json b/tests/expected/text/example66.json
new file mode 100644
index 0000000..21b0675
--- /dev/null
+++ b/tests/expected/text/example66.json
@@ -0,0 +1,1 @@
+{"op":"t_startedby","args":[{"interval":["1991-10-07T08:21:06.393262Z","2010-02-10T05:29:20.073225Z"]},{"interval":[{"property":"starts_at"},{"property":"ends_at"}]}]}
diff --git a/tests/expected/text/example66.txt b/tests/expected/text/example66.txt
new file mode 100644
index 0000000..8cb017e
--- /dev/null
+++ b/tests/expected/text/example66.txt
@@ -0,0 +1,1 @@
+t_startedby(INTERVAL('1991-10-07T08:21:06.393262Z','2010-02-10T05:29:20.073225Z'), INTERVAL("starts_at","ends_at"))
diff --git a/tests/expected/text/example67.json b/tests/expected/text/example67.json
new file mode 100644
index 0000000..7087df4
--- /dev/null
+++ b/tests/expected/text/example67.json
@@ -0,0 +1,1 @@
+{"op":"t_starts","args":[{"interval":[{"property":"starts_at"},{"property":"ends_at"}]},{"interval":["1991-10-07T08:21:06.393262Z",".."]}]}
diff --git a/tests/expected/text/example67.txt b/tests/expected/text/example67.txt
new file mode 100644
index 0000000..d1686e8
--- /dev/null
+++ b/tests/expected/text/example67.txt
@@ -0,0 +1,1 @@
+t_starts(INTERVAL("starts_at","ends_at"), INTERVAL('1991-10-07T08:21:06.393262Z','..'))
diff --git a/tests/expected/text/example68.json b/tests/expected/text/example68.json
new file mode 100644
index 0000000..ef7d2fd
--- /dev/null
+++ b/tests/expected/text/example68.json
@@ -0,0 +1,1 @@
+{"op":"=","args":[{"op":"foo","args":[{"property":"geometry"}]},true]}
diff --git a/tests/expected/text/example68.txt b/tests/expected/text/example68.txt
new file mode 100644
index 0000000..cb0f9cb
--- /dev/null
+++ b/tests/expected/text/example68.txt
@@ -0,0 +1,1 @@
+(foo("geometry") = true)
diff --git a/tests/expected/text/example69.json b/tests/expected/text/example69.json
new file mode 100644
index 0000000..3811dc5
--- /dev/null
+++ b/tests/expected/text/example69.json
@@ -0,0 +1,1 @@
+{"op":"<>","args":[false,{"op":"bar","args":[{"property":"geometry"},100.0,"a","b",false]}]}
diff --git a/tests/expected/text/example69.txt b/tests/expected/text/example69.txt
new file mode 100644
index 0000000..f5d005d
--- /dev/null
+++ b/tests/expected/text/example69.txt
@@ -0,0 +1,1 @@
+(false <> bar("geometry", 100, 'a', 'b', false))
diff --git a/tests/expected/text/example70.json b/tests/expected/text/example70.json
new file mode 100644
index 0000000..4a98289
--- /dev/null
+++ b/tests/expected/text/example70.json
@@ -0,0 +1,1 @@
+{"op":"=","args":[{"op":"accenti","args":[{"property":"owner"}]},{"op":"accenti","args":["Beyoncé"]}]}
diff --git a/tests/expected/text/example70.txt b/tests/expected/text/example70.txt
new file mode 100644
index 0000000..814053a
--- /dev/null
+++ b/tests/expected/text/example70.txt
@@ -0,0 +1,1 @@
+(accenti("owner") = accenti('Beyoncé'))
diff --git a/tests/expected/text/example71.json b/tests/expected/text/example71.json
new file mode 100644
index 0000000..9dc0968
--- /dev/null
+++ b/tests/expected/text/example71.json
@@ -0,0 +1,1 @@
+{"op":"=","args":[{"op":"casei","args":[{"property":"owner"}]},{"op":"casei","args":["somebody else"]}]}
diff --git a/tests/expected/text/example71.txt b/tests/expected/text/example71.txt
new file mode 100644
index 0000000..86fa908
--- /dev/null
+++ b/tests/expected/text/example71.txt
@@ -0,0 +1,1 @@
+(casei("owner") = casei('somebody else'))
diff --git a/tests/expected/text/example72.json b/tests/expected/text/example72.json
new file mode 100644
index 0000000..a881422
--- /dev/null
+++ b/tests/expected/text/example72.json
@@ -0,0 +1,1 @@
+{"op":">","args":[{"property":"value"},{"op":"+","args":[{"property":"foo"},10.0]}]}
diff --git a/tests/expected/text/example72.txt b/tests/expected/text/example72.txt
new file mode 100644
index 0000000..645c50e
--- /dev/null
+++ b/tests/expected/text/example72.txt
@@ -0,0 +1,1 @@
+("value" > ("foo" + 10))
diff --git a/tests/expected/text/example73.json b/tests/expected/text/example73.json
new file mode 100644
index 0000000..adc0291
--- /dev/null
+++ b/tests/expected/text/example73.json
@@ -0,0 +1,1 @@
+{"op":"<","args":[{"property":"value"},{"op":"-","args":[{"property":"foo"},10.0]}]}
diff --git a/tests/expected/text/example73.txt b/tests/expected/text/example73.txt
new file mode 100644
index 0000000..5ebc664
--- /dev/null
+++ b/tests/expected/text/example73.txt
@@ -0,0 +1,1 @@
+("value" < ("foo" - 10))
diff --git a/tests/expected/text/example74.json b/tests/expected/text/example74.json
new file mode 100644
index 0000000..e6d0daf
--- /dev/null
+++ b/tests/expected/text/example74.json
@@ -0,0 +1,1 @@
+{"op":"<>","args":[{"property":"value"},{"op":"*","args":[22.1,{"property":"foo"}]}]}
diff --git a/tests/expected/text/example74.txt b/tests/expected/text/example74.txt
new file mode 100644
index 0000000..a13f3c6
--- /dev/null
+++ b/tests/expected/text/example74.txt
@@ -0,0 +1,1 @@
+("value" <> (22.1 * "foo"))
diff --git a/tests/expected/text/example75.json b/tests/expected/text/example75.json
new file mode 100644
index 0000000..b0ccbc8
--- /dev/null
+++ b/tests/expected/text/example75.json
@@ -0,0 +1,1 @@
+{"op":"=","args":[{"property":"value"},{"op":"/","args":[2.0,{"property":"foo"}]}]}
diff --git a/tests/expected/text/example75.txt b/tests/expected/text/example75.txt
new file mode 100644
index 0000000..63b6f5c
--- /dev/null
+++ b/tests/expected/text/example75.txt
@@ -0,0 +1,1 @@
+("value" = (2 / "foo"))
diff --git a/tests/expected/text/example76.json b/tests/expected/text/example76.json
new file mode 100644
index 0000000..4f93e58
--- /dev/null
+++ b/tests/expected/text/example76.json
@@ -0,0 +1,1 @@
+{"op":"<=","args":[{"property":"value"},{"op":"^","args":[2.0,{"property":"foo"}]}]}
diff --git a/tests/expected/text/example76.txt b/tests/expected/text/example76.txt
new file mode 100644
index 0000000..7bb0e19
--- /dev/null
+++ b/tests/expected/text/example76.txt
@@ -0,0 +1,1 @@
+("value" <= (2 ^ "foo"))
diff --git a/tests/expected/text/example77.json b/tests/expected/text/example77.json
new file mode 100644
index 0000000..1af0d17
--- /dev/null
+++ b/tests/expected/text/example77.json
@@ -0,0 +1,1 @@
+{"op":"=","args":[0.0,{"op":"%","args":[{"property":"foo"},2.0]}]}
diff --git a/tests/expected/text/example77.txt b/tests/expected/text/example77.txt
new file mode 100644
index 0000000..65652b2
--- /dev/null
+++ b/tests/expected/text/example77.txt
@@ -0,0 +1,1 @@
+(0 = ("foo" % 2))
diff --git a/tests/expected/text/example78.json b/tests/expected/text/example78.json
new file mode 100644
index 0000000..844db58
--- /dev/null
+++ b/tests/expected/text/example78.json
@@ -0,0 +1,1 @@
+{"op":"=","args":[1.0,{"op":"div","args":[{"property":"foo"},2.0]}]}
diff --git a/tests/expected/text/example78.txt b/tests/expected/text/example78.txt
new file mode 100644
index 0000000..35cb1e9
--- /dev/null
+++ b/tests/expected/text/example78.txt
@@ -0,0 +1,1 @@
+(1 = div("foo", 2))
diff --git a/tests/expected/text/example79.json b/tests/expected/text/example79.json
new file mode 100644
index 0000000..2856b6c
--- /dev/null
+++ b/tests/expected/text/example79.json
@@ -0,0 +1,1 @@
+{"op":"a_containedby","args":[{"property":"values"},["a","b","c"]]}
diff --git a/tests/expected/text/example79.txt b/tests/expected/text/example79.txt
new file mode 100644
index 0000000..cd0d2c9
--- /dev/null
+++ b/tests/expected/text/example79.txt
@@ -0,0 +1,1 @@
+a_containedby("values", ('a', 'b', 'c'))
diff --git a/tests/expected/text/example80.json b/tests/expected/text/example80.json
new file mode 100644
index 0000000..92709df
--- /dev/null
+++ b/tests/expected/text/example80.json
@@ -0,0 +1,1 @@
+{"op":"a_contains","args":[{"property":"values"},["a","b","c"]]}
diff --git a/tests/expected/text/example80.txt b/tests/expected/text/example80.txt
new file mode 100644
index 0000000..499551b
--- /dev/null
+++ b/tests/expected/text/example80.txt
@@ -0,0 +1,1 @@
+a_contains("values", ('a', 'b', 'c'))
diff --git a/tests/expected/text/example81.json b/tests/expected/text/example81.json
new file mode 100644
index 0000000..e92d98c
--- /dev/null
+++ b/tests/expected/text/example81.json
@@ -0,0 +1,1 @@
+{"op":"a_equals","args":[["a",true,1.0,8.0],{"property":"values"}]}
diff --git a/tests/expected/text/example81.txt b/tests/expected/text/example81.txt
new file mode 100644
index 0000000..0183818
--- /dev/null
+++ b/tests/expected/text/example81.txt
@@ -0,0 +1,1 @@
+a_equals(('a', true, 1, 8), "values")
diff --git a/tests/expected/text/example82.json b/tests/expected/text/example82.json
new file mode 100644
index 0000000..78689ce
--- /dev/null
+++ b/tests/expected/text/example82.json
@@ -0,0 +1,1 @@
+{"op":"a_overlaps","args":[{"property":"values"},[{"timestamp":"2012-08-10T05:30:00.000000Z"},{"date":"2010-02-10"},false]]}
diff --git a/tests/expected/text/example82.txt b/tests/expected/text/example82.txt
new file mode 100644
index 0000000..90ca8dd
--- /dev/null
+++ b/tests/expected/text/example82.txt
@@ -0,0 +1,1 @@
+a_overlaps("values", (TIMESTAMP('2012-08-10T05:30:00.000000Z'), DATE('2010-02-10'), false))
diff --git a/tests/expected/text/example83.json b/tests/expected/text/example83.json
new file mode 100644
index 0000000..a6069b1
--- /dev/null
+++ b/tests/expected/text/example83.json
@@ -0,0 +1,1 @@
+{"op":"s_equals","args":[{"type":"MultiPoint","coordinates":[[180,-0.5],[179,-47.121701],[180,-0.0],[33.470475,-0.99999],[179,-15.333062]]},{"property":"geometry"}]}
diff --git a/tests/expected/text/example83.txt b/tests/expected/text/example83.txt
new file mode 100644
index 0000000..680973f
--- /dev/null
+++ b/tests/expected/text/example83.txt
@@ -0,0 +1,1 @@
+s_equals(MULTIPOINT(180 -0.5,179 -47.121701,180 -0,33.470475 -0.99999,179 -15.333062), "geometry")
diff --git a/tests/expected/text/example84.json b/tests/expected/text/example84.json
new file mode 100644
index 0000000..37c2407
--- /dev/null
+++ b/tests/expected/text/example84.json
@@ -0,0 +1,1 @@
+{"op":"s_equals","args":[{"type":"GeometryCollection","geometries":[{"type":"Point","coordinates":[1.9,2.00001]},{"type":"Point","coordinates":[0,-2.00001]},{"type":"MultiLineString","coordinates":[[[-2.00001,-0.0],[-77.292642,-0.5],[-87.515626,-0.0],[-180,12.502773],[21.204842,-1.5],[-21.878857,-90]]]},{"type":"Point","coordinates":[1.9,0.5]},{"type":"LineString","coordinates":[[179,1.179148],[-148.192487,-65.007816],[0.5,0.333333]]}]},{"property":"geometry"}]}
diff --git a/tests/expected/text/example84.txt b/tests/expected/text/example84.txt
new file mode 100644
index 0000000..894380d
--- /dev/null
+++ b/tests/expected/text/example84.txt
@@ -0,0 +1,1 @@
+s_equals(GEOMETRYCOLLECTION(POINT(1.9 2.00001),POINT(0 -2.00001),MULTILINESTRING((-2.00001 -0,-77.292642 -0.5,-87.515626 -0,-180 12.502773,21.204842 -1.5,-21.878857 -90)),POINT(1.9 0.5),LINESTRING(179 1.179148,-148.192487 -65.007816,0.5 0.333333)), "geometry")
diff --git a/tests/expected/text/example85-alt01.json b/tests/expected/text/example85-alt01.json
new file mode 100644
index 0000000..13b9703
--- /dev/null
+++ b/tests/expected/text/example85-alt01.json
@@ -0,0 +1,1 @@
+{"op":"=","args":[{"property":"value"},{"op":"-","args":[{"op":"+","args":[{"op":"*","args":[{"op":"*","args":[-1.0,{"property":"foo"}]},2.0]},{"op":"/","args":[{"property":"bar"},6.1234]}]},{"op":"^","args":[{"property":"x"},2.0]}]}]}
diff --git a/tests/expected/text/example85-alt01.txt b/tests/expected/text/example85-alt01.txt
new file mode 100644
index 0000000..fe6f575
--- /dev/null
+++ b/tests/expected/text/example85-alt01.txt
@@ -0,0 +1,1 @@
+("value" = ((((-1 * "foo") * 2) + ("bar" / 6.1234)) - ("x" ^ 2)))
diff --git a/tests/expected/text/example85.json b/tests/expected/text/example85.json
new file mode 100644
index 0000000..602d8f7
--- /dev/null
+++ b/tests/expected/text/example85.json
@@ -0,0 +1,1 @@
+{"op":"=","args":[{"property":"value"},{"op":"-","args":[{"op":"+","args":[{"op":"*","args":[{"op":"*","args":[{"op":"*","args":[-1.0,1.0]},{"property":"foo"}]},2.0]},{"op":"/","args":[{"property":"bar"},6.1234]}]},{"op":"^","args":[{"property":"x"},2.0]}]}]}
diff --git a/tests/expected/text/example85.txt b/tests/expected/text/example85.txt
new file mode 100644
index 0000000..20cb25d
--- /dev/null
+++ b/tests/expected/text/example85.txt
@@ -0,0 +1,1 @@
+("value" = (((((-1 * 1) * "foo") * 2) + ("bar" / 6.1234)) - ("x" ^ 2)))
diff --git a/tests/expected/text/example86.json b/tests/expected/text/example86.json
new file mode 100644
index 0000000..71c574a
--- /dev/null
+++ b/tests/expected/text/example86.json
@@ -0,0 +1,1 @@
+{"op":"like","args":[{"property":"name"},{"op":"casei","args":["FOO%"]}]}
diff --git a/tests/expected/text/example86.txt b/tests/expected/text/example86.txt
new file mode 100644
index 0000000..e648cfc
--- /dev/null
+++ b/tests/expected/text/example86.txt
@@ -0,0 +1,1 @@
+like("name", casei('FOO%'))
diff --git a/tests/generate-expected b/tests/generate-expected
new file mode 100755
index 0000000..f079a3a
--- /dev/null
+++ b/tests/generate-expected
@@ -0,0 +1,37 @@
+#!/usr/bin/env sh
+#
+# Generates the expected output files for all the OGC example inputs.
+
+set -e
+
+cargo build
+
+tests=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &> /dev/null && pwd)
+expected="$tests/expected"
+fixtures="$tests/fixtures"
+
+for input_format in json text; do
+    if [ $input_format = "json" ]; then
+        input_extension="json"
+    else
+        input_extension="txt"
+    fi
+
+    for path in "$fixtures/$input_format"/*.$input_extension; do
+        for output_format in json text; do
+            if [ $output_format = "json" ]; then
+                bin="target/debug/cql2json"
+                output_extension="json"
+            else
+                bin="target/debug/cql2text"
+                output_extension="txt"
+            fi
+
+            file_name="${path##*/}"
+            file_stem="${file_name%.*}"
+            mkdir -p "$expected/$output_format"
+
+            $bin <$path > "$expected/$input_format/$file_stem.$output_extension"
+        done
+    done
+done
diff --git a/tests/ogc_tests.rs b/tests/ogc_tests.rs
index f5f183f..f2e7891 100644
--- a/tests/ogc_tests.rs
+++ b/tests/ogc_tests.rs
@@ -1,49 +1,41 @@
 use assert_json_diff::assert_json_eq;
-use cql2::parse;
+use cql2::Expr;
 use rstest::rstest;
 use serde_json::json;
-use std::fs;
-use std::path::PathBuf;
+use std::path::{Path, PathBuf};
 
-pub fn validate_str(cql2: &str) {
-    println!("CQL2: {}", cql2);
-    let expr: cql2::Expr = parse(cql2).unwrap();
-    let outcql2: String = expr.to_cql2_text().unwrap();
-    println!("Out CQL2: {}", outcql2);
-    println!("Expr:  {}", expr.to_json().unwrap());
-    let valid = expr.is_valid();
-    assert!(valid);
-    // make sure that the cql2 text generated by as_cql2 is valid as well
+fn validate_str(s: &str) -> Expr {
+    let expr = cql2::parse(s).unwrap();
+    assert!(expr.is_valid());
+    let expr_from_txt = cql2::parse(&expr.to_cql2_text().unwrap()).unwrap();
+    assert!(expr_from_txt.is_valid());
+    let json = expr.to_json().unwrap();
+    let expr_from_json = cql2::parse(&json).unwrap();
+    assert_json_eq!(json!(json), json!(expr_from_json.to_json().unwrap()));
+    expr
+}
 
-    let expr2: cql2::Expr = parse(&outcql2).unwrap();
-    let js = expr2.to_json().unwrap();
-    println!("Expr2: {}", js);
-    let valid2 = expr2.is_valid();
-    assert!(valid2);
+fn validate_path(path: impl AsRef<Path>) {
+    let path = path.as_ref();
+    let file_name = path.file_name().unwrap();
+    let expr = validate_str(&std::fs::read_to_string(path).unwrap());
 
-    // make sure that when reparsing the output that the json is the same
-    let expr3 = parse(&js).unwrap();
-    println!("Expr3: {}", expr3.to_json().unwrap());
-    assert_json_eq!(json!(js), json!(expr3.to_json().unwrap()));
-}
+    let input_format = path.parent().unwrap().file_stem().unwrap();
+    let expected = Path::new("tests/expected").join(input_format);
 
-pub fn validate_file(f: &str) {
-    println!("File Path: {:#?}", f);
-    let cql2 = fs::read_to_string(f).unwrap();
-    validate_str(&cql2);
-}
+    let json = std::fs::read_to_string(expected.join(file_name).with_extension("json")).unwrap();
+    assert_eq!(json.trim(), expr.to_json().unwrap());
 
-#[rstest]
-fn for_each_text_file(#[files("tests/fixtures/text/*.txt")] path: PathBuf) {
-    validate_file(path.to_str().expect("reason"));
+    let text = std::fs::read_to_string(expected.join(file_name).with_extension("txt")).unwrap();
+    assert_eq!(text.trim(), expr.to_cql2_text().unwrap());
 }
 
 #[rstest]
-fn for_each_json_file(#[files("tests/fixtures/json/*.json")] path: PathBuf) {
-    validate_file(path.to_str().expect("reason"));
+fn validate_text_fixtures(#[files("tests/fixtures/text/*.txt")] path: PathBuf) {
+    validate_path(path);
 }
 
 #[rstest]
-fn between_tests() {
-    validate_str("true and a between 1 and 2 and false")
+fn validate_json_fixtures(#[files("tests/fixtures/json/*.json")] path: PathBuf) {
+    validate_path(path);
 }