node-blaze
Version:
Bindings to blaze, high-performance C++ JSON Schema validator
620 lines (619 loc) • 18.4 kB
JSON
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$dynamicAnchor": "cql2expression",
"oneOf": [
{"$ref": "#/$defs/andOrExpression" },
{"$ref": "#/$defs/notExpression" },
{"$ref": "#/$defs/comparisonPredicate"},
{"$ref": "#/$defs/spatialPredicate" },
{"$ref": "#/$defs/temporalPredicate" },
{"$ref": "#/$defs/arrayPredicate" },
{"$ref": "#/$defs/functionRef" },
{"type": "boolean" }
],
"$defs": {
"andOrExpression": {
"type": "object",
"required": ["op", "args"],
"properties": {
"op": { "type": "string", "enum": ["and", "or"] },
"args": {
"type": "array",
"minItems": 2,
"items": {"$dynamicRef": "#cql2expression"}
}
}
},
"notExpression": {
"type": "object",
"required": ["op", "args"],
"properties": {
"op": { "type": "string", "enum": ["not"] },
"args": {
"type": "array",
"minItems": 1,
"maxItems": 1,
"items": {"$dynamicRef": "#cql2expression"}
}
}
},
"comparisonPredicate": {
"oneOf": [
{"$ref": "#/$defs/binaryComparisonPredicate"},
{"$ref": "#/$defs/isLikePredicate" },
{"$ref": "#/$defs/isBetweenPredicate" },
{"$ref": "#/$defs/isInListPredicate" },
{"$ref": "#/$defs/isNullPredicate" }
]
},
"binaryComparisonPredicate": {
"type": "object",
"required": ["op", "args"],
"properties": {
"op": { "type": "string", "enum": ["=", "<>", "<", ">", "<=", ">="] },
"args": {"$ref": "#/$defs/scalarOperands"}
}
},
"scalarOperands": {
"type": "array",
"minItems": 2,
"maxItems": 2,
"items": {"$ref": "#/$defs/scalarExpression"}
},
"scalarExpression": {
"oneOf": [
{"$ref": "#/$defs/characterExpression"},
{"$ref": "#/$defs/numericExpression"} ,
{"type": "boolean"} ,
{"$ref": "#/$defs/instantInstance"} ,
{"$ref": "#/$defs/functionRef"},
{"$ref": "#/$defs/propertyRef"}
]
},
"isLikePredicate": {
"type": "object",
"required": ["op", "args"],
"properties": {
"op" : { "type": "string", "enum": ["like"] },
"args": {"$ref": "#/$defs/isLikeOperands"}
}
},
"isLikeOperands": {
"type": "array",
"minItems": 2,
"maxItems": 2,
"prefixItems": [
{
"oneOf": [
{"$ref": "#/$defs/characterExpression"},
{"$ref": "#/$defs/propertyRef" },
{"$ref": "#/$defs/functionRef" }
]
},
{"$ref": "#/$defs/patternExpression"}
]
},
"patternExpression": {
"oneOf": [
{
"type": "object",
"required": ["op", "args"],
"properties": {
"op": { "type": "string", "enum": ["casei"] },
"args": {
"type": "array",
"items": {"$ref": "#/$defs/patternExpression"},
"minItems": 1,
"maxItems": 1
}
}
},
{
"type": "object",
"required": ["op", "args"],
"properties": {
"op": { "type": "string", "enum": ["accenti"] },
"args": {
"type": "array",
"items": {"$ref": "#/$defs/patternExpression"},
"minItems": 1,
"maxItems": 1
}
}
},
{"type": "string"}
]
},
"isBetweenPredicate": {
"type": "object",
"required": ["op", "args"],
"properties": {
"op" : { "type": "string", "enum": ["between"] },
"args": {"$ref": "#/$defs/isBetweenOperands"}
}
},
"isBetweenOperands": {
"type": "array",
"minItems": 3,
"maxItems": 3,
"items": {
"oneOf": [
{"$ref": "#/$defs/numericExpression"},
{"$ref": "#/$defs/propertyRef" },
{"$ref": "#/$defs/functionRef" }
]
}
},
"numericExpression": {
"oneOf": [ {"$ref": "#/$defs/arithmeticExpression"}, {"type": "number"} ]
},
"isInListPredicate": {
"type": "object",
"required": ["op", "args"],
"properties": {
"op" : { "type": "string", "enum": ["in"] },
"args": {"$ref": "#/$defs/inListOperands"}
}
},
"inListOperands": {
"type": "array",
"minItems": 2,
"maxItems": 2,
"prefixItems": [
{"$ref": "#/$defs/scalarExpression"} ,
{ "type": "array", "items": {"$ref": "#/$defs/scalarExpression"} }
]
},
"isNullPredicate": {
"type": "object",
"required": ["op", "args"],
"properties": {
"op" : { "type": "string", "enum": ["isNull"] },
"args": {"$ref": "#/$defs/isNullOperand"}
}
},
"isNullOperand": {
"type": "array",
"minItems": 1,
"maxItems": 1,
"items": {
"oneOf": [
{"$ref": "#/$defs/characterExpression"},
{"$ref": "#/$defs/numericExpression"} ,
{"$dynamicRef": "#cql2expression"} ,
{"$ref": "#/$defs/spatialInstance"} ,
{"$ref": "#/$defs/temporalInstance"} ,
{"$ref": "#/$defs/propertyRef"}
]
}
},
"spatialPredicate": {
"type": "object",
"required": ["op", "args"],
"properties": {
"op": {
"type": "string",
"enum": [
"s_contains" , "s_crosses" , "s_disjoint" , "s_equals" ,
"s_intersects", "s_overlaps" , "s_touches" , "s_within"
]
},
"args": {"$ref": "#/$defs/spatialOperands"}
}
},
"spatialOperands": {
"type": "array",
"minItems": 2,
"maxItems": 2,
"items": {
"oneOf": [
{"$ref": "#/$defs/spatialInstance"},
{"$ref": "#/$defs/propertyRef" },
{"$ref": "#/$defs/functionRef" }
]
}
},
"temporalPredicate": {
"type": "object",
"required": ["op", "args"],
"properties": {
"op": {
"type": "string",
"enum": [
"t_after" , "t_before" , "t_contains" ,
"t_disjoint" , "t_during" , "t_equals" ,
"t_finishedBy" , "t_finishes" , "t_intersects" ,
"t_meets" , "t_metBy" , "t_overlappedBy",
"t_overlaps" , "t_startedBy" , "t_starts"
]
},
"args": {"$ref": "#/$defs/temporalOperands"}
}
},
"temporalOperands": {
"type": "array",
"minItems": 2,
"maxItems": 2,
"items": {
"oneOf": [
{"$ref": "#/$defs/temporalInstance"},
{"$ref": "#/$defs/propertyRef" },
{"$ref": "#/$defs/functionRef" }
]
}
},
"arrayPredicate": {
"type": "object",
"required": ["op", "args"],
"properties": {
"op": {
"type": "string",
"enum": ["a_containedBy", "a_contains", "a_equals", "a_overlaps"]
},
"args": {"$ref": "#/$defs/arrayOperands"}
}
},
"arrayOperands": {
"type": "array",
"minItems": 2,
"maxItems": 2,
"items": {
"oneOf": [
{"$ref": "#/$defs/arrayExpression" },
{"$ref": "#/$defs/propertyRef"},
{"$ref": "#/$defs/functionRef"}
]
}
},
"arrayExpression": {
"type": "array",
"items": {
"oneOf": [
{"$ref": "#/$defs/characterExpression"},
{"$ref": "#/$defs/numericExpression"} ,
{"$dynamicRef": "#cql2expression"} ,
{"$ref": "#/$defs/spatialInstance"} ,
{"$ref": "#/$defs/temporalInstance"} ,
{"$ref": "#/$defs/arrayExpression"} ,
{"$ref": "#/$defs/propertyRef"}
]
}
},
"arithmeticExpression": {
"type": "object",
"required": ["op", "args"],
"properties": {
"op": {
"type": "string",
"enum": ["+", "-", "*", "/", "^", "%", "div"]
},
"args": {"$ref": "#/$defs/arithmeticOperands"}
}
},
"arithmeticOperands": {
"type": "array",
"minItems": 2,
"maxItems": 2,
"items": {
"oneOf": [
{"$ref": "#/$defs/arithmeticExpression" },
{"$ref": "#/$defs/propertyRef" },
{"$ref": "#/$defs/functionRef" },
{ "type": "number"}
]
}
},
"propertyRef": {
"type": "object",
"required": ["property"],
"properties": { "property": {"type": "string"} }
},
"casei": {
"type": "object",
"required": ["op", "args"],
"properties": {
"op": { "type": "string", "enum": ["casei"] },
"args": {
"type": "array",
"items": {
"oneOf": [
{"$ref": "#/$defs/characterExpression"},
{"$ref": "#/$defs/propertyRef" },
{"$ref": "#/$defs/functionRef" }
]
},
"minItems": 1,
"maxItems": 1
}
}
},
"accenti": {
"type": "object",
"required": ["op", "args"],
"properties": {
"op": { "type": "string", "enum": ["accenti"] },
"args": {
"type": "array",
"items": {
"oneOf": [
{"$ref": "#/$defs/characterExpression"},
{"$ref": "#/$defs/propertyRef" },
{"$ref": "#/$defs/functionRef" }
]
},
"minItems": 1,
"maxItems": 1
}
}
},
"characterExpression": {
"oneOf": [
{"$ref": "#/$defs/casei" },
{"$ref": "#/$defs/accenti" },
{ "type": "string"}
]
},
"functionRef": {
"type": "object",
"required": ["op", "args"],
"properties": {
"op": {
"type": "string",
"not": {
"enum": [
"and" , "or" , "not" ,
"=" , "<>" , "<" ,
">" , "<=" , ">=" ,
"like" , "between" , "in" ,
"isNull" , "casei" , "accenti" ,
"s_contains" , "s_crosses" , "s_disjoint" ,
"s_equals" , "s_intersects" , "s_overlaps" ,
"s_touches" , "s_within" , "t_after" ,
"t_before" , "t_contains" , "t_disjoint" ,
"t_during" , "t_equals" , "t_finishedBy" ,
"t_finishes" , "t_intersects" , "t_meets" ,
"t_metBy" , "t_overlappedBy", "t_overlaps" ,
"t_startedBy" , "t_starts" , "a_containedBy" ,
"a_contains" , "a_equals" , "a_overlaps" ,
"+" , "-" , "*" ,
"/" , "^" , "%" ,
"div"
]
}
},
"args": {
"type": "array",
"items": {
"oneOf": [
{"$ref": "#/$defs/characterExpression"},
{"$ref": "#/$defs/numericExpression"} ,
{"$dynamicRef": "#cql2expression"} ,
{"$ref": "#/$defs/spatialInstance"} ,
{"$ref": "#/$defs/temporalInstance"} ,
{"$ref": "#/$defs/arrayExpression"} ,
{"$ref": "#/$defs/propertyRef"}
]
}
}
}
},
"spatialInstance": {
"oneOf": [
{"$ref": "#/$defs/geometryLiteral"},
{"$ref": "#/$defs/bboxLiteral" }
]
},
"geometryLiteral": {
"oneOf": [
{"$ref": "#/$defs/point" },
{"$ref": "#/$defs/linestring" },
{"$ref": "#/$defs/polygon" },
{"$ref": "#/$defs/multipoint" },
{"$ref": "#/$defs/multilinestring" },
{"$ref": "#/$defs/multipolygon" },
{"$ref": "#/$defs/geometrycollection"}
]
},
"point": {
"title": "GeoJSON Point",
"type": "object",
"required": ["type", "coordinates"],
"properties": {
"type": { "type": "string", "enum": ["Point"] },
"coordinates": {
"type": "array",
"minItems": 2,
"items": {"type": "number"}
},
"bbox": { "type": "array", "minItems": 4, "items": {"type": "number"} }
}
},
"linestring": {
"title": "GeoJSON LineString",
"type": "object",
"required": ["type", "coordinates"],
"properties": {
"type": { "type": "string", "enum": ["LineString"] },
"coordinates": {
"type": "array",
"minItems": 2,
"items": {
"type": "array",
"minItems": 2,
"items": {"type": "number"}
}
},
"bbox": { "type": "array", "minItems": 4, "items": {"type": "number"} }
}
},
"polygon": {
"title": "GeoJSON Polygon",
"type": "object",
"required": ["type", "coordinates"],
"properties": {
"type": { "type": "string", "enum": ["Polygon"] },
"coordinates": {
"type": "array",
"items": {
"type": "array",
"minItems": 4,
"items": {
"type": "array",
"minItems": 2,
"items": {"type": "number"}
}
}
},
"bbox": { "type": "array", "minItems": 4, "items": {"type": "number"} }
}
},
"multipoint": {
"title": "GeoJSON MultiPoint",
"type": "object",
"required": ["type", "coordinates"],
"properties": {
"type": { "type": "string", "enum": ["MultiPoint"] },
"coordinates": {
"type": "array",
"items": {
"type": "array",
"minItems": 2,
"items": {"type": "number"}
}
},
"bbox": { "type": "array", "minItems": 4, "items": {"type": "number"} }
}
},
"multilinestring": {
"title": "GeoJSON MultiLineString",
"type": "object",
"required": ["type", "coordinates"],
"properties": {
"type": { "type": "string", "enum": ["MultiLineString"] },
"coordinates": {
"type": "array",
"items": {
"type": "array",
"minItems": 2,
"items": {
"type": "array",
"minItems": 2,
"items": {"type": "number"}
}
}
},
"bbox": { "type": "array", "minItems": 4, "items": {"type": "number"} }
}
},
"multipolygon": {
"title": "GeoJSON MultiPolygon",
"type": "object",
"required": ["type", "coordinates"],
"properties": {
"type": { "type": "string", "enum": ["MultiPolygon"] },
"coordinates": {
"type": "array",
"items": {
"type": "array",
"items": {
"type": "array",
"minItems": 4,
"items": {
"type": "array",
"minItems": 2,
"items": {"type": "number"}
}
}
}
},
"bbox": { "type": "array", "minItems": 4, "items": {"type": "number"} }
}
},
"geometrycollection": {
"title": "GeoJSON GeometryCollection",
"type": "object",
"required": ["type", "geometries"],
"properties": {
"type": { "type": "string", "enum": ["GeometryCollection"] },
"geometries": {
"type": "array",
"minItems": 2,
"items": {
"oneOf": [
{"$ref": "#/$defs/point" },
{"$ref": "#/$defs/linestring" },
{"$ref": "#/$defs/polygon" },
{"$ref": "#/$defs/multipoint" },
{"$ref": "#/$defs/multilinestring"},
{"$ref": "#/$defs/multipolygon" }
]
}
}
}
},
"bboxLiteral": {
"type": "object",
"required": ["bbox"],
"properties": { "bbox": {"$ref": "#/$defs/bbox"} }
},
"bbox": {
"type": "array",
"oneOf": [
{"minItems": 4, "maxItems": 4},
{"minItems": 6, "maxItems": 6}
],
"items": {"type": "number"}
},
"temporalInstance": {
"oneOf": [
{"$ref": "#/$defs/instantInstance" },
{"$ref": "#/$defs/intervalInstance"}
]
},
"instantInstance": {
"oneOf": [
{"$ref": "#/$defs/dateInstant" },
{"$ref": "#/$defs/timestampInstant"}
]
},
"dateInstant": {
"type": "object",
"required": ["date"],
"properties": { "date": {"$ref": "#/$defs/dateString"} }
},
"timestampInstant": {
"type": "object",
"required": ["timestamp"],
"properties": { "timestamp": {"$ref": "#/$defs/timestampString"} }
},
"instantString": {
"oneOf": [
{"$ref": "#/$defs/dateString" },
{"$ref": "#/$defs/timestampString"}
]
},
"dateString": {"type": "string", "pattern": "^\\d{4}-\\d{2}-\\d{2}$"},
"timestampString": {
"type" : "string" ,
"pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(?:\\.\\d+)?Z$"
},
"intervalInstance": {
"type": "object",
"required": ["interval"],
"properties": { "interval": {"$ref": "#/$defs/intervalArray"} }
},
"intervalArray": {
"type": "array",
"minItems": 2,
"maxItems": 2,
"items": {
"oneOf": [
{"$ref": "#/$defs/instantString"} ,
{ "type": "string", "enum": [".."] },
{"$ref": "#/$defs/propertyRef"} ,
{"$ref": "#/$defs/functionRef"}
]
}
}
}
}