Skip to content

Conversation

@Pooja444
Copy link
Contributor

@Pooja444 Pooja444 commented Dec 14, 2021

Guidelines for Pull Requests

If you haven't yet read our code review guidelines, please do so, You can find them here.

Please confirm the following by adding an x for each item (turn [ ] into [x]).

  • I have removed all code style changes that are not necessary (e.g. changing blanks across the whole file that don’t need to be changed, adding empty lines in parts other than your own code)
  • I am not making any changes to files that don’t have any effect (e.g. imports added that don’t need to be added)
  • I do not have any sysout statements in my code or commented out code that isn’t needed anymore
  • I am not reformatting any files in the wrong format or without cause.
  • I am not changing file encoding or line endings to something else than UTF-8, LF
  • My pull request does not show an insane amount of files being changed although my ticket only requires a few files being changed
  • I have added Javadoc/documentation where appropriate
  • I have added test cases where appropriate
  • I have explained any part of my code/implementation decisions that is not be self-explanatory

Please provide a brief description of your ticket

(you can copy the ticket if it hasn't changed)

https://diging.atlassian.net/browse/Q20-19
On the collection page, it should be possible to browse all networks in collection -
basically a paginated list of all networks ordered by submission date. When the user clicks on a network it would be visualized (similar to the old quadriga).

Anything else the reviewer needs to know?

This story is dependent on story Q20-3, Q20-7, Q20-12, Q20-18 and since all of these stories are yet to be merged, this PR may show a lot of file changes that are actually part of the above stories. This will go away once all of these are merged

Pooja444 and others added 30 commits August 31, 2021 15:43
@pooja-thalur pooja-thalur reopened this Sep 25, 2024
Copy link
Member

@jdamerow jdamerow left a comment

Choose a reason for hiding this comment

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

It really throws me off that the ConceptPower classes capitalize the "P" 😅 the app is called "Conceptpower". Maybe change the class names? :)

// If both old and new cache values are null/blank/empty, nothing has changed
// If old value is null/blank/empty, new value is not null/blank/empty, difference present
// If old value is not null/blank/empty, new value is null/blank/empty, difference present
// If both are not null/blank/empty, we need to check difference
Copy link
Member

Choose a reason for hiding this comment

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

this should probably go into the javadoc (which is missing)

if (isDifferentString(conceptCache.getPos(), this.getPos())) return -1;
if (isDifferentString(conceptCache.getTypeId(), this.getTypeId())) return -1;
if (isDifferentString(conceptCache.getUri(), this.getUri())) return -1;
if (isDifferentString(conceptCache.getWord(), this.getWord())) return -1;
Copy link
Member

Choose a reason for hiding this comment

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

this is not following our formatting guidelines. or it could be put as an OR statement (formatted one condition a line), so that only once -1 is returned.

if(isDifferentString(type.getDescription(), this.getDescription())) return -1;
if(isDifferentString(type.getName(), this.getName())) return -1;
if(isDifferentString(type.getUri(), this.getUri())) return -1;
return 0;
Copy link
Member

Choose a reason for hiding this comment

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

same as before

@Override
public ConceptPowerReply getConceptPowerReply(String conceptURI) {
Map<String, String> pathVariables = new HashMap<>();
pathVariables.put("concept_uri", conceptURI);
Copy link
Member

Choose a reason for hiding this comment

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

these are not path variables, are they? but parameters?

logger.error("Could not get concept for URI: " + conceptURI + " at URL: " + conceptPowerURL, e);
}

return null;
Copy link
Member

Choose a reason for hiding this comment

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

it looks like don't where you use the return value, you don't check for null, which means it'll throw a nullpointer if conceptpower is down? or throws an error? The better approach would probably be throw an exception if there is no response or an exception from conceptpower, and then handle it appropriate where it makes sense.

private boolean updateConceptCache(ConceptCache conceptCache, ConceptCache conceptCacheOld, String uri) {

// ConceptPower returned a concept and either no conceptCache entry exists in the DB
// or if one exists, it is different from the current conceptCache entry
Copy link
Member

Choose a reason for hiding this comment

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

this should probably be part of the javadoc

List<ConceptEntry> conceptEntries = conceptPowerReply.getConceptEntries();
ConceptCache conceptCache = null;

if (conceptEntries != null && !conceptEntries.isEmpty()) {
Copy link
Member

Choose a reason for hiding this comment

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

turn this if around and just return if this condition is not met. It'll unindent all the following code.

neo4j.url=${neo4j.url}
neo4j.database=${neo4j.database}

conceptpower_base_url=${conceptpower.base.url}
Copy link
Member

Choose a reason for hiding this comment

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

there is no conceptpower.base.url property in the pom, is there? If this property is required here, it needs to be added to the pom.


citesphere_client_id=${citesphere.client.id}
citesphere_client_secret=${citesphere.client.secret}
citesphere_client_secret=${citesphere.client.id}
Copy link
Member

Choose a reason for hiding this comment

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

this does not look right

@jdamerow jdamerow closed this Nov 7, 2024
@pooja-thalur pooja-thalur reopened this Dec 20, 2024
@pooja-thalur pooja-thalur reopened this Jan 2, 2025
@pooja-thalur pooja-thalur mentioned this pull request Feb 5, 2025
9 tasks

ConceptCache conceptCache = conceptCacheService.getConceptByUri(uri);

conceptCacheUpdateInterval=0;
Copy link
Member

Choose a reason for hiding this comment

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

this seems wrong


// Determine page number and size for network pagination
page = (page == null || page < 0) ? 0 : page - 1;
size = (size == null || size < 1) ? 10 : size;
Copy link
Member

Choose a reason for hiding this comment

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

instead of checking for null you can just specify a default value in the RequestParam annotation

neo4j.url=${neo4j.url}
neo4j.database=${neo4j.database}

conceptpower_base_url=${conceptpower.base.url}
Copy link
Member

Choose a reason for hiding this comment

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

I think this has still not been added to the pom?

@jdamerow
Copy link
Member

jdamerow commented Feb 7, 2025

Make it so, Jenkins.

@jdamerow
Copy link
Member

jdamerow commented Feb 7, 2025

Tests are failing

@jdamerow jdamerow closed this Feb 7, 2025
@pooja-thalur pooja-thalur reopened this May 7, 2025
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.

8 participants