Skip to content
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

CURIE inconsistencies #975

Open
pvretano opened this issue Feb 6, 2025 · 32 comments
Open

CURIE inconsistencies #975

pvretano opened this issue Feb 6, 2025 · 32 comments
Labels
Part 1: Core Issue related to Part 1 - Core

Comments

@pvretano
Copy link
Contributor

pvretano commented Feb 6, 2025

From @pomakis ...

I'm looking through the various OGC API specifications trying to make sense of the use of CURIEs (https://www.w3.org/TR/curie/). But I'm seeing a lot of inconsistencies, leaving me bewildered as to how to implement our clients and servers.

My understanding is that a safe CURIE is of the form [{prefix}:{reference}], where {prefix} maps to a {baseURI}, and that the full URI that the CURIE represents is simply {baseURI}{reference}. E.g., for the URI "[EPSG:4326]", the "EPSG" prefix maps to "http://www.opengis.net/def/crs/EPSG/0/", so the full URI it represents is "http://www.opengis.net/def/crs/EPSG/0/3857".

  1. Where can I see a list of these CURIE prefix mappings? Presumably these mappings are available through the "OGC CURIE Register" (http://www.opengis.net/def/curie), but how does one actually view this list? The OGC API specifications don't seem to provide any guidance on this matter (other than the occasional example).

  2. Sections 7.2.2 and 11.2.1 of the draft "OGC API - Coverages - Part 1: Core" specification (as of 2025-02-04) state:

    NOTE: A CURIE {authority}[-{objectType}]:{id} would map to the following
    OGC URI: http://www.opengis.net/def/{objectType}/{authority}/0/{id}. If
    -{objectType} is missing, the default object type is crs.

This indicates that the following CURIEs (as shown in the latest versions of the "OGC API - Common - Part 2", "OGC API - Coverages - Part 1" and "OGC API - Features - Part 5") specifications)

[ogc-rel:schema]
[ogc-rel:coverage]

map to the following URIs:

http://www.opengis.net/def/rel/ogc/0/schema
http://www.opengis.net/def/rel/ogc/0/coverage

where in fact the proper URIs seem to be:

http://www.opengis.net/def/rel/ogc/1.0/schema
http://www.opengis.net/def/rel/ogc/1.0/coverage

Is this note in the draft "OGC API - Coverages - Part 1: Core" specification bogus? If so, it should be removed and replaced by more general (and correct) guidance on the use of CURIEs.

  1. Section 7.11 of the "OGC API - Features - Part 1" specification amd section 7.2.2 of the "OGC API - Coverages - Part 1: Core" specification indicate the following coordinate reference systems:

    http://www.opengis.net/def/crs/OGC/1.3/CRS84
    http://www.opengis.net/def/crs/OGC/0/CRS84h

Are these correct? If so, it's impossible to CURIEize these, since the "OGC" prefix can't map to both "http://www.opengis.net/def/crs/OGC/1.3/" and "http://www.opengis.net/def/crs/OGC/0/". Unless I'm misunderstanding how CURIEs work.

  1. Section 5.3 of "OGC API - Features - Part 5" states:

    As an alternative, the Compact URI (CURIE), e.g., [ogc-rel:schema],
    can also be used when a CURIE is an allowed value.

Really? We're requiring OGC API clients to de-CURIE all relation-type URIs while navigating through links? I don't even think that's legal. Section 2,2 of the CURIE specification (https://www.w3.org/TR/curie/) states:

CURIEs and SafeCURIEs map to IRIs, but neither a CURIE nor a
Safe_CURIE is an IRI or URI. Accordingly, CURIEs and Safe_CURIEs
MUST NOT be used as values for attributes or other content that are
specified to contain only URIs, IRIs, URI-references, IRI-references,
etc.

The WebLinks specification (https://www.rfc-editor.org/rfc/rfc8288.txt) states:

Applications that don't wish to register a relation type can use an
extension relation type, which is a URI [RFC3986] that uniquely
identifies the relation type.

This clearly states that extension relation types must be URIs (which CURIEs are not). It goes on to say:

When extension relation types are compared, they MUST be compared as
strings (after converting to URIs if serialised in a different
format) in a case-insensitive fashion, character by character.
Because of this, all-lowercase URIs SHOULD be used for extension
relations.

And this makes sense. Any form of comparison that's more complex than an exact string match would be doomed to failure, since it would put too much of a burden on client implementations and very few would do it right.

And I don't think that the "after converting to URIs if serialised in a different format" clause saves us. These links aren't being serialized in a different format. They're coming right from the standard JSON and XML representations of a web link.

@pvretano
Copy link
Contributor Author

pvretano commented Feb 6, 2025

... and more from @pomakis

Regarding my second point in my previous comment, I just noticed that section 5.3.3 of the "OGC Name Type Specification - definitions - part 1 – basic name" specification (09-048r6) states:

5.3.3.  Applying CURIEs to Coordinate Reference Systems

CURIEs representing a shortened form of the URI of a registered
Coordinate Reference System (CRS) may be used as an alternative to
the full URI by following the syntax below:

{authority}:{identifier} ==
[http://www.opengis.net/def/crs/{authority}/0/{identifier}](http://www.opengis.net/def/crs/%7Bauthority%7D/0/%7Bidentifier%7D)

For example, EPSG:4326 may be used to represent
http://www.opengis.net/def/crs/EPSG/0/4326

When a CURIE is used to represent a CRS, the following shall apply:

a. The version segment of the URI is assumed to be equal to 0

b. The definition-type segment shall be assumed to be equal to crs.

c. The definition segment shall be assumed to be equal to def.

But then in section 6.4 of the same document, it says:

Example 2 The http URI value for the "WGS 84 longitude-latitude"
CRS specified in Subclause B.3 of WMS 1.3 (previously referenced
as CRS:84) is:

http://www.opengis.net/def/crs/OGC/1.3/CRS84

The only way this makes sense to me is if OGC CRS URIs can't be CURIEd. That is "[OGC:CRS84]" is an illegal CRS reference. This is a published specification. How do you make sense of this?

On Wed, Feb 5, 2025 at 11:51 AM Keith Pomakis <[email protected]> wrote:

Peter, here are my latest notes regarding the use of CURIEs in the OGC API.  Feel free to forward them on to whoever you think is appropriate.

I'm looking through the various OGC API specifications trying to make sense of the use of CURIEs (https://www.w3.org/TR/curie/).  But I'm seeing a lot of inconsistencies, leaving me bewildered as to how to implement our clients and servers.

My understanding is that a safe CURIE is of the form [{prefix}:{reference}], where {prefix} maps to a {baseURI}, and that the full URI that the CURIE represents is simply {baseURI}{reference}.  E.g., for the URI "[EPSG:4326]", the "EPSG" prefix maps to "http://www.opengis.net/def/crs/EPSG/0/", so the full URI it represents is "http://www.opengis.net/def/crs/EPSG/0/3857".

1. Where can I see a list of these CURIE prefix mappings?  Presumably these mappings are available through the "OGC CURIE Register" (http://www.opengis.net/def/curie), but how does one actually view this list?  The OGC API specifications don't seem to provide any guidance on this matter (other than the occasional example).

2. Sections 7.2.2 and 11.2.1 of the draft "OGC API - Coverages - Part 1: Core" specification (as of 2025-02-04) state:

    NOTE: A CURIE {authority}[-{objectType}]:{id} would map to the following
    OGC URI: [http://www.opengis.net/def/{objectType}/{authority}/0/{id}](http://www.opengis.net/def/%7BobjectType%7D/%7Bauthority%7D/0/%7Bid%7D). If
    -{objectType} is missing, the default object type is crs.

This indicates that the following CURIEs (as shown in the latest versions of the "OGC API - Common - Part 2", "OGC API - Coverages - Part 1" and "OGC API - Features - Part 5") specifications)

    [ogc-rel:schema]
    [ogc-rel:coverage]

map to the following URIs:

    http://www.opengis.net/def/rel/ogc/0/schema
    http://www.opengis.net/def/rel/ogc/0/coverage

where in fact the proper URIs seem to be:

    http://www.opengis.net/def/rel/ogc/1.0/schema
    http://www.opengis.net/def/rel/ogc/1.0/coverage

Is this note in the draft "OGC API - Coverages - Part 1: Core" specification bogus?  If so, it should be removed and replaced by more general (and correct) guidance on the use of CURIEs.

3. Section 7.11 of the "OGC API - Features - Part 1" specification amd section 7.2.2 of the "OGC API - Coverages - Part 1: Core" specification indicate the following coordinate reference systems:

    http://www.opengis.net/def/crs/OGC/1.3/CRS84
    http://www.opengis.net/def/crs/OGC/0/CRS84h

Are these correct?  If so, it's impossible to CURIEize these, since the "OGC" prefix can't map to both "http://www.opengis.net/def/crs/OGC/1.3/" and "http://www.opengis.net/def/crs/OGC/0/".  Unless I'm misunderstanding how CURIEs work.

4. Section 5.3 of "OGC API - Features - Part 5" states:

    As an alternative, the Compact URI (CURIE), e.g., [ogc-rel:schema],
    can also be used when a CURIE is an allowed value.

Really?  We're requiring OGC API clients to de-CURIE all relation-type URIs while navigating through links?  I don't even think that's legal.  Section 2,2 of the CURIE specification (https://www.w3.org/TR/curie/) states:

    CURIEs and SafeCURIEs map to IRIs, but neither a CURIE nor a
    Safe_CURIE is an IRI or URI. Accordingly, CURIEs and Safe_CURIEs
    MUST NOT be used as values for attributes or other content that are
    specified to contain only URIs, IRIs, URI-references, IRI-references,
    etc.

The WebLinks specification (https://www.rfc-editor.org/rfc/rfc8288.txt) states:

    Applications that don't wish to register a relation type can use an
    extension relation type, which is a URI [RFC3986] that uniquely
    identifies the relation type.

This clearly states that extension relation types must be URIs (which CURIEs are not).  It goes on to say:

    When extension relation types are compared, they MUST be compared as
    strings (after converting to URIs if serialised in a different
    format) in a case-insensitive fashion, character by character.
    Because of this, all-lowercase URIs SHOULD be used for extension
    relations.

And this makes sense.  Any form of comparison that's more complex than an exact string match would be doomed to failure, since it would put too much of a burden on client implementations and very few would do it right.

And I don't think that the "after converting to URIs if serialised in a different format" clause saves us.  These links aren't being serialized in a different format.  They're coming right from the standard JSON and XML representations of a web link.

@jerstlouis
Copy link
Member

jerstlouis commented Feb 6, 2025

@pvretano Probably overdue for a discussion... We're having a special OGC API - Maps / Compliance session today at our usual Thursdays 12:00 PM (noon) Eastern OGC API - Common Session, but perhaps this could be the topic for next week's meeting?

Some initial thoughts:

  • I understand URLs with /0/ as either mapping to the last version or not being versioned -- I don't expect link relation type to need "versions" so I would hope that we used /0/ there. It seems that we did not, so perhaps those mentions of /0/ need to be fixed to the sad reality that it should be /1.0/? Unless we fix this the other way around and use /0/ for the link relations.
  • Regarding the ability to use CURIEs for CRSs, this is required to be supported by the server in OGC API - Maps CRS requirement class
  • Multiple OGC API specs (OGC API - Maps included I think) allow servers to use CURIEs for link relations (as well as for declared supported CRSs). It makes the JSON documents much shorter and more readable (especially in examples within the standard document and Engineering Reports). Clients are expected to recognize both the CURIE and the full thing, but there should not be other options (though perhaps adding to this https vs http since there was a transition to equivalent https URIs). The HTTP response Link: headers would still use the full URIs. Are we breaking RFC8288 by allowing in the OGC API links ? Up for discussion, but OGC API - Maps does this e.g. 19.3 Requirement 46, https://docs.ogc.org/is/20-058/20-058.html#_88d79c83-dd53-4b9b-9703-ef18f0cf4771 . I might be partially to blame for this, but I surely recall discussions about the use of [ogc-rel:...] as a use case for CURIE when discussing that these link relation types all over the place in JSON documents are way too verbose.

@cportele
Copy link
Member

cportele commented Feb 6, 2025

I now think that servers should always (?) use URIs (so that clients know what to expect) and that CURIEs should basically be restricted to clients using CURIEs in query parameters (or perhaps payload) to simplify constructing the values. So, CURIEs are a convenience for clients and servers have to be able to process both. Servers will have to use URIs for existing building blocks anyhow to be backwards compatible. See also the recent discussions in #632.

On the use of CURIEs in links: For an RFC 8288 Weblink (that is, a Link HTTP header), the value must always be the URI. In an OGC Link JSON object we can open the values in href to CURIEs and this is what is currently in the drafts.

@pvretano
Copy link
Contributor Author

pvretano commented Feb 6, 2025

@cportele that would certainly seem to simplify matters ... always using URIs I mean...

@pvretano
Copy link
Contributor Author

pvretano commented Feb 6, 2025

@jerstlouis sure. I can ask @pomakis to join to discuss. Let me know if it's a confirmed topic for the next maps meeting.

@pebau
Copy link

pebau commented Feb 6, 2025

Are these correct? If so, it's impossible to CURIEize these, since the "OGC" prefix can't map to both "http://www.opengis.net/def/crs/OGC/1.3/" and "http://www.opengis.net/def/crs/OGC/0/". Unless I'm misunderstanding how CURIEs work.

Indeed, as @jerstlouis has mentioned, the convention is that /0/ is interpreted as "latest version", explained here. OGC-NA has adopted this several years back (around 2016).

@pvretano
Copy link
Contributor Author

pvretano commented Feb 6, 2025

@pebau I'm not sure that guidance helps. My/our understanding of CURIEs is that the prefix is supposed to be a character-for-character comparable string that is everything up to the last element of the URI that you are trying to CURRIE. That means that http://www.opengis.net/def/crs/OGC/1.3/CRS84 and http://www.opengis.net/def/crs/OGC/0/CRS84 (which according to the guidance are the same thing assuming 1.3 is the "latest" version) cannot use the same CURRIE prefix (e.g. [ogc-crs:CRS84]) since that prefix (ogc-crs in my example) would need to map to both the "1.3" and "0" forms of the URI.

Our confusion on the matter might be less so if we could get a list of OGC CURIE prefixes but so far I have been unable to coax that our of the definition server.

@pebau
Copy link

pebau commented Feb 6, 2025

@pvretano I was just reporting the decision by OGC-NA at that time.

But personally I see no problem in having 2 paths from a CURIE leading to a single result.

@pebau
Copy link

pebau commented Feb 6, 2025

@pvretano

Our confusion on the matter might be less so if we could get a list of OGC CURIE prefixes but so far I have been unable to coax that our of the definition server.

I have not heard about any CURIE registry - if there is one, please share!

For CRSs, I find: EPSG, OGC, AUTO, IAU, COSMO

@chris-little
Copy link

@pebau There are 13 entries in the CURIE register. See https://defs.opengis.net/vocprez/object?uri=http%3A//www.opengis.net/def/curie .

@pomakis
Copy link

pomakis commented Feb 6, 2025

This registry states that "OGC" is an alias of "http://www.opengis.net/def/curie/ogc/1.0/crs/OGC".

So what are the CURIEs for the following URIs:

http://www.opengis.net/def/crs/OGC/1.3/CRS84
http://www.opengis.net/def/crs/OGC/0/CRS84h

And what URIs do the following CURIEs represent:

[OGC:CRS84]
[OGC:CRS84h]

@jerstlouis
Copy link
Member

@pomakis

The /0/ "latest version" rule works in this case:

https://www.opengis.net/def/crs/OGC/0/CRS84h

https://www.opengis.net/def/crs/OGC/0/CRS84

@pomakis
Copy link

pomakis commented Feb 6, 2025

@jerstlouis
Ah, you're saying that the following URIs can't be CURIEd:

http://www.opengis.net/def/crs/OGC/1.3/CRS84
http://www.opengis.net/def/rel/ogc/1.0/schema

but the following URIs can:

http://www.opengis.net/def/crs/OGC/0/CRS84
http://www.opengis.net/def/rel/ogc/0/schema

and that, for example, a client application sniffing for an OGC API schema link will need to to recognize, at a minimum, the following relation types as being synonomous?:

http://www.opengis.net/def/rel/ogc/1.0/schema
http://www.opengis.net/def/rel/ogc/0/schema
[ogc-rel:schema]

So much for easy link navigation.

@pomakis
Copy link

pomakis commented Feb 6, 2025

Another question. How does one get the CURIE prefix mappings from the registry? Earlier I stated that "OGC" maps to "http://www.opengis.net/def/curie/ogc/1.0/crs/OGC" because that's what the registry seems to be telling me. But that can't be right. Perhaps I still don't know how to eke this information out of the registry. Knowing what the mappings (or even the suggested mappings) are would really help this conversation.

@jerstlouis
Copy link
Member

jerstlouis commented Feb 6, 2025

and that, for example, a client application sniffing for an OGC API schema link will need to to recognize, at a minimum, the following relation types as being synonomous?:

Ideally this http://www.opengis.net/def/rel/ogc/1.0/schema would never have existed, since I don't see a point to versioning link relations. But CURIEs always use the "latest" version by using /0/.

How does one get the CURIE prefix mappings from the registry? Earlier I stated that "OGC" maps to "http://www.opengis.net/def/curie/ogc/1.0/crs/OGC"

This /def/curie/ thing is new to me, and it seems to completely defeat the purpose to have URIs specific to curies and goes against the policy saying that:

the URI of any definition registered in OGC-NA controlled registers may be represented in shortened form through use of CURIEs.

I believe the note in Coverages:

NOTE: A CURIE {authority}[-{objectType}]:{id} would map to the following
OGC URI: http://www.opengis.net/def/{objectType}/{authority}/0/{id}. If
-{objectType} is missing, the default object type is crs.

is correct and is consistent with the CURIE policy.

So much for easy link navigation.

I would add to these 3 the https:// equivalent / aliases.

In an ideal world, clients would only need to check against https://www.opengis.net/def/rel/ogc/0/schema and
[ogc-rel:schema].

@pomakis
Copy link

pomakis commented Feb 6, 2025

Okay, so this is where I think we stand.

  1. The list of OGC CURIE prefix mappings is something like this:
"EPSG"     --> "http://www.opengis.net/def/crs/EPSG/0/"
"EPSG-crs" --> "http://www.opengis.net/def/crs/EPSG/0/"
"OGC"      --> "http://www.opengis.net/def/crs/OGC/0/"
"OGC-crs"  --> "http://www.opengis.net/def/crs/OGC/0/"
"ogc-rel"  --> "http://www.opengis.net/def/rel/ogc/0/
[...]
  1. Thes mappings can't be obtained from the registry at "http://www.opengis.net/def/curie"; they're sprinkled throughout the various specifications.

  2. The well-established URIs that have non-zero version numbers such as:

http://www.opengis.net/def/crs/OGC/1.3/CRS84
http://www.opengis.net/def/rel/ogc/1.0/schema

do not have a CURIE form, whereas their "latest-version" counterparts (which I've never seen anybody use) do:

http://www.opengis.net/def/crs/OGC/0/CRS84
http://www.opengis.net/def/rel/ogc/0/schema
  1. Client applications that need to parse CRS references are required to recognize all of the equivalent-ish forms, e.g.:
[OGC:CRS84]
[OGC-crs:CRS84]
http://www.opengis.net/def/crs/OGC/0/CRS84
http://www.opengis.net/def/crs/OGC/1.3/CRS84

including older forms for maximum backward compatibility, e.g.:

CRS:84
urn:ogc:def:crs:OGC:2:84
urn:ogc:def:crs:OGC::CRS84
http://www.opengis.net/gml/srs/epsg.xml#84
[...]
  1. Client applications that need to navigate links are required to recognize all of the equivalent-ish relation types, e.g.:
[ogc-rel:schema]
http://www.opengis.net/def/rel/ogc/0/schema
http://www.opengis.net/def/rel/ogc/1.0/schema
https://www.opengis.net/def/rel/ogc/0/schema (really?!?)
https://www.opengis.net/def/rel/ogc/1.0/schema (really?!?)

Does that sum it up?

As an aside, I'd like to point out that according to section 5.3.1 of "OGC Name Type Specification - definitions - part 1 – basic name" (OGC 09-048r6), "CURIEs recorded in the register shall be treated as case sensitive". So it's "OGC", "OGC-crs" and "ogc-rel", in those exact cases.

@pebau
Copy link

pebau commented Feb 7, 2025

@pomakis @ghobona thanks for this big effort, Keith! IMHO this underlines the need for a concerted synchronization action under the lead of OGC-NA, resulting in a single authoritative repository modified only through OGC-NA motions, similar to eg the CRS resolver management.

@jerstlouis
Copy link
Member

jerstlouis commented Feb 7, 2025

Does that sum it up?

@pomakis Yes, that is quite an excellent summary, thank you!

Regarding HTTPS URIs, there was a request to move entirely towards https URI during the OGC API - Maps OAB review. Some manual aliases have seen been created in RAINBOW, but I argued that this should be a more systematic equivalence, presenting to users accessing either the HTTP or HTTPS URL with the same web page as opposed to an "alias of" version.
This does resolve for example: https://www.opengis.net/def/crs/OGC/0/CRS84.

The case sensitiveness and the mismatch between OGC-crs and ogc-rel is certainly an oddity which would be nice to iron out.

In practice, implementing 4 and 5 can be done in a localized single function accepting a canonical URI string and a URI string to test for a match, with the logic to generate all of the equivalent forms as part of that matching operation. Considering such function can be written once and then shared and re-used everywhere, this burden may not be as extreme as it may seem, and in my opinion, is worth the pain to avoid seeing and typing thousands of long URIs all over the place.

@pebau

resulting in a single authoritative repository modified only through OGC-NA motions

I'm not sure if this is what you have in mind, but I disagree with the notion of a "CURIE registry". This completely defeats the purpose of CURIEs which should be an automatic compact representation of longer canonical URIs.

@pomakis
Copy link

pomakis commented Feb 7, 2025

Regarding "a localized single function accepting a canonical URI string and a URI string to test for a match, with the logic to generate all of the equivalent forms as part of that matching operation":

We've been attempting to maintain such a function for many years, and it really has gotten quite complex. I'm willing to bet that there's not a single implementation out there that does this correctly. I suspect most implementations that do it quasi-correctly take something like the following shortcut approach:

  • Strip leading '[' and trailing ']' if they exist.
  • Strip everything before and including the last character that's not 'a'-'z'/'A'-'Z'/'0'-'9'/'-'/'_'.
  • Convert to a canonical case.

This generally works (in fact, I'm thinking of simplifying our code to this), but completely ignores authorities and version numbers, etc., making it not safe from possible futures where such things become relevant in the comparison.

And I still say that, with respect to comparing link relation types, any such function violates RFC 8288 (Web Linking). Not only does it state that extension relation types must be URIs (which CURIEs are not), but also that "they MUST be compared as strings [...] in a case-insensitive fashion, character by character" (with the emphasis on "MUST" baked into the RFC). Not passed through some canonization function whose proper implementation can only be eked out by reading a dozen different OGC specifications.

I strongly believe that the OGC-defined relation types be exact strings, not a bunch of optional variations. If those exact strings are long-ish URIs like "http://www.opengis.net/def/rel/ogc/1.0/schema", then so be it. Is saving 29 highly-compressible bytes really worth the complication of allowing CURIEs and breaking RFC 8288?

As an aside, @cportele wrote "For an RFC 8288 Weblink (that is, a Link HTTP header), [...]". RFC 8288 isn't specifically for Link HTTP headers. It defines a serialization for Link headers, but allows and encourages other serializations. OGC API defines a JSON serialization. Section 6.3 of "OGC API - Common - Part 1: Core" (OGC 19-072) states "OGC Web API Standards use RFC 8288 (Web Linking) to express relationships between resources". This is a general statement, not specific to the HTTP Link header.

@pebau
Copy link

pebau commented Feb 8, 2025

@pomakis

Is saving 29 highly-compressible bytes really worth the complication of allowing CURIEs and breaking RFC 8288?

yes. not for machines, but for humans. By way of history, from a WCS.SWG perspective:

  • In coverages and WCS, we had the need for dynamically composed (ie: not pre-registered) n-D CRSs because you do not want to explode the CRS registry by defining every EPSG with every time CRS with every vertical CRS with every other axis type that might occur. Such a dynamic composition was not possible for a long time: URNs, used early on by OGC, offer nothing.
  • Later URLs allowed introducing the crs-compose/ mechanism, something we had requested since about 2012 and what got introduced with 19111:2019.
  • However, people reading the specs found this 19111-conformant composition extremely unwieldy, and of course coverages were blamed altogether. Here is a taste: https://www.opengis.net/def/crs-compound?1=https://www.opengis.net/def/crs/OGC/0/AnsiDate&2=https://www.opengis.net/def/crs/EPSG/0/4326
  • So we looked for something more handy and found CURIEs.
  • Following some discussion, CRS CURIEs were adopted allowing stuff like "[EPSG:4326],[OGC:GergorianTime]" which concentrates on the main information. If versioning is an issue you still can use CRS URIs. Hooray.
  • Meanwhile, obviously in several places CURIEs are being used, not always synced. Hence, my plea for a concertation effort led by OGC-NA.

My 2 cents.

@jerstlouis
Copy link
Member

jerstlouis commented Feb 8, 2025

Is saving 29 highly-compressible bytes really worth the complication of allowing CURIEs and breaking RFC 8288?

yes. not for machines, but for humans.

concentrates on the main information

Yes, exactly. Brain-parsing and typing long URIs all day long all over JSON documents, standards and engineering reports are a major energy drain (especially if such days are long and many).

Crafting and/or validating the proper long form URIs manually is notably made extremely difficult due to the definition server re-directing to other /vocprez URLs ( opengeospatial/NamingAuthority#85 ) so they cannot be validated and copied from the browser's address bar.

@pomakis
Copy link

pomakis commented Feb 10, 2025

Sorry for beating this to death, but as an implementer (on both the client and server sides) I'm still lost as to how to properly implement these requirements.

Section 7.1.2.1 of "OGC API - Common - Part 2: Geospatial Data" states that the link to the logical schema of the collection is done with the link relation type of "[ogc-rel:schema]". As discussed above, this should be considered a CURIE for "http://www.opengis.net/def/rel/ogc/0/schema", which I guess implies that either of the two forms is acceptable (setting aside the fact that the CURIE version is in violation of RFC 8288). The "OGC API - Coverages - Part 1: Core" specification repeats this, and adds it as a requirement that "each collection must include" such a link.

Taking this literally (which an implementer must do), an OGC API server that reports a collection's schema link as:

{
  "href": "https://wherever.com/ogcapi/collections/myCollection/schema",
  "rel": "http://www.opengis.net/def/rel/ogc/1.0/schema",
  "title": "the schema of this collection"
}

is in violation of the specifications, because it's not of the required relation type.

Short of outlawing the use of CURIEs for link relation types, I can only see two resolutions to this. Either:

  1. New versions of the "Common - Part 2" and Coverages - Part 1" specifications (and presumably others) need to be drafted to allow the various relation types as stated earlier in the thread (including the version-number nuances, the raw and CURIEd versions, and the "http" versus "https" variations), or

  2. The "http://www.opengis.net/def/rel/ogc/1.0/schema" relation type is considered incorrect (as well as the other variations), and most existing implementations (including ours) will need to be adjusted accordingly (i.e., to use only the "[ogc-rel:schema]" or ""http://www.opengis.net/def/rel/ogc/0/schema" relation types).

Am I missing something?

@jerstlouis
Copy link
Member

jerstlouis commented Feb 11, 2025

@pomakis

which I guess implies that either of the two forms is acceptable (setting aside the fact that the CURIE version is in violation of RFC 8288). The "OGC API - Coverages - Part 1: Core" specification repeats this, and adds it as a requirement that "each collection must include" such a link.

The intent is that both CURIEs and URIs can be used (Common aims to be compatible with OGC API - Features - Part 1 and all other published OGC API standards). I believe the Conventions section says or should say that the CURIEs map to the equivalent, and wherever the shorter CURIE is used in the rest of the documents to avoid sore eyes, it's a placeholder for the CURIE or the full URI.

The conventions sections probably need additional clarifications based on your earlier clarifications, and in critical places near the CURIE-related requirement we should probably add notes and/or explicit mentions of the different possibilities.

I think before we agree on a resolution to 1, 2 or somewhere in the middle, in hope of potentially limiting the complexity, I think we should first discuss:

  • Are we really stuck with the ogc-rel vs. OGC-crs case disparity?
  • Do we need the extra versioned numbers for link relations, or could we agree to only stick to /0/ for link relations? In which case, we could make specific backward compatibility options for those link relations already defined in published standards.
  • Could we stricly use https (or http) for link relations? The reason we started to switch to https for URIs in OGC API - Maps is because the OAB said we should. If we keep using http URIs in other new standards, this just creates a huge mess.

@pomakis
Copy link

pomakis commented Feb 11, 2025

@jerstlouis asked:

Do we need the extra versioned numbers for link relations, or could we agree to only stick to /0/ for link relations? In which case, we could make specific backward compatibility options for those link relations already defined in published standards.

I think non-zero version numbers in link relation types (or indeed any URI) can only reasonably work if:

a) There's a different CURIE for each version number (as section 7.3 of the "OGC Features and Geometries JSON - Part 1: Core" specification does). Otherwise there can't be a one-to-one mapping between a CURIE prefix and the URI prefix it represents.

and

b) Version zero doesn't mean "latest". The concept of "latest" can't work in practice. Hear me out. First, let's assume that version numbers mean something, i.e., that there may be situations where linking to (or conforming to) something with version x may have slightly different semantics than linking to (or conforming to) something with version y. So if a client application sees a URI stating version y, but is only programmed to handle version x of whatever the URI represents, then negotiation fails (or execution degrades into a "cross your fingers and see what happens" situation). But what if a client application sees a URI stating the "latest" version? The latest version according to which software component, with respect to when? When the server was implemented, the "latest" version may have been version x, so that's what the server means when it indicates "latest". But that's useless to the client application that might be aware of a later version or isn't yet aware of the version that the server refers to as "latest". So how, in general, can a version-specific URI be compared with one that simply states "latest"? It can't.

So I agree that link relation type URIs should be versionless (or hardcode a /0/ version if it's important to stick to that syntax template), since it avoids all that mess. After all, I can't imagine version numbers being relevant for link relation types. If ever a situation arises in the future where some newer version of a link relation type with different semantics is ever needed, it can be expressed as a different relation type.

The situation is not so simple for CRS URIs or conformance class URIs, where version number is more likely to be relevant. (We've already seen an example of this a bunch of years ago when the meaning of EPSG:4326 fractured into separate lat,lon and lon,lat interpretations.) There, a version number in the URI might be relevant and should be taken into consideration by clients. But then, as I stated earlier, a /0/ version meaning "latest" becomes problematic. And the CURIE prefix would need to include the version number.

@jerstlouis
Copy link
Member

jerstlouis commented Feb 11, 2025

@pomakis

After all, I can't imagine version numbers being relevant for link relation types.

This is exactly the point. Given that link relation types are simply a semantic concept, I don't see why they would need version numbers. I would argue the same for a 2DTMSs and DGGRSs which should never change or everything will break.

With version numbers, there's also potential confusion as to what that version number represents, which instead of the version of the concept itself, we've already seen:

  • confusion with the version of the standard in which they are referenced or described (normatively or informatively)
  • confusion with the version of the encoding of a particular description of the concept (e.g., the JSON encoding from 2DTMS v1 vs. v2)

For URIs of concepts (like 2DTMS) maintained separately from standards (e.g. in a repository) or encodings, the version (if any) should relate only to the concept itself, and ideally, would never change as that will break things (completely new URIs should be created instead).

One could argue the same with the CRSs, but historically versions were used and things broke :)
URIs for standards, documents or software should definitely have versions.

So if a client application sees a URI stating version y, but is only programmed to handle version x of whatever the URI represents,

This is why I argue that "concepts" like link relation types or 2DTMS should be versionless and never change.

Otherwise, and for other things, we would need the ability to encode version numbers in CURIEs. Is that something for which we could describe a mapping?

Here I was just trying to avoid the extra version variation for link relation types primarily, but also hopefully for other things such as 2DTMSs and DGGRSs (which could remain fixed in stone forever and get a brand new /0/{id} if a similar but slightly different variation of the concept ever comes along).

@pomakis
Copy link

pomakis commented Feb 11, 2025

@jerstlouis I'm in full agreement. So how many different working groups do we need to convince of this?

@jerstlouis
Copy link
Member

@pomakis Ideally we would simply agree to all meet together in OGC API - Common sessions to discuss and agree or such broad-ranging issues, to avoid having to participate in 20 different meetings.

Happy to make it the topic of the week this Thursday 12:00 PM noon Gatineau/Ottawa time if everyone interested in this discussion can make it.

I think @pvretano already pinged several OGC API GitHub repo, perhaps we could add a mention of that meeting in those as well?

Hopefully @ghobona would also be available to discuss the Naming Authority implications.

Given the broad implications, we should probably also make whatever we propose a topic of discussion for the OGC API - Track sessions in Rome (we do have an OGC API - Common session reserved).

cc. @joanma747

@chris-little
Copy link

I think that a few years ago, the Naming Authority had determined that .../0/... as the latest version was problematic, but @ghobona probably has a better handle on the issue as it was then.

I agree with the position that @pomakis and @jerstlouis have taken, as it is akin to the IANA approach to media types: e.g. NetCDF does not had separate media types for versions 3 or 4, though that supplementary info/hint can be supplied.

(Note: the underlying data structures of NetCDF V3 and V4 are completely different.)

@jerstlouis
Copy link
Member

@chris-little regarding netCDF 3 vs. 4, see:

@chris-little
Copy link

@jerstlouis but see https://www.iana.org/assignments/provisional-standard-media-types/provisional-standard-media-types.xhtml
application/netcdf in the Provisional Standard Media Type Registry.

@jerstlouis
Copy link
Member

@chris-little Yes, I know there's a provisional media type, but that says nothing about netcdf3 vs. 4 profile, while the issue includes discussion about potentially supporting media type parameter to indicate this.

@m-mohr
Copy link
Contributor

m-mohr commented Feb 13, 2025

There's a simple way to avoid all this: Don't use CURIEs. I don't see a benefit over URIs, most of it is just for communication between machines anyway.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Part 1: Core Issue related to Part 1 - Core
Projects
Status: In Progress
Development

No branches or pull requests

7 participants