Repository navigation
Conversation
Repositories store several ISO topic categories as one comma-separated
string (topicategory is a Text column), but:
- OGC API - Records / STAC made that whole string a single theme
concept, e.g. {'id': 'climatologyMeteorologyAtmosphere,environment'},
instead of one concept per topic category as it does for lists.
- The apiso and iso19115p3 profiles looped over the split values but
wrote the whole string in each MD_TopicCategoryCode, so a record with
two categories got two elements both holding "a,b".
Split the string into one concept, and one MD_TopicCategoryCode, per
value.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Repositories store several ISO topic categories as one comma-separated string (
topicategoryis aTextcolumn), and two places mishandle that:record2json): a list becomes one theme concept per entry, but a string becomes one concept holding the whole string:{"concepts": [{"id": "climatologyMeteorologyAtmosphere,environment"}], "scheme": "…#MD_TopicCategoryCode"}val.split(',')writesvalinstead ofv, so a record with two categories gets twogmd:topicCategory(ormri:topicCategory) elements, both containinga,b.Change
record2json: split a stringtopicategoryon commas into one concept per (stripped, non-empty) value. Lists are handled as before.v.strip()in eachMD_TopicCategoryCode.Tests
tests/unittests/test_ogc_api_records.py: a single value, two comma-separated values, extra spaces and a trailing comma, and a list. The two comma-separated cases fail without this change.not harvesting and not distributedsearch and not pubsub): 410 passed. No functional test record has several topic categories, so no expected output changes.climatologyMeteorologyAtmosphereandenvironment, whose Records API theme was the single conceptclimatologyMeteorologyAtmosphere,environment.