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

Ogcapi records - better "catalog.yaml" objects #115

Open
wants to merge 11 commits into
base: main
Choose a base branch
from

Conversation

davidblasby
Copy link

This improves JSON output for the landing page (/), /collections, and /collections/<collectionid>.

In the output of these I inject the OGCAPI Records catalog.yaml object.

A GN Portal (full portal or sub-portal) is an OGCAPI Catalog.

  1. Getting info

This will retrieve the GN ServiceRecord that's linked to a GN Source DB row. This can be done in the GN GUI: Admin Console-Settings-sources for sub-portals.

There is no GUI to set this for the "main" portal - do this in GN GUI: Admin Console-Settings-Settings-Catalog Service for the Web (CSW)-Record to use for GetCapabilities (system/csw/capabilityRecordUuid).

Basically, this PR will retrieve this linked record via the Elastic Index (JSON). This is processed in GN via the index-utils.xsl.

If there isn't a linked service record, then the catalog details will not be added (i.e. unchanged from how GN ogcapi records used to work).

  1. New Model Objects

I have put in a bunch of new model objects - OgcApi*. These are 1:1 with the OGCAPI object model - defined in the spec as well as the .yaml files. I've copy-and-pasted in the documentation from the .yaml files for readability.

NOTE: I also moved the old Link object to OgcApiLink for consistency.

  1. Landing page (/)

The landing page JSON also includes a new property systemInfo which contains a catalog.yaml object in it.
I'm not sure if this is allowed in the spec, but it allows for more metadata about the entire GN system ("ogcapi-records" server). This is useful for making a nicer landing page (cf. pygeoapi's landing page).

  1. A few details

Most of the work is done in ElasticIndexJson2CollectionInfo - this converts the Elastic Index JSON object to the ogcapi catalog.yaml object. There's also a simple test case in ElasticIndexJson2CollectionInfoTest.

  1. Example

Underlying XML linked Service Record (xml)
9bac358b-11ec-4293-aeef-5a077b778412.txt

Elastic Index (JSON):
elastic-index-record.txt

OGCAPI catalog.yaml output (JSON):
ogcpai-catalog.json

@davidblasby
Copy link
Author

Original PR is here - davidblasby#1

(reviewed by @josegar74 )

@fxprunayre - would love to talk to you about this during the sprint this week.

@davidblasby
Copy link
Author

added 2 commits;

  1. update CORS to allow connections
    This shouldnt be a problem because the ogcapi is all GET-based (readonly)
  2. add collection (catalog/sub-portal) icon

Copy link

sonarcloud bot commented Sep 26, 2024

Quality Gate Failed Quality Gate failed

Failed conditions
1 Security Hotspot

See analysis details on SonarCloud

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant