Skip to content

Commit

Permalink
Merge pull request #31 from NOAA-GSL/chore/idsse-342/dsd-data-request
Browse files Browse the repository at this point in the history
DAS web message schemas
  • Loading branch information
Geary-Layne authored Oct 25, 2023
2 parents 29d7014 + 2a20494 commit 4e6b0c0
Show file tree
Hide file tree
Showing 9 changed files with 323 additions and 12 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"description": "Mechanism for making communicating a Criteria",
"description": "Mechanism for communicating a Criteria",
"allOf": [
{"$ref": "criteria.json#/Criteria"}
]
Expand Down
36 changes: 36 additions & 0 deletions python/idsse_common/idsse/common/schema/das_web_request.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"DasWebRequest": {
"description": "Mechanism for defining DAS data request via the web api",
"type": "object",
"properties": {
"issueDt": {"$ref": "timing.json#/TimeString"},
"valids": {"$ref": "timing.json#/TimeList"},
"dataRequest": {
"type": "string"
},
"parts": {
"type": "array",
"items": {"$ref": "translated_data.json#/SingleTranslatedData"},
"minItems": 1
},
"bbox": {
"type": "object",
"properties": {
"botLeft": {"type": "array", "items": {"type": "integer"}, "minItems": 2, "maxItems": 2},
"topRight": {"type": "array", "items": {"type": "integer"}, "minItems": 2, "maxItems": 2}
},
"required": [
"botLeft",
"topRight"
]
}
},
"required": [
"issueDt",
"valids",
"dataRequest",
"parts",
"bbox"
]
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"description": "Mechanism for making DAS web request",
"allOf": [
{"$ref": "das_web_request.json#/DasWebRequest"}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"description": "Mechanism for making DAS web request",
"allOf": [
{"$ref": "das_web_request.json#/DasWebRequest"}
],
"properties": {
"data": {
"description": "The keys in data are either a string datetime, 'scale', or 'offset' (nothing else allowed)",
"type": "object",
"patternProperties": {
"^(\\d{4})-(\\d{2})-(\\d{2})T(\\d{2}):(\\d{2}):(\\d{2}(?:\\.\\d*)?)((-(\\d{2}):(\\d{2})|Z)?)$": {
"type": "array",
"items": {
"type": "array",
"items": {
"type": "number"
}
}
},
"scale": {"type": "number"},
"offset": {"type": "number"},
"(?=^((?!((^|, )(scale|offset))+$).)*$)(?=[^0-9.+-:TZ])": {"not": {}}
}
}
},
"required": [
"data"
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,8 @@
"items": {"$ref": "risk_results.json#/RiskResults"},
"minItems": 1
}
}
},
"required": [
"riskResults"
]
}
3 changes: 1 addition & 2 deletions python/idsse_common/idsse/common/schema/field.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@
"FieldList": {
"description": "A list of specific field(s)",
"type": "array",
"items": {"$ref": "#/FieldName"},
"minItems": 1
"items": {"$ref": "#/FieldName"}
},

"Field": {
Expand Down
8 changes: 6 additions & 2 deletions python/idsse_common/idsse/common/schema/new_data.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,14 +63,18 @@
"field": {
"type": "object",
"patternProperties": {
"^(\\d{4})-0?(\\d+)-0?(\\d+)[T ]0?(\\d+):0?(\\d+):0?(\\d+)$": {"$ref": "field.json#/FieldList"},
"^(\\d{4})-(\\d{2})-(\\d{2})T(\\d{2}):(\\d{2}):(\\d{2}(?:\\.\\d*)?)((-(\\d{2}):(\\d{2})|Z)?)$": {
"$ref": "field.json#/FieldList"
},
"[^0-9.+-:TZ]": {"not": {}}
}
},
"missing": {
"type": "object",
"patternProperties": {
"^(\\d{4})-0?(\\d+)-0?(\\d+)[T ]0?(\\d+):0?(\\d+):0?(\\d+)$": {"$ref": "field.json#/FieldList"},
"^(\\d{4})-(\\d{2})-(\\d{2})T(\\d{2}):(\\d{2}):(\\d{2}(?:\\.\\d*)?)((-(\\d{2}):(\\d{2})|Z)?)$": {
"$ref": "field.json#/FieldList"
},
"[^0-9.+-:TZ]": {"not": {}}
}
}
Expand Down
46 changes: 46 additions & 0 deletions python/idsse_common/idsse/common/schema/translated_data.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,50 @@
{
"SingleTranslatedData": {
"description": "Specification of the data and thresholds that would result in an impact",
"type": "object",
"properties": {
"name": {"type": "string"},
"arealPercentage": {"type": "number"},
"duration": {"type": "number"},
"product": {"$ref": "product.json#/Product"},
"field": {"type": "string"},
"region": {"$ref": "region.json#/Region"},
"units": {"type": "string"},
"relational": {"type": "string"},
"thresh": {"type": "number"},
"mapping": {
"type": "object",
"properties": {
"min": {"type": "number"},
"max": {"type": "number"},
"clip": {
"oneOf" : [
{"type": "boolean"},
{"type": "string", "enum": ["true", "false"]}
]
}
},
"required": [
"min",
"max",
"clip"
]
}
},
"required": [
"name",
"arealPercentage",
"duration",
"product",
"field",
"region",
"units",
"relational",
"thresh",
"mapping"
]
},

"TranslatedData": {
"description": "Specification of the data and thresholds that would result in an impact",
"type": "object",
Expand Down
Loading

0 comments on commit 4e6b0c0

Please sign in to comment.