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

Platform n organisation vocabs (processing data from ARDC and populating vocabs index contents) #112

Closed
wants to merge 31 commits into from

Conversation

vietnguyengit
Copy link
Contributor

No description provided.

@vietnguyengit vietnguyengit marked this pull request as draft August 28, 2024 00:35
@vietnguyengit vietnguyengit changed the title Platform n organisation vocabs Platform n organisation vocabs (processing data from ARDC and populating vocabs index contents) Aug 29, 2024
Comment on lines +28 to +30
public void init() throws IOException {
// this could take a few minutes to complete, in development, you can skip it with -Dapp.initialiseVocabsIndex=false
// you can call /api/v1/indexer/ext/vocabs/populate endpoint to manually refresh the vocabs index, without waiting for the scheduled task
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just want to highlight this

@vietnguyengit vietnguyengit marked this pull request as ready for review September 2, 2024 22:50
assertTrue(parameterVocabs.stream().anyMatch(vocab -> vocab.equalsIgnoreCase("temperature")));
assertTrue(parameterVocabs.stream().anyMatch(vocab -> vocab.equalsIgnoreCase("salinity")));
assertTrue(parameterVocabs.stream().anyMatch(vocab -> vocab.equalsIgnoreCase("carbon")));
assertTrue(parameterVocabs.stream().anyMatch(vocab -> vocab.equalsIgnoreCase("pH (total scale) of the water body")));
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so this might affect the UI design to display phrase-like selecting options

the second-level vocabs are not always short words, the current implementation to process ardc vocabs has bug overlooking vocabs that don't have leaf nodes (bottom-level).

I manually inspected the ardc apis to verify this, the current prod portal also has "pH (total scale) of the water body"

image

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well I am a bit lost on what you mean, is this a requirement ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no I meant what we currently have for parameter vocab has bug, this current PR you're reviewing will fix that.

the bug missed identifying some second-level vocabs

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and because some of them are very long, not just 1 or 2 words, when it appears in the new portal

in particular, here:
image

it may look ugly?

Copy link
Contributor Author

@vietnguyengit vietnguyengit Sep 3, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

e.g pH (total scale) of the water body has never been identified as second-level vocab (which should be, its parent node is Chemical) until this PR.

Comment on lines 138 to 141
String about = vocabNode.getAbout();
if (about != null && !about.isEmpty()) {
resourceUri = about;
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

risk getting null pointer exception here, I'll change to

            if (vocabNode.getAbout() != null && !vocabNode.getAbout().isEmpty()) {
                resourceUri = vocabNode.getAbout();
            }

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use safeGet() as much as you can it is easier

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will do altogether after the PR view

@utas-raymondng
Copy link
Contributor

Please close this one as replace by this #130

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.

2 participants