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

Story/q20 19 #23

Open
wants to merge 201 commits into
base: develop
Choose a base branch
from
Open

Story/q20 19 #23

wants to merge 201 commits into from

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
@ShivaniYerram ShivaniYerram reopened this May 23, 2023
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.

there is a lot of code here that's also in the other PR I just reviewed, isn't there? Please reopen once the common code has been merged.

quadriga/pom.xml Outdated


<conceptpower.base.url></conceptpower.base.url>
<conceptpower.id.endpoint></conceptpower.id.endpoint>
Copy link
Member

Choose a reason for hiding this comment

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

remove it here

@jdamerow
Copy link
Member

also, there are conflicts.

@jdamerow jdamerow closed this May 24, 2023
# Conflicts:
#	quadriga/pom.xml
#	quadriga/src/main/java/edu/asu/diging/quadriga/core/model/Collection.java
#	quadriga/src/main/java/edu/asu/diging/quadriga/core/service/CollectionManager.java
#	quadriga/src/main/java/edu/asu/diging/quadriga/core/service/impl/EventGraphServiceImpl.java
#	quadriga/src/main/java/edu/asu/diging/quadriga/core/service/impl/MappedTripleGroupServiceImpl.java
#	quadriga/src/main/java/edu/asu/diging/quadriga/web/DisplayCollectionController.java
@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.

@@ -145,7 +151,13 @@ public MappedTripleGroup get(String collectionId, MappedTripleType mappedTripleT
// we create a new MappedTripleGroup entry
if (mappedTripleGroup == null) {
mappedTripleGroup = add(collectionId, mappedTripleType);

// If mappedTripleGroup add fails
Copy link
Member

Choose a reason for hiding this comment

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

shouldn't this be made known to the upper layers via an exception?

@@ -6,6 +6,9 @@ db.password=${db.password}
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
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.

7 participants