Skip to content
This repository has been archived by the owner on Apr 14, 2023. It is now read-only.

Commit

Permalink
Merge pull request #1401 from cdowding-sl/hotfix/1382
Browse files Browse the repository at this point in the history
Hotfix/1382
  • Loading branch information
pdaulbyscottlogic authored Oct 3, 2019
2 parents 81d1ebd + 3a210a9 commit 42c4f83
Show file tree
Hide file tree
Showing 69 changed files with 248 additions and 581 deletions.
20 changes: 10 additions & 10 deletions docs/UserGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -252,10 +252,10 @@ Strings are sequences of unicode characters with a maximum length of 1000 charac

## DateTime

DateTimes represent specific moments in time, and are specified in profiles through specialised objects:
DateTimes represent specific moments in time, and are specified in profiles through specialised strings:

```javascript
{ "date": "2000-01-01T09:00:00.000" }
"2000-01-01T09:00:00.000"
```

The format is a subset of [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601); the date and time must be fully specified as above,
Expand Down Expand Up @@ -317,7 +317,7 @@ The [grammatical `not` constraint](#Grammatical-Constraints) inverts a constrain
OR
{ "field": "type", "is": "equalTo", "value": 23 }
OR
{ "field": "type", "is": "equalTo", "value": { "date": "2001-02-03T04:05:06.007" } }
{ "field": "type", "is": "equalTo", "value": "2001-02-03T04:05:06.007" }
```

Is satisfied if `field`'s value is equal to `value`
Expand All @@ -327,7 +327,7 @@ Is satisfied if `field`'s value is equal to `value`
### `inSet` _(field, values)_

```javascript
{ "field": "type", "is": "inSet", "values": [ "X_092", 123, null, { "date": "2001-02-03T04:05:06.007" } ] }
{ "field": "type", "is": "inSet", "values": [ "X_092", 123, null, "2001-02-03T04:05:06.007" ] }
```

Is satisfied if `field`'s value is in the set `values`
Expand Down Expand Up @@ -487,16 +487,16 @@ Is satisfied if `field` is a number less than or equal to `value`.
Is satisfied if `field` has at least the [granularity](#Numeric-granularity) specified in `value`.

## DateTime constraints
All dates must be in format `yyyy-MM-ddTHH:mm:ss.SSS` and embedded in a _date-object_. The Z suffix can be included, but is not required. All datetimes are treated as UTC whether the Z suffix is included or not.
All dates must be in format `yyyy-MM-ddTHH:mm:ss.SSS` and the Z suffix can be included, but is not required. All datetimes are treated as UTC whether the Z suffix is included or not.

Example: `{ "date": "2001-02-03T04:05:06.007" }`
Example: `2001-02-03T04:05:06.007`

<div id="predicate-after"></div>

### `after` _(field, value)_

```javascript
{ "field": "date", "is": "after", "value": { "date": "2018-09-01T00:00:00.000" } }
{ "field": "date", "is": "after", "value": "2018-09-01T00:00:00.000" }
```

Is satisfied if `field` is a datetime occurring after `value`.
Expand All @@ -506,7 +506,7 @@ Is satisfied if `field` is a datetime occurring after `value`.
### `afterOrAt` _(field, value)_

```javascript
{ "field": "date", "is": "afterOrAt", "value": { "date": "2018-09-01T00:00:00.000" } }
{ "field": "date", "is": "afterOrAt", "value": "2018-09-01T00:00:00.000" }
```

Is satisfied if `field` is a datetime occurring after or simultaneously with `value`.
Expand All @@ -516,7 +516,7 @@ Is satisfied if `field` is a datetime occurring after or simultaneously with `va
### `before` _(field, value)_

```javascript
{ "field": "date", "is": "before", "value": { "date": "2018-09-01T00:00:00.000" } }
{ "field": "date", "is": "before", "value": "2018-09-01T00:00:00.000" }
```

Is satisfied if `field` is a datetime occurring before `value`.
Expand All @@ -526,7 +526,7 @@ Is satisfied if `field` is a datetime occurring before `value`.
### `beforeOrAt` _(field, value)_

```javascript
{ "field": "date", "is": "beforeOrAt", "value": { "date": "2018-09-01T00:00:00.000" } }
{ "field": "date", "is": "beforeOrAt", "value": "2018-09-01T00:00:00.000" }
```

Is satisfied if `field` is a datetime occurring before or simultaneously with `value`.
Expand Down
2 changes: 1 addition & 1 deletion docs/user/Schema.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
"then": {
"allOf": [
{ "field": "tariff", "is": "null" },
{ "field": "time", "is": "after", "value": { "date": "2014-01-01" } }
{ "field": "time", "is": "after", "value": "2014-01-01" }
]
},
"else": { "not": { "field": "tariff", "is": "null" } }
Expand Down
2 changes: 1 addition & 1 deletion examples/a-valid-isin/profile.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"schemaVersion": "0.8",
"schemaVersion": "0.9",
"fields": [
{
"name": "isin",
Expand Down
2 changes: 1 addition & 1 deletion examples/actor-names/profile.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"schemaVersion": "0.8",
"schemaVersion": "0.9",
"fields": [
{
"name": "forename",
Expand Down
2 changes: 1 addition & 1 deletion examples/anyOf/profile.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"schemaVersion": "0.8",
"schemaVersion": "0.9",
"rules": [
{
"rule": "rule 1",
Expand Down
6 changes: 2 additions & 4 deletions examples/date-after-dynamic/profile.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"schemaVersion": "0.8",
"schemaVersion": "0.9",
"fields": [
{
"name": "field1",
Expand All @@ -25,9 +25,7 @@
{
"field": "field1",
"is": "after",
"value": {
"date": "8001-02-03T04:05:06.007"
}
"value": "8001-02-03T04:05:06.007"
},
{
"field": "field2",
Expand Down
6 changes: 2 additions & 4 deletions examples/date-after/profile.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"schemaVersion": "0.8",
"schemaVersion": "0.9",
"fields": [
{
"name": "date",
Expand All @@ -13,9 +13,7 @@
{
"field": "date",
"is": "after",
"value": {
"date": "8001-02-03T04:05:06.007"
}
"value": "8001-02-03T04:05:06.007"
}
]
}
Expand Down
18 changes: 5 additions & 13 deletions examples/date-equal-to-dynamic-offset/profile.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"schemaVersion": "0.8",
"schemaVersion": "0.9",
"fields": [
{
"name": "first",
Expand Down Expand Up @@ -43,9 +43,7 @@
{
"field": "first",
"is": "after",
"value": {
"date": "8001-02-03T04:05:06.007"
}
"value": "8001-02-03T04:05:06.007"
},
{
"field": "second",
Expand All @@ -64,9 +62,7 @@
{
"field": "firstWorking",
"is": "equalTo",
"value": {
"date": "2019-08-12T12:00:00.000"
}
"value": "2019-08-12T12:00:00.000"
},
{
"field": "secondWorking",
Expand All @@ -78,16 +74,12 @@
{
"field": "current",
"is": "before",
"value": {
"date": "now"
}
"value": "now"
},
{
"field": "current",
"is": "after",
"value": {
"date": "2019-06-01T12:00:00.000"
}
"value": "2019-06-01T12:00:00.000"
}
]
}
Expand Down
6 changes: 2 additions & 4 deletions examples/date-equal-to-dynamic/profile.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"schemaVersion": "0.8",
"schemaVersion": "0.9",
"fields": [
{
"name": "first",
Expand All @@ -17,9 +17,7 @@
{
"field": "first",
"is": "after",
"value": {
"date": "8001-02-03T04:05:06.007"
}
"value": "8001-02-03T04:05:06.007"
},
{
"field": "second",
Expand Down
6 changes: 2 additions & 4 deletions examples/date-equal-to/profile.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"schemaVersion": "0.8",
"schemaVersion": "0.9",
"fields": [
{
"name": "date",
Expand All @@ -13,9 +13,7 @@
{
"field": "date",
"is": "equalTo",
"value": {
"date": "2001-02-03T04:05:06.007"
}
"value": "2001-02-03T04:05:06.007"
}
]
}
Expand Down
2 changes: 1 addition & 1 deletion examples/date-offset-working-days/profile.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"schemaVersion": "0.8",
"schemaVersion": "0.9",
"fields": [
{
"name": "foo",
Expand Down
6 changes: 3 additions & 3 deletions examples/demo-trades-smaller/profile.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"schemaVersion": "0.8",
"schemaVersion": "0.9",
"fields": [
{
"name": "tradeId",
Expand Down Expand Up @@ -71,8 +71,8 @@
{
"rule": "tradeDatetime",
"constraints": [
{ "field": "tradeDatetime", "is": "after", "value": { "date": "2019-09-02T09:30:00.000" } },
{ "field": "tradeDatetime", "is": "before", "value": { "date": "2019-09-02T16:30:00.000" } }
{ "field": "tradeDatetime", "is": "after", "value": "2019-09-02T09:30:00.000" },
{ "field": "tradeDatetime", "is": "before", "value": "2019-09-02T16:30:00.000" }
]
}
]
Expand Down
8 changes: 4 additions & 4 deletions examples/demo-trades/profile.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"schemaVersion": "0.8",
"schemaVersion": "0.9",
"fields": [
{
"name": "tradeId",
Expand Down Expand Up @@ -101,15 +101,15 @@
"rule": "tradeDatetime",
"constraints": [
{ "field": "tradeDatetime", "is": "granularTo", "value": "millis" },
{ "field": "tradeDatetime", "is": "after", "value": { "date": "2019-09-02T09:30:00.000" } },
{ "field": "tradeDatetime", "is": "before", "value": { "date": "2019-09-02T16:30:00.000" } }
{ "field": "tradeDatetime", "is": "after", "value":"2019-09-02T09:30:00.000" },
{ "field": "tradeDatetime", "is": "before", "value": "2019-09-02T16:30:00.000" }
]
},
{
"rule": "tradeDate",
"constraints": [
{ "field": "tradeDate", "is": "granularTo", "value": "days" },
{ "field": "tradeDate", "is": "equalTo", "value": { "date": "2019-09-02T00:00:00.000" } }
{ "field": "tradeDate", "is": "equalTo", "value": "2019-09-02T00:00:00.000" }
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion examples/duplicates/profile.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"schemaVersion": "0.8",
"schemaVersion": "0.9",
"fields": [
{
"name": "a",
Expand Down
10 changes: 3 additions & 7 deletions examples/formatting/profile.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"schemaVersion": "0.8",
"schemaVersion": "0.9",
"fields": [
{
"name": "decimal",
Expand Down Expand Up @@ -40,16 +40,12 @@
{
"field": "date1",
"is": "equalTo",
"value": {
"date": "2001-02-03T04:05:06.007"
}
"value": "2001-02-03T04:05:06.007"
},
{
"field": "date2",
"is": "equalTo",
"value": {
"date": "2001-02-03T04:05:06.007"
}
"value": "2001-02-03T04:05:06.007"
},
{
"field": "an_integer",
Expand Down
2 changes: 1 addition & 1 deletion examples/from-file-weighted/profile.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"schemaVersion": "0.8",
"schemaVersion": "0.9",
"fields": [
{
"name": "name",
Expand Down
2 changes: 1 addition & 1 deletion examples/from-file/profile.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"schemaVersion": "0.8",
"schemaVersion": "0.9",
"fields": [
{
"name": "name",
Expand Down
2 changes: 1 addition & 1 deletion examples/hard-contradiction-null-validation/profile.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"schemaVersion": "0.8",
"schemaVersion": "0.9",
"fields": [
{
"name": "Column 1",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"schemaVersion": "0.8",
"schemaVersion": "0.9",
"fields": [
{
"name": "Column 1",
Expand Down
2 changes: 1 addition & 1 deletion examples/integer-range-with-blacklist/profile.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"schemaVersion": "0.8",
"schemaVersion": "0.9",
"fields": [
{
"name": "an_integer",
Expand Down
2 changes: 1 addition & 1 deletion examples/integer-range/profile.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"schemaVersion": "0.8",
"schemaVersion": "0.9",
"fields": [
{
"name": "an_integer",
Expand Down
2 changes: 1 addition & 1 deletion examples/names/profile.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"schemaVersion": "0.8",
"schemaVersion": "0.9",
"fields": [
{
"name": "forename",
Expand Down
2 changes: 1 addition & 1 deletion examples/partial-contradictions/profile.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"schemaVersion": "0.8",
"schemaVersion": "0.9",
"fields": [
{
"name": "Column 1",
Expand Down
2 changes: 1 addition & 1 deletion examples/partitioning/profile.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"schemaVersion": "0.8",
"schemaVersion": "0.9",
"fields": [
{
"name": "p1f1",
Expand Down
2 changes: 1 addition & 1 deletion examples/real-number-range/profile.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"schemaVersion": "0.8",
"schemaVersion": "0.9",
"fields": [
{
"name": "a_number",
Expand Down
2 changes: 1 addition & 1 deletion examples/regex-contains/profile.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"schemaVersion": "0.8",
"schemaVersion": "0.9",
"fields": [
{
"name": "first_name",
Expand Down
2 changes: 1 addition & 1 deletion examples/regex-intersect-with-blacklist/profile.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"schemaVersion": "0.8",
"schemaVersion": "0.9",
"fields": [
{
"name": "first_name",
Expand Down
Loading

0 comments on commit 42c4f83

Please sign in to comment.