-
Notifications
You must be signed in to change notification settings - Fork 87
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Harmonize the "queryables" resource with OGC API Styles #424
Comments
2020-08-03: @cportele to make a proposal, also considering the ongoing discussion about the tileset resource in OGC API Tiles. |
Link to the section in the document: http://docs.opengeospatial.org/DRAFTS/19-079.html#filter-queryables Proposal for the schema of the queryables: type: object
required:
- queryables
properties:
queryables:
type: array
items:
type: object
required:
- id
- type
properties:
id:
description: the token that may be used in a query predicate
type: string
title:
description: a human readable title for the queryable
type: string
description:
description: a human-readable narrative describing the queryable
type: string
language:
description: the language used for the title and description
type: string
type:
description: the data type of the queryable
type: string
enum:
- string
- number
- integer
- boolean
- spatial
- temporal
spatial-types:
description: the list of allowed spatial geometry types, if known
type: string
enum:
- point
- multi-point
- curve
- multi-curve
- surface
- multi-surface
- solid
- multi-solid
- aggregate
- any
temporal-types:
description: the list of allowed temporal geometry types, if known
type: string
enum:
- instant
- interval
links:
description: additional links, e.g. to documentation or to the schema of the values
type: array
items:
$ref: 'https://raw.githubusercontent.com/opengeospatial/ogcapi-features/master/core/openapi/ogcapi-features-1.yaml#/components/schemas/link' So the example would change to: {
"queryables": [
{
"id": "elevation",
"title": "Elevation",
"description": "The average distance of the road segment above sea level in meter.",
"type": "number"
},
{
"id": "nlanes",
"title": "Number of lanes",
"description": "The total number of lanes in all directions.",
"type": "integer"
},
{
"id": "geom",
"title": "Segment Geometry",
"description": "The geometry of the road segment",
"type": "spatial",
"spatial-type": "curve"
},
{
"id": "name",
"title": "Segment Name",
"description": "The common name of the road segment.",
"type": "string"
}
]
} Changes:
We should extend the example to cover also a temporal property and links. |
Styles SWG mtg discussed this Issue. Group assessed that such a 'schema' is needed Visual Style Editors. Proposal will be reworked and posted. |
To add to the comment above, for styles there are different requirements depending on where the data is styled. For styling in the client (vector tiles), one needs the schema of the data in the vector tiles (same as in the tileset resource), for styling on the server (map images), one needs the properties that may be used in filters evaluated on the server, i.e., the queryables. I will have a look at this again and try to come up with a proposal that takes that into account. Probably we need two resources, the schema and the list of queryables (with their schema). Both should be consistent with each other. |
Meeting 2020-10-26: We want to use the same approach for queryables, returnables and the full schema. They should be defined in the same spec (probably a separate schema extension), but in separate requirements classes. Use JSON Schema direct as far as possible for JSON encodings (likely a profile), without OGC-specific extensions / sugar. The queryables response would be a single JSON object where each property would be a queryable. The same would be for the full schema and the returnables. Where the response uses GeoJSON, the returnables schema (and the full schema, too) would describe the GeoJSON objects. The returnables schema is a subset of the full schema. The full schema backend datastore schema, the returnables is a defined profile/view for a specific use. @cportele to draft an example. @cportele and @pvretano will try to update their software with live examples. We would need specific link relation types for each of the schema types. We could still use fixed paths for the resources under the Collection resource. |
I have updated the ldproxy demo server with the approach that we have discussed Queryables A JSON object, a property for every queryable. {
"$schema" : "https://json-schema.org/draft/2019-09/schema",
"$id" : "https://demo.ldproxy.net/daraa/collections/CulturePnt/queryables",
"type" : "object",
"title" : "Cultural (Points)",
"description" : "Cultural: Information about features on the landscape that have been constructed by man.",
"properties" : {
"F_CODE" : {
"type" : "string",
"title" : "Feature Type",
"enum" : [ "AK121", "AL012", "AL030", "AL130", "BH075" ]
},
"ZI001_SDV" : {
"type" : "string",
"title" : "Last Change",
"format" : "date-time,date"
},
"ZI037_REL" : {
"type" : "integer",
"title" : "Religious Designation",
"enum" : [ -999999, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14 ]
},
"geometry" : {
"$ref" : "https://geojson.org/schema/Point.json"
}
}
} Response schema The schema of the GeoJSON object returned by the API. {
"$schema" : "https://json-schema.org/draft/2019-09/schema",
"$id" : "https://demo.ldproxy.net/daraa/collections/CulturePnt/schema?f=json",
"type" : "object",
"title" : "Cultural (Points)",
"description" : "Cultural: Information about features on the landscape that have been constructed by man.",
"required" : [ "type", "geometry", "properties" ],
"properties" : {
"type" : {
"type" : "string",
"enum" : [ "Feature" ]
},
"id" : {
"type" : "integer"
},
"links" : {
"type" : "array",
"items" : {
"$ref" : "#/$defs/Link"
}
},
"geometry" : {
"$ref" : "https://geojson.org/schema/Point.json"
},
"properties" : {
"type" : "object",
"properties" : {
"FCSUBTYPE" : {
"type" : "integer",
"title" : "Feature Subtype Code"
},
"F_CODE" : {
"type" : "string",
"title" : "Feature Type",
"enum" : [ "AK121", "AL012", "AL030", "AL130", "BH075" ]
},
"UFI" : {
"type" : "string",
"title" : "Unique Entity Identifier"
},
"ZI001_SDP" : {
"type" : "string",
"title" : "Source Description"
},
"ZI001_SDV" : {
"type" : "string",
"title" : "Last Change",
"format" : "date-time,date"
},
"ZI005_FNA" : {
"type" : "string",
"title" : "Name"
},
"ZI006_MEM" : {
"type" : "string",
"title" : "Memorandum"
},
"ZI037_REL" : {
"type" : "integer",
"title" : "Religious Designation",
"enum" : [ -999999, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14 ]
}
}
}
},
"$defs" : {
"Link" : {
"type" : "object",
"required" : [ "href" ],
"properties" : {
"href" : {
"type" : "string",
"format" : "uri-reference"
},
"rel" : {
"type" : "string"
},
"type" : {
"type" : "string"
},
"title" : {
"type" : "string"
}
}
}
}
} Mutation schema The APIs on that server do not support transactions, so there is no mutation schema (or however we will call it), but it would be the response schema without JSON Schema profile We discussed that we would recommend a profile of JSON Schema to simplify parsing by clients. Additional elements would be allowed, but providers should be aware that clients may ignore them. Here is a proposal based on the current drafts on schemas in various OGC API drafts:
Additional questions
|
@cportele Great example. I've sent this out to Styles SWG as well... Thanks and Regards, |
Meeting 2020-11-09: The example looks good and @pvretano will implement the approach soon. If any issue is identified in the process we will resolve the problem and otherwise, if there are no other comments, plan to move forward with the approach. The question, if we want to indicate the properties that are used for We still need to discuss the JSON Schema profile. If anyone has any comments, please let us know. |
Reopen for review in SWG meeting on 2020-12-07 |
For now, the issue has been addressed, but we will keep this issue open since the schema discussion is broader than "just" queryables and Part 3. |
I've implemented queryables representation as json-schema for GeoServer as well, while reviewing the CQL spec (available in GeoServer 2.20.x nightly builds, I don't have an online server supporting that version that I could link to, unfortunately). That said, using schema covers all the technical needs for listing queryables, presentables and the like. But semantically, I'm a bit torn... people can look at it and say "ah it's a schema" so wonder "the schema of what". Of nothing, in fact. |
See http://docs.opengeospatial.org/DRAFTS/20-009.html#rc_queryables. Both resources have the same role. There should only be a single requirements class for queryables.
The text was updated successfully, but these errors were encountered: