Conversation
….0 into story/Q20-18
jdamerow
left a comment
There was a problem hiding this comment.
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.
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.
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; |
| @Override | ||
| public ConceptPowerReply getConceptPowerReply(String conceptURI) { | ||
| Map<String, String> pathVariables = new HashMap<>(); | ||
| pathVariables.put("concept_uri", conceptURI); |
There was a problem hiding this comment.
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.
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.
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.
turn this if around and just return if this condition is not met. It'll unindent all the following code.
...ga/src/main/java/edu/asu/diging/quadriga/core/service/impl/MappedTripleGroupServiceImpl.java
Show resolved
Hide resolved
| neo4j.url=${neo4j.url} | ||
| neo4j.database=${neo4j.database} | ||
|
|
||
| conceptpower_base_url=${conceptpower.base.url} |
There was a problem hiding this comment.
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} |
|
|
||
| ConceptCache conceptCache = conceptCacheService.getConceptByUri(uri); | ||
|
|
||
| conceptCacheUpdateInterval=0; |
|
|
||
| // Determine page number and size for network pagination | ||
| page = (page == null || page < 0) ? 0 : page - 1; | ||
| size = (size == null || size < 1) ? 10 : size; |
There was a problem hiding this comment.
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} |
There was a problem hiding this comment.
I think this has still not been added to the pom?
|
Make it so, Jenkins. |
|
Tests are failing |
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