From d9f0b1bde86615dec608466407cfadee289be7e5 Mon Sep 17 00:00:00 2001 From: Stephen Appel Date: Sun, 4 Feb 2024 19:40:38 -0600 Subject: [PATCH 01/13] Create 1.0.0.schema.json --- specification/1.0.0.schema.json | 353 ++++++++++++++++++++++++++++++++ 1 file changed, 353 insertions(+) create mode 100644 specification/1.0.0.schema.json diff --git a/specification/1.0.0.schema.json b/specification/1.0.0.schema.json new file mode 100644 index 0000000..adf3c3f --- /dev/null +++ b/specification/1.0.0.schema.json @@ -0,0 +1,353 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "https://openindexmaps.org/openindexmap.schema.json", + "title": "OpenIndexMap", + "description": "Describes an OpenIndexMap according to specification version 1.0.0.", + "type": "object", + "properties": { + "type": { + "enum": [ + "FeatureCollection" + ] + }, + "features": { + "type": "array", + "items": { + "$ref": "#/definitions/sheetOrFrame" + } + } + }, + "definitions": { + "sheetOrFrame": { + "type": "object", + "properties": { + "type": { + "enum": [ + "Feature" + ] + }, + "geometry": { + "type": "object", + "oneOf": [ + { + "$ref": "#/definitions/polygonGeometry" + }, + { + "$ref": "#/definitions/multiPolygonGeometry" + }, + { + "$ref": "#/definitions/pointGeometry" + }, + { + "$ref": "#/definitions/lineStringGeometry" + } + ] + }, + "properties": { + "type": "object", + "properties": { + "label": { + "type": "string", + "description": "Alphanumeric code identifying the sheet or frame. The value of this field is used as a tool tip in GeoBlacklight." + }, + "labelAlt": { + "type": "string", + "description": "Alphanumeric code for the sheet or frame that was used for previous or subsequent editions, or for when there are multiple labels." + }, + "labelAlt2": { + "type": "string", + "description": "Alphanumeric code for the sheet or frame when there are multiple labels." + }, + "datePub": { + "type": "string", + "description": "The date that the sheet or frame was published or made available." + }, + "date": { + "type": "string", + "description": "Used when no other date field is relevant." + }, + "west": { + "type": "number", + "description": "Farthest west extent of the sheet/frame bounding box (using the Greenwich Meridian)." + }, + "east": { + "type": "number", + "description": "Farthest east extent of the sheet/frame bounding box (using the Greenwich Meridian)." + }, + "north": { + "type": "number", + "description": "Farthest north extent of the sheet/frame bounding box." + }, + "south": { + "type": "number", + "description": "Farthest south extent of the sheet/frame bounding box." + }, + "location": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Geographic place name identifying the area covered by the map sheet or air photo frame." + }, + "scale": { + "type": "string", + "description": "Scale statement (representative fraction plus qualifiers) of the individual sheet/frame." + }, + "color": { + "type": "string", + "description": "Indicates whether the sheet/frame is color, black and white, color infrared or another color type." + }, + "title": { + "type": "string", + "description": "Title of map, usually a geographic location on that sheet." + }, + "titleAlt": { + "type": "string", + "description": "Alternate title for the sheet that was used for previous or subsequent editions, or for when there are multiple titles." + }, + "dateSurvey": { + "type": "string", + "description": "Date that the map sheet was surveyed." + }, + "datePhoto": { + "type": "string", + "description": "Date that the map sheet was photocorrected." + }, + "dateReprnt": { + "type": "string", + "description": "Date that the map sheet was reprinted." + }, + "overprint": { + "type": "string", + "description": "no description given" + }, + "edition": { + "type": "string", + "description": "Statement indicating the edition of the map sheet." + }, + "publisher": { + "type": "string", + "description": "Publisher of the individual sheet (can be used if publishers vary within a map set)." + }, + "overlays": { + "type": "string", + "description": "no description given" + }, + "projection": { + "type": "string", + "description": "The map’s or photo’s projection, coordinate system and datum." + }, + "lcCallNo": { + "type": "string", + "description": "Library of Congress call number." + }, + "contLines": { + "type": "boolean", + "description": "Indication of whether or not there are contour lines on the map." + }, + "contInterv": { + "type": "string", + "description": "Distance between contour lines. Include unit (or abbreviation)." + }, + "bathLines": { + "type": "boolean", + "description": "Indication of whether or not there are bathymetric contour lines on the map." + }, + "bathInterv": { + "type": "string", + "description": "Distance between bathymetric contour lines. Include unit (or abbreviation)." + }, + "primeMer": { + "type": "string", + "description": "Indicates a prime meridian other than Greenwich." + }, + "photomos": { + "type": "boolean", + "description": "Indication that the image is a mosaic of several air photos." + }, + "bands": { + "type": "string", + "description": "Spectral bands present (near infrared, red, green, blue, etc.)." + }, + "rectificn": { + "type": "string", + "description": "Any corrections done to adjust the air photo image." + }, + "rollNo": { + "type": "string", + "description": "Identifier for the film reel from which the air photo comes." + }, + "inst": { + "type": "string", + "description": "Local institution holding material." + }, + "sheetId": { + "type": "string", + "description": "Local institution’s unique identifier for the sheet/frame." + }, + "available": { + "type": "boolean", + "description": "Indication if the institution holds the item at this location in any format." + }, + "physHold": { + "type": "string", + "description": "Indication if the institution holds the item in a physical format, or a link to information about the physical object." + }, + "digHold": { + "type": "string", + "description": "Indication if the institution holds the item in a digital format, or a link to information about the digital object, or a link to the digital object itself." + }, + "instCallNo": { + "type": "string", + "description": "Call number used locally (other than Library of Congress call number)." + }, + "recId": { + "type": "string", + "description": "Local institution’s unique identifier for the digital object." + }, + "download": { + "type": "string", + "format": "uri", + "description": "Link used to directly download the digital object." + }, + "websiteUrl": { + "type": "string", + "format": "uri", + "description": "Link used to direct users to a website with metadata or a download link for the digital object." + }, + "thumbUrl": { + "type": "string", + "format": "uri", + "description": "Link used to access the thumbnail for the digital object." + }, + "iiifUrl": { + "type": "string", + "format": "uri", + "description": "Link used to access the digital image using IIIF." + }, + "fileName": { + "type": "string", + "description": "Digital file associated with sheet/frame." + }, + "note": { + "type": "string", + "description": "Free text for local comments as well as general notes applying to everyone’s copy." + } + }, + "required": [ + "label", + "west", + "east", + "north", + "south" + ] + } + }, + "required": [ + "type", + "geometry", + "properties" + ] + }, + "polygonGeometry": { + "type": "object", + "properties": { + "type": { + "enum": [ + "Polygon" + ] + }, + "coordinates": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "number" + } + } + } + } + }, + "required": [ + "type", + "coordinates" + ] + }, + "multiPolygonGeometry": { + "type": "object", + "properties": { + "type": { + "enum": [ + "MultiPolygon" + ] + }, + "coordinates": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "number" + } + } + } + } + } + }, + "required": [ + "type", + "coordinates" + ] + }, + "pointGeometry": { + "type": "object", + "properties": { + "type": { + "enum": [ + "Point" + ] + }, + "coordinates": { + "type": "array", + "items": { + "type": "number" + }, + "minItems": 2, + "maxItems": 3 + } + }, + "required": [ + "type", + "coordinates" + ] + }, + "lineStringGeometry": { + "type": "object", + "properties": { + "type": { + "enum": [ + "LineString" + ] + }, + "coordinates": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "number" + } + } + } + }, + "required": [ + "type", + "coordinates" + ] + } + } +} From 0e6e810767c0b541abfe0890cd64a7dd4cfbb26e Mon Sep 17 00:00:00 2001 From: Stephen Appel Date: Mon, 5 Feb 2024 10:49:18 -0600 Subject: [PATCH 02/13] allow null values for all but required elements --- specification/1.0.0.schema.json | 82 ++++++++++++++++----------------- 1 file changed, 41 insertions(+), 41 deletions(-) diff --git a/specification/1.0.0.schema.json b/specification/1.0.0.schema.json index adf3c3f..72b4fcd 100644 --- a/specification/1.0.0.schema.json +++ b/specification/1.0.0.schema.json @@ -51,19 +51,19 @@ "description": "Alphanumeric code identifying the sheet or frame. The value of this field is used as a tool tip in GeoBlacklight." }, "labelAlt": { - "type": "string", + "type": ["string", "null"], "description": "Alphanumeric code for the sheet or frame that was used for previous or subsequent editions, or for when there are multiple labels." }, "labelAlt2": { - "type": "string", + "type": ["string", "null"], "description": "Alphanumeric code for the sheet or frame when there are multiple labels." }, "datePub": { - "type": "string", + "type": ["string", "null"], "description": "The date that the sheet or frame was published or made available." }, "date": { - "type": "string", + "type": ["string", "null"], "description": "Used when no other date field is relevant." }, "west": { @@ -83,154 +83,154 @@ "description": "Farthest south extent of the sheet/frame bounding box." }, "location": { - "type": "array", + "type": ["array", "null"], "items": { - "type": "string" + "type": ["string", "null"] }, "description": "Geographic place name identifying the area covered by the map sheet or air photo frame." }, "scale": { - "type": "string", + "type": ["string", "null"], "description": "Scale statement (representative fraction plus qualifiers) of the individual sheet/frame." }, "color": { - "type": "string", + "type": ["string", "null"], "description": "Indicates whether the sheet/frame is color, black and white, color infrared or another color type." }, "title": { - "type": "string", + "type": ["string", "null"], "description": "Title of map, usually a geographic location on that sheet." }, "titleAlt": { - "type": "string", + "type": ["string", "null"], "description": "Alternate title for the sheet that was used for previous or subsequent editions, or for when there are multiple titles." }, "dateSurvey": { - "type": "string", + "type": ["string", "null"], "description": "Date that the map sheet was surveyed." }, "datePhoto": { - "type": "string", + "type": ["string", "null"], "description": "Date that the map sheet was photocorrected." }, "dateReprnt": { - "type": "string", + "type": ["string", "null"], "description": "Date that the map sheet was reprinted." }, "overprint": { - "type": "string", + "type": ["string", "null"], "description": "no description given" }, "edition": { - "type": "string", + "type": ["string", "null"], "description": "Statement indicating the edition of the map sheet." }, "publisher": { - "type": "string", + "type": ["string", "null"], "description": "Publisher of the individual sheet (can be used if publishers vary within a map set)." }, "overlays": { - "type": "string", + "type": ["string", "null"], "description": "no description given" }, "projection": { - "type": "string", + "type": ["string", "null"], "description": "The map’s or photo’s projection, coordinate system and datum." }, "lcCallNo": { - "type": "string", + "type": ["string", "null"], "description": "Library of Congress call number." }, "contLines": { - "type": "boolean", + "type": ["boolean", "null"], "description": "Indication of whether or not there are contour lines on the map." }, "contInterv": { - "type": "string", + "type": ["string", "null"], "description": "Distance between contour lines. Include unit (or abbreviation)." }, "bathLines": { - "type": "boolean", + "type": ["boolean", "null"], "description": "Indication of whether or not there are bathymetric contour lines on the map." }, "bathInterv": { - "type": "string", + "type": ["string", "null"], "description": "Distance between bathymetric contour lines. Include unit (or abbreviation)." }, "primeMer": { - "type": "string", + "type": ["string", "null"], "description": "Indicates a prime meridian other than Greenwich." }, "photomos": { - "type": "boolean", + "type": ["boolean", "null"], "description": "Indication that the image is a mosaic of several air photos." }, "bands": { - "type": "string", + "type": ["string", "null"], "description": "Spectral bands present (near infrared, red, green, blue, etc.)." }, "rectificn": { - "type": "string", + "type": ["string", "null"], "description": "Any corrections done to adjust the air photo image." }, "rollNo": { - "type": "string", + "type": ["string", "null"], "description": "Identifier for the film reel from which the air photo comes." }, "inst": { - "type": "string", + "type": ["string", "null"], "description": "Local institution holding material." }, "sheetId": { - "type": "string", + "type": ["string", "null"], "description": "Local institution’s unique identifier for the sheet/frame." }, "available": { - "type": "boolean", + "type": ["boolean", "null"], "description": "Indication if the institution holds the item at this location in any format." }, "physHold": { - "type": "string", + "type": ["string", "null"], "description": "Indication if the institution holds the item in a physical format, or a link to information about the physical object." }, "digHold": { - "type": "string", + "type": ["string", "null"], "description": "Indication if the institution holds the item in a digital format, or a link to information about the digital object, or a link to the digital object itself." }, "instCallNo": { - "type": "string", + "type": ["string", "null"], "description": "Call number used locally (other than Library of Congress call number)." }, "recId": { - "type": "string", + "type": ["string", "null"], "description": "Local institution’s unique identifier for the digital object." }, "download": { - "type": "string", + "type": ["string", "null"], "format": "uri", "description": "Link used to directly download the digital object." }, "websiteUrl": { - "type": "string", + "type": ["string", "null"], "format": "uri", "description": "Link used to direct users to a website with metadata or a download link for the digital object." }, "thumbUrl": { - "type": "string", + "type": ["string", "null"], "format": "uri", "description": "Link used to access the thumbnail for the digital object." }, "iiifUrl": { - "type": "string", + "type": ["string", "null"], "format": "uri", "description": "Link used to access the digital image using IIIF." }, "fileName": { - "type": "string", + "type": ["string", "null"], "description": "Digital file associated with sheet/frame." }, "note": { - "type": "string", + "type": ["string", "null"], "description": "Free text for local comments as well as general notes applying to everyone’s copy." } }, From cd16508ec46b52a9a0be3c6d0d96718068f392f7 Mon Sep 17 00:00:00 2001 From: Stephen Appel Date: Mon, 5 Feb 2024 11:22:20 -0600 Subject: [PATCH 03/13] adds additional geometry types to 1.0.0 json schema --- specification/1.0.0.schema.json | 136 +++++++++++++++++++++++++++++++- 1 file changed, 133 insertions(+), 3 deletions(-) diff --git a/specification/1.0.0.schema.json b/specification/1.0.0.schema.json index 72b4fcd..e6c4fb3 100644 --- a/specification/1.0.0.schema.json +++ b/specification/1.0.0.schema.json @@ -40,6 +40,18 @@ }, { "$ref": "#/definitions/lineStringGeometry" + }, + { + "$ref": "#/definitions/multiPointGeometry" + }, + { + "$ref": "#/definitions/multiLineStringGeometry" + }, + { + "$ref": "#/definitions/multiPolygonGeometry" + }, + { + "$ref": "#/definitions/geometryCollection" } ] }, @@ -268,6 +280,13 @@ } } } + }, + "bbox": { + "type": "array", + "minItems": 4, + "items": { + "type": "number" + } } }, "required": [ @@ -297,6 +316,13 @@ } } } + }, + "bbox": { + "type": "array", + "minItems": 4, + "items": { + "type": "number" + } } }, "required": [ @@ -314,11 +340,17 @@ }, "coordinates": { "type": "array", + "minItems": 2, "items": { "type": "number" - }, - "minItems": 2, - "maxItems": 3 + } + }, + "bbox": { + "type": "array", + "minItems": 4, + "items": { + "type": "number" + } } }, "required": [ @@ -342,12 +374,110 @@ "type": "number" } } + }, + "bbox": { + "type": "array", + "minItems": 4, + "items": { + "type": "number" + } + } + }, + "required": [ + "type", + "coordinates" + ] + }, + "multiPointGeometry": { + "type": "object", + "properties": { + "type": { + "enum": [ + "MultiPoint" + ] + }, + "coordinates": { + "type": "array", + "items": { + "type": "array", + "minItems": 2, + "items": { + "type": "number" + } + } + }, + "bbox": { + "type": "array", + "minItems": 4, + "items": { + "type": "number" + } + } + }, + "required": [ + "type", + "coordinates" + ] + }, + "multiLineStringGeometry": { + "type": "object", + "properties": { + "type": { + "enum": [ + "MultiLineString" + ] + }, + "coordinates": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "number" + } + } + } + }, + "bbox": { + "type": "array", + "minItems": 4, + "items": { + "type": "number" + } } }, "required": [ "type", "coordinates" ] + }, + "geometryCollection": { + "type": "object", + "properties": { + "type": { + "enum": [ + "GeometryCollection" + ] + }, + "geometries": { + "type": "array", + "items": { + "$ref": "#/definitions/sheetOrFrame" + } + }, + "bbox": { + "type": "array", + "minItems": 4, + "items": { + "type": "number" + } + } + }, + "required": [ + "type", + "geometries" + ] } } } From 5dcdf38a60d2090595ee7802b2be3e8f0bd8e4a7 Mon Sep 17 00:00:00 2001 From: Stephen Appel Date: Mon, 5 Feb 2024 11:29:19 -0600 Subject: [PATCH 04/13] fixed type enum in 1.0.0 json schema --- specification/1.0.0.schema.json | 31 ++++++++++++++----------------- 1 file changed, 14 insertions(+), 17 deletions(-) diff --git a/specification/1.0.0.schema.json b/specification/1.0.0.schema.json index e6c4fb3..ea86fc2 100644 --- a/specification/1.0.0.schema.json +++ b/specification/1.0.0.schema.json @@ -30,28 +30,25 @@ "type": "object", "oneOf": [ { - "$ref": "#/definitions/polygonGeometry" + "$ref": "#/definitions/Polygon" }, { - "$ref": "#/definitions/multiPolygonGeometry" + "$ref": "#/definitions/MultiPolygon" }, { - "$ref": "#/definitions/pointGeometry" + "$ref": "#/definitions/Point" }, { - "$ref": "#/definitions/lineStringGeometry" + "$ref": "#/definitions/LineString" }, { - "$ref": "#/definitions/multiPointGeometry" + "$ref": "#/definitions/MultiPoint" }, { - "$ref": "#/definitions/multiLineStringGeometry" + "$ref": "#/definitions/MultiLineString" }, { - "$ref": "#/definitions/multiPolygonGeometry" - }, - { - "$ref": "#/definitions/geometryCollection" + "$ref": "#/definitions/GeometryCollection" } ] }, @@ -261,7 +258,7 @@ "properties" ] }, - "polygonGeometry": { + "Polygon": { "type": "object", "properties": { "type": { @@ -294,7 +291,7 @@ "coordinates" ] }, - "multiPolygonGeometry": { + "MultiPolygon": { "type": "object", "properties": { "type": { @@ -330,7 +327,7 @@ "coordinates" ] }, - "pointGeometry": { + "Point": { "type": "object", "properties": { "type": { @@ -358,7 +355,7 @@ "coordinates" ] }, - "lineStringGeometry": { + "LineString": { "type": "object", "properties": { "type": { @@ -388,7 +385,7 @@ "coordinates" ] }, - "multiPointGeometry": { + "MultiPoint": { "type": "object", "properties": { "type": { @@ -419,7 +416,7 @@ "coordinates" ] }, - "multiLineStringGeometry": { + "MultiLineString": { "type": "object", "properties": { "type": { @@ -452,7 +449,7 @@ "coordinates" ] }, - "geometryCollection": { + "GeometryCollection": { "type": "object", "properties": { "type": { From 721a3dc91c1b35fc660f87d7ad9c46937a929bbc Mon Sep 17 00:00:00 2001 From: Stephen Appel Date: Mon, 5 Feb 2024 12:40:45 -0600 Subject: [PATCH 05/13] simplifies json schema geometry reference --- specification/1.0.0.schema.json | 242 +------------------------------- 1 file changed, 1 insertion(+), 241 deletions(-) diff --git a/specification/1.0.0.schema.json b/specification/1.0.0.schema.json index ea86fc2..2ca3e3d 100644 --- a/specification/1.0.0.schema.json +++ b/specification/1.0.0.schema.json @@ -28,29 +28,7 @@ }, "geometry": { "type": "object", - "oneOf": [ - { - "$ref": "#/definitions/Polygon" - }, - { - "$ref": "#/definitions/MultiPolygon" - }, - { - "$ref": "#/definitions/Point" - }, - { - "$ref": "#/definitions/LineString" - }, - { - "$ref": "#/definitions/MultiPoint" - }, - { - "$ref": "#/definitions/MultiLineString" - }, - { - "$ref": "#/definitions/GeometryCollection" - } - ] + "$ref": "https://geojson.org/schema/Geometry.json" }, "properties": { "type": "object", @@ -257,224 +235,6 @@ "geometry", "properties" ] - }, - "Polygon": { - "type": "object", - "properties": { - "type": { - "enum": [ - "Polygon" - ] - }, - "coordinates": { - "type": "array", - "items": { - "type": "array", - "items": { - "type": "array", - "items": { - "type": "number" - } - } - } - }, - "bbox": { - "type": "array", - "minItems": 4, - "items": { - "type": "number" - } - } - }, - "required": [ - "type", - "coordinates" - ] - }, - "MultiPolygon": { - "type": "object", - "properties": { - "type": { - "enum": [ - "MultiPolygon" - ] - }, - "coordinates": { - "type": "array", - "items": { - "type": "array", - "items": { - "type": "array", - "items": { - "type": "array", - "items": { - "type": "number" - } - } - } - } - }, - "bbox": { - "type": "array", - "minItems": 4, - "items": { - "type": "number" - } - } - }, - "required": [ - "type", - "coordinates" - ] - }, - "Point": { - "type": "object", - "properties": { - "type": { - "enum": [ - "Point" - ] - }, - "coordinates": { - "type": "array", - "minItems": 2, - "items": { - "type": "number" - } - }, - "bbox": { - "type": "array", - "minItems": 4, - "items": { - "type": "number" - } - } - }, - "required": [ - "type", - "coordinates" - ] - }, - "LineString": { - "type": "object", - "properties": { - "type": { - "enum": [ - "LineString" - ] - }, - "coordinates": { - "type": "array", - "items": { - "type": "array", - "items": { - "type": "number" - } - } - }, - "bbox": { - "type": "array", - "minItems": 4, - "items": { - "type": "number" - } - } - }, - "required": [ - "type", - "coordinates" - ] - }, - "MultiPoint": { - "type": "object", - "properties": { - "type": { - "enum": [ - "MultiPoint" - ] - }, - "coordinates": { - "type": "array", - "items": { - "type": "array", - "minItems": 2, - "items": { - "type": "number" - } - } - }, - "bbox": { - "type": "array", - "minItems": 4, - "items": { - "type": "number" - } - } - }, - "required": [ - "type", - "coordinates" - ] - }, - "MultiLineString": { - "type": "object", - "properties": { - "type": { - "enum": [ - "MultiLineString" - ] - }, - "coordinates": { - "type": "array", - "items": { - "type": "array", - "items": { - "type": "array", - "items": { - "type": "number" - } - } - } - }, - "bbox": { - "type": "array", - "minItems": 4, - "items": { - "type": "number" - } - } - }, - "required": [ - "type", - "coordinates" - ] - }, - "GeometryCollection": { - "type": "object", - "properties": { - "type": { - "enum": [ - "GeometryCollection" - ] - }, - "geometries": { - "type": "array", - "items": { - "$ref": "#/definitions/sheetOrFrame" - } - }, - "bbox": { - "type": "array", - "minItems": 4, - "items": { - "type": "number" - } - } - }, - "required": [ - "type", - "geometries" - ] } } } From 57d089727c4918c4e5c87ec1b40a6c4fb7e4d7d9 Mon Sep 17 00:00:00 2001 From: Stephen Appel Date: Mon, 5 Feb 2024 12:45:48 -0600 Subject: [PATCH 06/13] further simplification of json schema by removing definition references --- specification/1.0.0.schema.json | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/specification/1.0.0.schema.json b/specification/1.0.0.schema.json index 2ca3e3d..653cfa2 100644 --- a/specification/1.0.0.schema.json +++ b/specification/1.0.0.schema.json @@ -13,13 +13,7 @@ "features": { "type": "array", "items": { - "$ref": "#/definitions/sheetOrFrame" - } - } - }, - "definitions": { - "sheetOrFrame": { - "type": "object", + "type": "object", "properties": { "type": { "enum": [ @@ -235,6 +229,7 @@ "geometry", "properties" ] + } } } } From 497812054a79a2df4576c8afea011fc31d618f77 Mon Sep 17 00:00:00 2001 From: Stephen Appel Date: Mon, 15 Apr 2024 15:07:32 -0500 Subject: [PATCH 07/13] Remove required elements --- specification/1.0.0.schema.json | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/specification/1.0.0.schema.json b/specification/1.0.0.schema.json index 653cfa2..eb82c9a 100644 --- a/specification/1.0.0.schema.json +++ b/specification/1.0.0.schema.json @@ -28,7 +28,7 @@ "type": "object", "properties": { "label": { - "type": "string", + "type": ["string", "null"], "description": "Alphanumeric code identifying the sheet or frame. The value of this field is used as a tool tip in GeoBlacklight." }, "labelAlt": { @@ -48,19 +48,19 @@ "description": "Used when no other date field is relevant." }, "west": { - "type": "number", + "type": ["number", "null"], "description": "Farthest west extent of the sheet/frame bounding box (using the Greenwich Meridian)." }, "east": { - "type": "number", + "type": ["number", "null"], "description": "Farthest east extent of the sheet/frame bounding box (using the Greenwich Meridian)." }, "north": { - "type": "number", + "type": ["number", "null"], "description": "Farthest north extent of the sheet/frame bounding box." }, "south": { - "type": "number", + "type": ["number", "null"], "description": "Farthest south extent of the sheet/frame bounding box." }, "location": { @@ -214,14 +214,7 @@ "type": ["string", "null"], "description": "Free text for local comments as well as general notes applying to everyone’s copy." } - }, - "required": [ - "label", - "west", - "east", - "north", - "south" - ] + } } }, "required": [ From da6c18456bf608d17f1232c488637ef7d84393fa Mon Sep 17 00:00:00 2001 From: Stephen Appel Date: Tue, 21 May 2024 10:27:11 -0500 Subject: [PATCH 08/13] add link to JSON schema to index.md --- index.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/index.md b/index.md index 3b2ba9f..1f1be1e 100644 --- a/index.md +++ b/index.md @@ -62,6 +62,10 @@ OpenIndexMaps should be valid GeoJSON. ## Helpful Resources +### JSON Schema + +A [JSON Schema file](specification/1.0.0.schema.json) is available for validation. + ### Converter A [converter](https://openindexmaps.org/converter) is available for converting shapefile index maps to OpenIndexMaps GeoJSON. From b7de89a73379e2095a32c701874ffff8d6d634a2 Mon Sep 17 00:00:00 2001 From: Stephen Appel Date: Thu, 23 May 2024 21:25:19 -0500 Subject: [PATCH 09/13] validates 10 char limit, camel case --- specification/1.0.0.schema.json | 554 ++++++++++++++++++++------------ 1 file changed, 351 insertions(+), 203 deletions(-) diff --git a/specification/1.0.0.schema.json b/specification/1.0.0.schema.json index eb82c9a..bb71c98 100644 --- a/specification/1.0.0.schema.json +++ b/specification/1.0.0.schema.json @@ -14,214 +14,362 @@ "type": "array", "items": { "type": "object", - "properties": { - "type": { - "enum": [ - "Feature" - ] - }, - "geometry": { - "type": "object", - "$ref": "https://geojson.org/schema/Geometry.json" - }, "properties": { - "type": "object", + "type": { + "enum": [ + "Feature" + ] + }, + "geometry": { + "type": "object", + "$ref": "https://geojson.org/schema/Geometry.json" + }, "properties": { - "label": { - "type": ["string", "null"], - "description": "Alphanumeric code identifying the sheet or frame. The value of this field is used as a tool tip in GeoBlacklight." - }, - "labelAlt": { - "type": ["string", "null"], - "description": "Alphanumeric code for the sheet or frame that was used for previous or subsequent editions, or for when there are multiple labels." - }, - "labelAlt2": { - "type": ["string", "null"], - "description": "Alphanumeric code for the sheet or frame when there are multiple labels." - }, - "datePub": { - "type": ["string", "null"], - "description": "The date that the sheet or frame was published or made available." - }, - "date": { - "type": ["string", "null"], - "description": "Used when no other date field is relevant." - }, - "west": { - "type": ["number", "null"], - "description": "Farthest west extent of the sheet/frame bounding box (using the Greenwich Meridian)." - }, - "east": { - "type": ["number", "null"], - "description": "Farthest east extent of the sheet/frame bounding box (using the Greenwich Meridian)." - }, - "north": { - "type": ["number", "null"], - "description": "Farthest north extent of the sheet/frame bounding box." - }, - "south": { - "type": ["number", "null"], - "description": "Farthest south extent of the sheet/frame bounding box." - }, - "location": { - "type": ["array", "null"], - "items": { - "type": ["string", "null"] + "type": "object", + "additionalProperties": true, + "patternProperties": { + "^[a-z][a-zA-Z0-9]{0,9}$": {}, + "^[a-z][a-zA-Z0-9]*[A-Z]{2,}[a-zA-Z0-9]*$": { + "not": {} }, - "description": "Geographic place name identifying the area covered by the map sheet or air photo frame." - }, - "scale": { - "type": ["string", "null"], - "description": "Scale statement (representative fraction plus qualifiers) of the individual sheet/frame." - }, - "color": { - "type": ["string", "null"], - "description": "Indicates whether the sheet/frame is color, black and white, color infrared or another color type." - }, - "title": { - "type": ["string", "null"], - "description": "Title of map, usually a geographic location on that sheet." - }, - "titleAlt": { - "type": ["string", "null"], - "description": "Alternate title for the sheet that was used for previous or subsequent editions, or for when there are multiple titles." - }, - "dateSurvey": { - "type": ["string", "null"], - "description": "Date that the map sheet was surveyed." - }, - "datePhoto": { - "type": ["string", "null"], - "description": "Date that the map sheet was photocorrected." - }, - "dateReprnt": { - "type": ["string", "null"], - "description": "Date that the map sheet was reprinted." - }, - "overprint": { - "type": ["string", "null"], - "description": "no description given" - }, - "edition": { - "type": ["string", "null"], - "description": "Statement indicating the edition of the map sheet." - }, - "publisher": { - "type": ["string", "null"], - "description": "Publisher of the individual sheet (can be used if publishers vary within a map set)." - }, - "overlays": { - "type": ["string", "null"], - "description": "no description given" - }, - "projection": { - "type": ["string", "null"], - "description": "The map’s or photo’s projection, coordinate system and datum." - }, - "lcCallNo": { - "type": ["string", "null"], - "description": "Library of Congress call number." - }, - "contLines": { - "type": ["boolean", "null"], - "description": "Indication of whether or not there are contour lines on the map." - }, - "contInterv": { - "type": ["string", "null"], - "description": "Distance between contour lines. Include unit (or abbreviation)." - }, - "bathLines": { - "type": ["boolean", "null"], - "description": "Indication of whether or not there are bathymetric contour lines on the map." - }, - "bathInterv": { - "type": ["string", "null"], - "description": "Distance between bathymetric contour lines. Include unit (or abbreviation)." - }, - "primeMer": { - "type": ["string", "null"], - "description": "Indicates a prime meridian other than Greenwich." - }, - "photomos": { - "type": ["boolean", "null"], - "description": "Indication that the image is a mosaic of several air photos." - }, - "bands": { - "type": ["string", "null"], - "description": "Spectral bands present (near infrared, red, green, blue, etc.)." - }, - "rectificn": { - "type": ["string", "null"], - "description": "Any corrections done to adjust the air photo image." - }, - "rollNo": { - "type": ["string", "null"], - "description": "Identifier for the film reel from which the air photo comes." - }, - "inst": { - "type": ["string", "null"], - "description": "Local institution holding material." - }, - "sheetId": { - "type": ["string", "null"], - "description": "Local institution’s unique identifier for the sheet/frame." - }, - "available": { - "type": ["boolean", "null"], - "description": "Indication if the institution holds the item at this location in any format." - }, - "physHold": { - "type": ["string", "null"], - "description": "Indication if the institution holds the item in a physical format, or a link to information about the physical object." - }, - "digHold": { - "type": ["string", "null"], - "description": "Indication if the institution holds the item in a digital format, or a link to information about the digital object, or a link to the digital object itself." - }, - "instCallNo": { - "type": ["string", "null"], - "description": "Call number used locally (other than Library of Congress call number)." - }, - "recId": { - "type": ["string", "null"], - "description": "Local institution’s unique identifier for the digital object." - }, - "download": { - "type": ["string", "null"], - "format": "uri", - "description": "Link used to directly download the digital object." - }, - "websiteUrl": { - "type": ["string", "null"], - "format": "uri", - "description": "Link used to direct users to a website with metadata or a download link for the digital object." - }, - "thumbUrl": { - "type": ["string", "null"], - "format": "uri", - "description": "Link used to access the thumbnail for the digital object." - }, - "iiifUrl": { - "type": ["string", "null"], - "format": "uri", - "description": "Link used to access the digital image using IIIF." - }, - "fileName": { - "type": ["string", "null"], - "description": "Digital file associated with sheet/frame." - }, - "note": { - "type": ["string", "null"], - "description": "Free text for local comments as well as general notes applying to everyone’s copy." + "^.{11,}$": { + "not": {} + } + }, + "properties": { + "label": { + "type": [ + "string", + "null" + ], + "description": "Alphanumeric code identifying the sheet or frame. The value of this field is used as a tool tip in GeoBlacklight." + }, + "labelAlt": { + "type": [ + "string", + "null" + ], + "description": "Alphanumeric code for the sheet or frame that was used for previous or subsequent editions, or for when there are multiple labels." + }, + "labelAlt2": { + "type": [ + "string", + "null" + ], + "description": "Alphanumeric code for the sheet or frame when there are multiple labels." + }, + "datePub": { + "type": [ + "string", + "null" + ], + "description": "The date that the sheet or frame was published or made available." + }, + "date": { + "type": [ + "string", + "null" + ], + "description": "Used when no other date field is relevant." + }, + "west": { + "type": [ + "number", + "null" + ], + "description": "Farthest west extent of the sheet/frame bounding box (using the Greenwich Meridian)." + }, + "east": { + "type": [ + "number", + "null" + ], + "description": "Farthest east extent of the sheet/frame bounding box (using the Greenwich Meridian)." + }, + "north": { + "type": [ + "number", + "null" + ], + "description": "Farthest north extent of the sheet/frame bounding box." + }, + "south": { + "type": [ + "number", + "null" + ], + "description": "Farthest south extent of the sheet/frame bounding box." + }, + "location": { + "type": [ + "array", + "null" + ], + "items": { + "type": [ + "string", + "null" + ] + }, + "description": "Geographic place name identifying the area covered by the map sheet or air photo frame." + }, + "scale": { + "type": [ + "string", + "null" + ], + "description": "Scale statement (representative fraction plus qualifiers) of the individual sheet/frame." + }, + "color": { + "type": [ + "string", + "null" + ], + "description": "Indicates whether the sheet/frame is color, black and white, color infrared or another color type." + }, + "title": { + "type": [ + "string", + "null" + ], + "description": "Title of map, usually a geographic location on that sheet." + }, + "titleAlt": { + "type": [ + "string", + "null" + ], + "description": "Alternate title for the sheet that was used for previous or subsequent editions, or for when there are multiple titles." + }, + "dateSurvey": { + "type": [ + "string", + "null" + ], + "description": "Date that the map sheet was surveyed." + }, + "datePhoto": { + "type": [ + "string", + "null" + ], + "description": "Date that the map sheet was photocorrected." + }, + "dateReprnt": { + "type": [ + "string", + "null" + ], + "description": "Date that the map sheet was reprinted." + }, + "overprint": { + "type": [ + "string", + "null" + ], + "description": "no description given" + }, + "edition": { + "type": [ + "string", + "null" + ], + "description": "Statement indicating the edition of the map sheet." + }, + "publisher": { + "type": [ + "string", + "null" + ], + "description": "Publisher of the individual sheet (can be used if publishers vary within a map set)." + }, + "overlays": { + "type": [ + "string", + "null" + ], + "description": "no description given" + }, + "projection": { + "type": [ + "string", + "null" + ], + "description": "The map’s or photo’s projection, coordinate system and datum." + }, + "lcCallNo": { + "type": [ + "string", + "null" + ], + "description": "Library of Congress call number." + }, + "contLines": { + "type": [ + "boolean", + "null" + ], + "description": "Indication of whether or not there are contour lines on the map." + }, + "contInterv": { + "type": [ + "string", + "null" + ], + "description": "Distance between contour lines. Include unit (or abbreviation)." + }, + "bathLines": { + "type": [ + "boolean", + "null" + ], + "description": "Indication of whether or not there are bathymetric contour lines on the map." + }, + "bathInterv": { + "type": [ + "string", + "null" + ], + "description": "Distance between bathymetric contour lines. Include unit (or abbreviation)." + }, + "primeMer": { + "type": [ + "string", + "null" + ], + "description": "Indicates a prime meridian other than Greenwich." + }, + "photomos": { + "type": [ + "boolean", + "null" + ], + "description": "Indication that the image is a mosaic of several air photos." + }, + "bands": { + "type": [ + "string", + "null" + ], + "description": "Spectral bands present (near infrared, red, green, blue, etc.)." + }, + "rectificn": { + "type": [ + "string", + "null" + ], + "description": "Any corrections done to adjust the air photo image." + }, + "rollNo": { + "type": [ + "string", + "null" + ], + "description": "Identifier for the film reel from which the air photo comes." + }, + "inst": { + "type": [ + "string", + "null" + ], + "description": "Local institution holding material." + }, + "sheetId": { + "type": [ + "string", + "null" + ], + "description": "Local institution’s unique identifier for the sheet/frame." + }, + "available": { + "type": [ + "boolean", + "null" + ], + "description": "Indication if the institution holds the item at this location in any format." + }, + "physHold": { + "type": [ + "string", + "null" + ], + "description": "Indication if the institution holds the item in a physical format, or a link to information about the physical object." + }, + "digHold": { + "type": [ + "string", + "null" + ], + "description": "Indication if the institution holds the item in a digital format, or a link to information about the digital object, or a link to the digital object itself." + }, + "instCallNo": { + "type": [ + "string", + "null" + ], + "description": "Call number used locally (other than Library of Congress call number)." + }, + "recId": { + "type": [ + "string", + "null" + ], + "description": "Local institution’s unique identifier for the digital object." + }, + "download": { + "type": [ + "string", + "null" + ], + "format": "uri", + "description": "Link used to directly download the digital object." + }, + "websiteUrl": { + "type": [ + "string", + "null" + ], + "format": "uri", + "description": "Link used to direct users to a website with metadata or a download link for the digital object." + }, + "thumbUrl": { + "type": [ + "string", + "null" + ], + "format": "uri", + "description": "Link used to access the thumbnail for the digital object." + }, + "iiifUrl": { + "type": [ + "string", + "null" + ], + "format": "uri", + "description": "Link used to access the digital image using IIIF." + }, + "fileName": { + "type": [ + "string", + "null" + ], + "description": "Digital file associated with sheet/frame." + }, + "note": { + "type": [ + "string", + "null" + ], + "description": "Free text for local comments as well as general notes applying to everyone’s copy." + } } } - } - }, - "required": [ - "type", - "geometry", - "properties" - ] + }, + "required": [ + "type", + "geometry", + "properties" + ] } } } From c3f1a8d3e3310599cd278453d42ad3d88f4a84fc Mon Sep 17 00:00:00 2001 From: Stephen Appel Date: Thu, 23 May 2024 21:34:05 -0500 Subject: [PATCH 10/13] adds error message to patternProperty --- specification/1.0.0.schema.json | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/specification/1.0.0.schema.json b/specification/1.0.0.schema.json index bb71c98..0ce45eb 100644 --- a/specification/1.0.0.schema.json +++ b/specification/1.0.0.schema.json @@ -30,10 +30,12 @@ "patternProperties": { "^[a-z][a-zA-Z0-9]{0,9}$": {}, "^[a-z][a-zA-Z0-9]*[A-Z]{2,}[a-zA-Z0-9]*$": { - "not": {} + "not": {}, + "errorMessage": "Property names cannot have two consecutive uppercase letters." }, "^.{11,}$": { - "not": {} + "not": {}, + "errorMessage": "Property names cannot be longer than 10 characters." } }, "properties": { From 5f646f4158e7e8e744db7379308560a62013448b Mon Sep 17 00:00:00 2001 From: Stephen Appel Date: Mon, 12 Aug 2024 15:34:35 -0500 Subject: [PATCH 11/13] remove external ref to Geometry member and create definition --- specification/1.0.0.schema.json | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/specification/1.0.0.schema.json b/specification/1.0.0.schema.json index 0ce45eb..46f4c8d 100644 --- a/specification/1.0.0.schema.json +++ b/specification/1.0.0.schema.json @@ -4,6 +4,27 @@ "title": "OpenIndexMap", "description": "Describes an OpenIndexMap according to specification version 1.0.0.", "type": "object", + "definitions": { + "Geometry": { + "type": "object", + "properties": { + "type": { + "enum": ["Point", "LineString", "Polygon", "MultiPoint", "MultiLineString", "MultiPolygon", "GeometryCollection"] + }, + "coordinates": { + "type": "array", + "items": {} + }, + "geometries": { + "type": "array", + "items": { + "$ref": "#/definitions/Geometry" + } + } + }, + "required": ["type", "coordinates"] + } + }, "properties": { "type": { "enum": [ @@ -22,7 +43,7 @@ }, "geometry": { "type": "object", - "$ref": "https://geojson.org/schema/Geometry.json" + "$ref": "#/definitions/Geometry" }, "properties": { "type": "object", From 1c493a2ab31fbfd272ffff7324957692dea486b8 Mon Sep 17 00:00:00 2001 From: Stephen Appel Date: Mon, 12 Aug 2024 15:47:15 -0500 Subject: [PATCH 12/13] explicitly disallow "properties" as foreign member name --- specification/1.0.0.schema.json | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/specification/1.0.0.schema.json b/specification/1.0.0.schema.json index 46f4c8d..42c7ef7 100644 --- a/specification/1.0.0.schema.json +++ b/specification/1.0.0.schema.json @@ -395,5 +395,9 @@ ] } } + }, + "additionalProperties": true, + "not": { + "required": ["properties"] } } From 421175dff8acf0876750068cc564abc539630e0f Mon Sep 17 00:00:00 2001 From: Stephen Appel Date: Mon, 12 Aug 2024 16:06:50 -0500 Subject: [PATCH 13/13] remove unnecessary additionalProperties member --- specification/1.0.0.schema.json | 1 - 1 file changed, 1 deletion(-) diff --git a/specification/1.0.0.schema.json b/specification/1.0.0.schema.json index 42c7ef7..8bdc271 100644 --- a/specification/1.0.0.schema.json +++ b/specification/1.0.0.schema.json @@ -396,7 +396,6 @@ } } }, - "additionalProperties": true, "not": { "required": ["properties"] }