-
Notifications
You must be signed in to change notification settings - Fork 45
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
Type indications for user interfaces in parameter schemas #395
Comments
I'm curious about the decision around |
My main point here is about having more specific type indications, not necessatily a specific "encoding". So whether it's called subtype, $ref, format or something else is not so important for me. But to give some background:
|
I agree with having specific identifiers. Even for something as simple as bounding box, it should be made obvious to distinguish it from any other array of numbers. A naming authority should be used as well to provide more context, linking references, and definition details. In the of bounding box for example, I would love to have processes indicate something similar to: "$id": "http://www.opengis.net/def/glossary/term/BoundingBox" |
I like the "$id"/subtype/(or whatever we call it) idea and I am trying to figure out what to do to resolve this issue but I am confused about something. In the example that @m-mohr cites, https://github.com/Open-EO/openeo-processes/blob/master/load_collection.json, I see things like this (for a bounding box in this case):
If there is an "$id" or "subtype" defined for this, why would I need ALL this schema? Why would the input's schema not just be (using "subType" as the identifier token):
Presumably the identifier "bounding-box" would imply ALL the rest. No? |
@pvretano That has three main reasons for openEO, but is a design decision that can be decided differently in OAP:
|
@m-mohr thanks for that. I get it. So, rest of the SWG. Would you prefer the "subtype" approach used by OpenEO or the "$id" approach proposed by @fmigneault? Personally I have no strong preference one way or the other but closer alignment between OpenEO and OAProc would be nice. Please make your preferences known. |
SWG Meeting 2024-04029: Leaning toward |
Two points for consideration for the
|
I do not think that your points are arguments against the use of "format". Regarding
That statement is at least outdated. JSON Schema Validation 2020-12 is pretty clear:
Regarding:
I have never used such a validator, all that I have used (Java and JavaScript implementations) do not show this behavior. A question is how important are those validators - also given that they do not properly implement JSON Schema Validation 2020-12 (asserting format is optional and has to be disabled by default):
That said, a new annotation is of course also an option. If a new annotation is used, the keyword should start with "x-". Or probably "x-ogc-" as we have used in OGC API Features Part 5, Schemas, to reduce the risk of keyword name clashes. From the current JSON Schema plans:
|
Yeah, subtype in openEO was defined before the x- recommendation was in place, format was debated to be removed and when ajv (the primary JS validator) still errored for unknown formats. Good that this is not the case anymore. We actually were on format before as well, but were worried about a potential removal of format so went with a separate keyword. So then it is probably not as relevant anymore and format seems fine (assuming we are using the new drafts, openEO is still on draft-07). |
I agree with @cportele about the points. If implementations misbehave with
For that same reason, I would rather use |
In JSON-FG we also use ajv to validate all examples. This is done without asserting "format", but treating it as the annotation that it now is. I have looked at ajv and indeed it seems to not strictly conform to the JSON Schema spec, since you have to explicitly state In general, I always disable "format" validation when validating JSON instances. The behavior is too different across implementations. It should be handled as an annotation, which it now is in the spec. |
Took a look at OpenEO and they have the following subtypes defined:
The also have date-time, date, time duration and uri defined which seem to be duplicates of the values defined for the JSON Schema Assuming that we intend to use the So my question is, which additional values should we add? Of do we need to add any values at all and instead simply have some informative guidance indicating the the Looking at the OpenEO list, some of these are purely OpenEO specific (e.g. udf-code, udf-runtime, ufd-runtime-version) but others seem pretty generic. I await your feedback. |
Many of them are indeed pretty openEO specific and evolve from the specific usecases and process definitions. What could probably make sense is
Generally, maybe this should be more a best practice rather than a standard so that it can evolve more agile. The standards can link to it though. |
Just as a note: I found |
@m-mohr one issue with using Part 5 is that Part 5 deals with "logical" schemas. The use of Is this what you are looking for? If yes, then we can adopt |
Seems I misunderstood the x-ogc-role. What I intended to propose here seems closer to format then. Generally, I found part 5 pretty confusing, maybe because it mixes concerns... |
SWG meeting from 2024-07-22: We agreed to use the format-element. Please comment on additional types that you would like to see included. In the SWG we discussed adding extended collections, {map, coverage,...}, code list annotations and annotations for WKT representations. |
@pvretano
|
@sptillma Is there some specific geometry you have in mind? I don't think it is a good idea to have |
See #395 (comment) |
SWG meeting from 20.10.2024: Peter will add |
In openEO we additionally have defined for STAC input to OGC API - Processes:
Any thoughts on adding those, too? |
@m-mohr I don't have a problem adding these too ... Question: If I label an input with, say I ask because I want to describe the value(s) properly in the specification. |
Depends on the type and the context, I think @pvretano. In openEO we are using it in the context of CWL:
If you just have JSON Schema, it depends on the
|
So in openEO, you could have an input of type "file" and that would be the path to a local STAC item ... for example ... is that correct? |
That is CWL, not openEO. @pvretano We just recommend in openEO, that EOAP that have STAC as input or output should use CWL's type In openEO we also use JSON Schema, so the other part of my previous comment. But we face the same ambiguity for the string type, so clarifying it is good... |
@m-mohr @pvretano |
Ah, that why we initially used a colon instead of a dash. Can we ensure that this is consistent across CWL and OGC APIs? |
As long as the OGC API definitions resolve to valid URIs in the OGC Naming Authority, I'm fine with it. I've been using CWL |
Hmm, having that in mind I'm wondering why OGC actually needs to define STAC types. If namespace is https://schemas.stacspec.org/v1.1.0/ then it would be Even if we use https://github.com/radiantearth/stac-spec/tree/v1.1.0 as namespace then it would be |
Yes, that works as well if the references are under https://schemas.stacspec.org. What's important to me is that whichever location is used, it is the same in STAC and OGC documentation so they are interoperable natively. |
We recently concluded Testbed 19 and had a work item where we tried to combine openEO and OGC API - Processes. I worked on a visual client https://m-mohr.github.io/gdc-web-editor/
What we realized is that the UI generation for processes exposed by OGC APIs is much harder as we only have limited indication by the JSON Schema. In openEO we started a list of "subtypes" that define common types of input, e.g. collection, bbox, date, duration, epsg-code, geojson, wkt2, year, etc. This helps to render much more user-friendly UI. While a bbox usually just provides a list of 4 numbers in the UI, it can now render a map where you can select a bbox. Just as an example. Some non-visual clients also benefit from it. See https://github.com/Open-EO/openeo-processes/blob/master/meta/subtype-schemas.json for a list of subtypes. This is open to extensions.
The subtype is a custom keyword to JSON Schema and has it's own meta-schema, so also validates in JSON Schema validators. While I think it might not be something for the spec itself, it certainly could go into a best practice.
I think this is something that OGC API - Processes currently doesn't have, so could be something to align between OGC API - Processes an openEO. We now have a client (GDC Web Editor) that can connect to both OGC API - Processes and openEO and I'd hope we see more in the future. Such subtypes would be greatly beneficial and make OGC APIs much more accessible to non-coders.
Example:
This is the process description for it:
https://github.com/Open-EO/openeo-processes/blob/master/load_collection.json
Search for the
subtype
properties in the parameter schemas.The map, date and the band selection wouldn't be possible as such without subtypes. Only the date selection could be achieved somewhat through the
format
keyword.Thoughts?
The text was updated successfully, but these errors were encountered: