-
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
Story/q20 19 #23
base: develop
Are you sure you want to change the base?
Story/q20 19 #23
Conversation
….0 into story/Q20-18
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.
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> |
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.
remove it here
also, there are conflicts. |
# 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
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 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 |
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 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; |
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 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; |
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.
same as before
@Override | ||
public ConceptPowerReply getConceptPowerReply(String conceptURI) { | ||
Map<String, String> pathVariables = new HashMap<>(); | ||
pathVariables.put("concept_uri", conceptURI); |
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.
these are not path variables, are they? but parameters?
logger.error("Could not get concept for URI: " + conceptURI + " at URL: " + conceptPowerURL, e); | ||
} | ||
|
||
return null; |
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 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 |
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 should probably be part of the javadoc
List<ConceptEntry> conceptEntries = conceptPowerReply.getConceptEntries(); | ||
ConceptCache conceptCache = null; | ||
|
||
if (conceptEntries != null && !conceptEntries.isEmpty()) { |
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.
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 |
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.
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} |
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.
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} |
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 does not look right
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]
).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