-
Notifications
You must be signed in to change notification settings - Fork 0
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 objects #1
base: origin_main
Are you sure you want to change the base?
Conversation
.buildFromSource(source, language, requestBaseUrl, | ||
configuration.getFormat(mediaType), configuration); | ||
configuration.getFormat(mediaType), configuration,request); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
configuration.getFormat(mediaType), configuration,request); | |
configuration.getFormat(mediaType), configuration, request); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank for the review, jose. I've run the code through an intellij reformat "cleanup". The first time I did this, it changed my javadocs and the checkstyle got very upset. However, I just re-ran it and it didn't make changes - all these types of problems should be fixed now.
@JsonProperty("systemInfo") | ||
@JacksonXmlProperty(localName = "systemInfo") | ||
@JsonInclude(Include.NON_EMPTY) | ||
private CollectionInfo systemInfo; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't find this property in https://docs.ogc.org/is/17-069r3/17-069r3.html#_api_landing_page, is this a custom extension?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes - I mentioned it, above, in the PR description. I've added java doc to make it more explicit in the code.
@JsonInclude(Include.NON_EMPTY) | ||
@XmlElementWrapper(name = "href") | ||
@XmlElement(name = "href") | ||
private String href; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This property is not defined in https://github.com/opengeospatial/ogcapi-records/blob/master/core/openapi/schemas/linkBase.yaml, but looks odd that is missing in the specification.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes - this looks like a mistake. I've put some comments in the code about this - and a link to another specification of link.
@@ -0,0 +1,42 @@ | |||
package org.fao.geonet.ogcapi.records.controller.model; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add file header
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done. NOTE: most of the files don't have the header.
|
||
public class JsonUtils { | ||
/** | ||
* todo - be language aware (send in desired language). Move to utility class. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see a TODO. Is this required to be implemented?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think its ok at the moment - I'll have to see if I can find some multi-lingual iso19193 files.
private List<String> crs = null; | ||
|
||
/** A list of contacts qualified by their role(s) in association |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's missing recordLanguages
, but not sure how relevant it is. See https://docs.ogc.org/DRAFTS/20-004.html#collection-properties-table
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will add this. I also see that there are a few others in the written spec versus whats in the .yml. Thanks for noticing this. It was on my todo list of things to check.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added the extra objects - the "Schema" object is VERY VERY complex. I didn't fully include it (because of the pattern properties). I've left TODOs for when this is necessary (its not at the moment). I notice that pygeoapi seems to include this.
CollectionInfoBuilder collectionInfoBuilder; | ||
|
||
@Autowired | ||
RecordService recordService; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems not used.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed
Added some documentation - modelled off |
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.
This will retrieve the GN
ServiceRecord
that's linked to a GNSource
DB row. This can be done in theGN 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).
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 toOgcApiLink
for consistency./
)The landing page JSON also includes a new property
systemInfo
which contains acatalog.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).
Most of the work is done in
ElasticIndexJson2CollectionInfo
- this converts the Elastic Index JSON object to the ogcapicatalog.yaml
object. There's also a simple test case inElasticIndexJson2CollectionInfoTest
.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