Skip to content

Commit

Permalink
Support exclusive constraints in schema (#11)
Browse files Browse the repository at this point in the history
* Updated the spec

* Updated the profile
  • Loading branch information
roll authored Jan 25, 2024
1 parent dfee092 commit ad237e6
Show file tree
Hide file tree
Showing 2 changed files with 72 additions and 0 deletions.
28 changes: 28 additions & 0 deletions content/docs/specifications/table-schema.md
Original file line number Diff line number Diff line change
Expand Up @@ -491,6 +491,34 @@ properties.
As for <code>minimum</code>, but specifies a maximum value for a field.
</td>
</tr>
<tr>
<td>
<code>exclusiveMinimum</code>
</td>
<td>
integer, number, date, time, datetime, duration, year, yearmonth
</td>
<td>
<code>integer, number, date, time, datetime, duration, year, yearmonth</code>
</td>
<td>
As for <code>minimum</code>, but for expressing exclusive range.
</td>
</tr>
<tr>
<td>
<code>exclusiveMaximum</code>
</td>
<td>
integer, number, date, time, datetime, duration, year, yearmonth
</td>
<td>
<code>integer, number, date, time, datetime, duration, year, yearmonth</code>
</td>
<td>
As for <code>maximum</code>, but for expressing exclusive range.
</td>
</tr>
<tr>
<td>
<code>pattern</code>
Expand Down
44 changes: 44 additions & 0 deletions profiles/dictionary/schema.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -399,6 +399,14 @@ tableSchemaFieldInteger:
oneOf:
- "$ref": "#/definitions/tableSchemaConstraintMaximumString"
- "$ref": "#/definitions/tableSchemaConstraintMaximumInteger"
exclusiveMinimum:
oneOf:
- "$ref": "#/definitions/tableSchemaConstraintMinimumString"
- "$ref": "#/definitions/tableSchemaConstraintMinimumInteger"
exclusiveMaximum:
oneOf:
- "$ref": "#/definitions/tableSchemaConstraintMaximumString"
- "$ref": "#/definitions/tableSchemaConstraintMaximumInteger"
rdfType:
"$ref": "#/definitions/tableSchemaRdfType"
examples:
Expand Down Expand Up @@ -479,6 +487,14 @@ tableSchemaFieldNumber:
oneOf:
- "$ref": "#/definitions/tableSchemaConstraintMaximumString"
- "$ref": "#/definitions/tableSchemaConstraintMaximumNumber"
exclusiveMinimum:
oneOf:
- "$ref": "#/definitions/tableSchemaConstraintMinimumString"
- "$ref": "#/definitions/tableSchemaConstraintMinimumNumber"
exclusiveMaximum:
oneOf:
- "$ref": "#/definitions/tableSchemaConstraintMaximumString"
- "$ref": "#/definitions/tableSchemaConstraintMaximumNumber"
rdfType:
"$ref": "#/definitions/tableSchemaRdfType"
examples:
Expand Down Expand Up @@ -538,6 +554,10 @@ tableSchemaFieldDate:
"$ref": "#/definitions/tableSchemaConstraintMinimumString"
maximum:
"$ref": "#/definitions/tableSchemaConstraintMaximumString"
exclusiveMinimum:
"$ref": "#/definitions/tableSchemaConstraintMinimumString"
exclusiveMaximum:
"$ref": "#/definitions/tableSchemaConstraintMaximumString"
rdfType:
"$ref": "#/definitions/tableSchemaRdfType"
examples:
Expand Down Expand Up @@ -603,6 +623,10 @@ tableSchemaFieldTime:
"$ref": "#/definitions/tableSchemaConstraintMinimumString"
maximum:
"$ref": "#/definitions/tableSchemaConstraintMaximumString"
exclusiveMinimum:
"$ref": "#/definitions/tableSchemaConstraintMinimumString"
exclusiveMaximum:
"$ref": "#/definitions/tableSchemaConstraintMaximumString"
rdfType:
"$ref": "#/definitions/tableSchemaRdfType"
examples:
Expand Down Expand Up @@ -660,6 +684,10 @@ tableSchemaFieldDateTime:
"$ref": "#/definitions/tableSchemaConstraintMinimumString"
maximum:
"$ref": "#/definitions/tableSchemaConstraintMaximumString"
exclusiveMinimum:
"$ref": "#/definitions/tableSchemaConstraintMinimumString"
exclusiveMaximum:
"$ref": "#/definitions/tableSchemaConstraintMaximumString"
rdfType:
"$ref": "#/definitions/tableSchemaRdfType"
examples:
Expand Down Expand Up @@ -721,6 +749,14 @@ tableSchemaFieldYear:
oneOf:
- "$ref": "#/definitions/tableSchemaConstraintMaximumString"
- "$ref": "#/definitions/tableSchemaConstraintMaximumInteger"
exclusiveMinimum:
oneOf:
- "$ref": "#/definitions/tableSchemaConstraintMinimumString"
- "$ref": "#/definitions/tableSchemaConstraintMinimumInteger"
exclusiveMaximum:
oneOf:
- "$ref": "#/definitions/tableSchemaConstraintMaximumString"
- "$ref": "#/definitions/tableSchemaConstraintMaximumInteger"
rdfType:
"$ref": "#/definitions/tableSchemaRdfType"
examples:
Expand Down Expand Up @@ -779,6 +815,10 @@ tableSchemaFieldYearMonth:
"$ref": "#/definitions/tableSchemaConstraintMinimumString"
maximum:
"$ref": "#/definitions/tableSchemaConstraintMaximumString"
exclusiveMinimum:
"$ref": "#/definitions/tableSchemaConstraintMinimumString"
exclusiveMaximum:
"$ref": "#/definitions/tableSchemaConstraintMaximumString"
rdfType:
"$ref": "#/definitions/tableSchemaRdfType"
examples:
Expand Down Expand Up @@ -838,6 +878,10 @@ tableSchemaFieldDuration:
"$ref": "#/definitions/tableSchemaConstraintMinimumString"
maximum:
"$ref": "#/definitions/tableSchemaConstraintMaximumString"
exclusiveMinimum:
"$ref": "#/definitions/tableSchemaConstraintMinimumString"
exclusiveMaximum:
"$ref": "#/definitions/tableSchemaConstraintMaximumString"
rdfType:
"$ref": "#/definitions/tableSchemaRdfType"
examples:
Expand Down

0 comments on commit ad237e6

Please sign in to comment.