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 194 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 179 commits
Commits
Show all changes
194 commits
Select commit Hold shift + click to select a range
03e7120
[story/Q20-11] completed edit collections implementation, added unit …
Pooja444 Aug 26, 2021
e4a5a8b
[story/Q20-11] addressed review comments for edit collections
Pooja444 Sep 2, 2021
0a74117
[story/Q20-11] addressed review comments
Pooja444 Sep 7, 2021
2ada5f9
[story/Q20-12] added collectionId param while submitting network
Pooja444 Sep 3, 2021
19f9069
[story/Q20-12] added collectionId to EventGraph
Pooja444 Sep 7, 2021
ba4267b
[story/Q20-3] added token validity check
Pooja444 Sep 9, 2021
2167f2a
[Q20-7] Adding Citephere config
MaulikLim Sep 10, 2021
bd62381
[story/Q20-3] added token validation logic
Pooja444 Sep 10, 2021
3d8be96
[Q20-7] - Fetch apps from citesphere after registering quadriga
MaulikLim Sep 13, 2021
83e9aa8
[story/Q20-3] completed check token dev, started unit tests
Pooja444 Sep 14, 2021
df99e9e
[Q20-7] - Working on front-end for multiple app selection
MaulikLim Sep 15, 2021
a23bc9a
[story/Q20-3] partially completed unit tests
Pooja444 Sep 16, 2021
d31e504
[story/Q20-3] added few more test cases
Pooja444 Sep 16, 2021
b1c48b8
[story/Q20-3] completed all unit tests
Pooja444 Sep 17, 2021
4b261e3
[story/Q20-3] added required=true for authHeader
Pooja444 Sep 17, 2021
a2a3ccf
[Q20-7] - Replaced pop-up selection with list selection
MaulikLim Sep 17, 2021
5ead2a8
[story/Q20-12] changed Objects.isNull to simple null check
Pooja444 Sep 17, 2021
5e63e67
[story/Q20-3] changed Objects.isNull to simple null check
Pooja444 Sep 17, 2021
e6db79d
[Q20-7] - Completed front-end for add collections part
MaulikLim Sep 20, 2021
ecab67d
[Q20-7] - fixed test case
MaulikLim Sep 20, 2021
d3cbe2a
[story/Q20-18] added view to display collection info
Pooja444 Sep 21, 2021
dc4c9c3
[story/Q20-18] added creationTime to network graph
Pooja444 Sep 23, 2021
4ddadf0
[story/Q20-18] added last network submission info
Pooja444 Sep 23, 2021
27ed3e7
[story/Q20-12] addressed review comments
Pooja444 Sep 23, 2021
ad11972
[story/Q20-12] resolved merge conflicts with story Q20-11
Pooja444 Sep 23, 2021
82122dc
[story/Q20-12] removed double test cases
Pooja444 Sep 23, 2021
1425d51
[story/Q20-12] caught IllegalArgumentException while finding collection
Pooja444 Sep 23, 2021
a6375e7
[story/Q20-12] removed unnecessary null check
Pooja444 Sep 23, 2021
f2f3873
[story/Q20-18] Merge branch 'develop' of github.com:diging/quadriga-2…
Pooja444 Sep 23, 2021
2035910
[story/Q20-12] removed unncessary file changes
Pooja444 Sep 23, 2021
a52e64a
[story/Q20-12] removed unncessary file changes
Pooja444 Sep 23, 2021
d73135f
[Q20-18] added last submitted network time
Pooja444 Sep 23, 2021
f3d7a5a
[story/Q20-12] added mappedCollection to map mappedNetwork with colle…
Pooja444 Sep 24, 2021
8867145
[Q20-12] linked collection with concepts, edges, added unit tests
Pooja444 Sep 27, 2021
91d1ea6
[Q20-7] resolved merge conflicts, fixed test cases
MaulikLim Sep 29, 2021
738db5f
[Q20-12] added all test cases MappedCollectionService
Pooja444 Sep 30, 2021
4614aa9
[Q20-12] added mappedCollection to concepts and edges
Pooja444 Sep 30, 2021
4e9e6e9
[Q20-12] added mappedCollection to EventGraph
Pooja444 Sep 30, 2021
44e7c24
[Q20-18] Resolving merge conflicts between Q20-12 and Q20-18
Pooja444 Oct 1, 2021
33c05a4
[Q20-18] added exception handling in DisplayCollectionController
Pooja444 Oct 1, 2021
4585d32
[Q20-7] - implemented front-end for adding apps to collections for ed…
MaulikLim Oct 1, 2021
068ecf5
[Q20-12] set collectionId to EventGraph
Pooja444 Oct 1, 2021
30298c1
[Q20-18] resolving merge conflicts between Q20-12 and Q20-18
Pooja444 Oct 1, 2021
e19ef10
[Q20-18] Resolving conflicts between Q20-18 and Q20-3
Pooja444 Oct 1, 2021
85ad52a
[Q20-3] changed tokenValidatorImpl to tokenValidator
Pooja444 Oct 1, 2021
44fb9ae
[Q20-7] - code cleanup, added interaction for checkbox
MaulikLim Oct 1, 2021
bd25d2d
[Q20-7] - minor corrections
MaulikLim Oct 1, 2021
1291e9d
[Q20-18] added appName property to EventGraph
Pooja444 Oct 1, 2021
d85dc80
[Q20-3] modified logic to get tokenInfo from TokenValidator
Pooja444 Oct 1, 2021
3ea2023
[Q20-3] resolving conflicts between Q20-3 and develop
Pooja444 Oct 1, 2021
58975fd
[Q20-3] changed initMocks to openMocks as per the new version
Pooja444 Oct 1, 2021
ef40d9c
[Q20-3] corrected javadoc for getTokenFromHeader
Pooja444 Oct 1, 2021
3c9592c
[Q20-18] resolving conflicts between Q20-18 and Q20-3
Pooja444 Oct 1, 2021
a371610
[Q20-18] added lastNetworkSubmittedBy logic
Pooja444 Oct 1, 2021
935c843
[Q20-3] improved getAuthHeader method
Pooja444 Oct 1, 2021
569803a
Merge branch 'story/Q20-3' of github.com:diging/quadriga-2.0 into sto…
Pooja444 Oct 1, 2021
a099184
[Q20-18] added lastNetworkSubmittedBy to displayCollection
Pooja444 Oct 1, 2021
7e9fb96
[Q20-18] added logic to display number of triples
Pooja444 Oct 5, 2021
2558d75
[Q20-7] - Made method to get citesphere access token public
MaulikLim Oct 6, 2021
f8d3d42
[Q20-18] added test cases for EventGraphServiceImpl
Pooja444 Oct 7, 2021
63dc182
[Q20-18] added default mapping to every network
Pooja444 Oct 8, 2021
bbfad1c
[Q20-18] fixed a bug and added a test case
Pooja444 Oct 8, 2021
310a563
[Q20-7] - revert back names for CollectionManager service
MaulikLim Oct 12, 2021
25c36b3
Merge branch 'story/Q20-3' of github.com:diging/quadriga-2.0 into sto…
Pooja444 Oct 14, 2021
e6e07c4
Merge branch 'story/Q20-18' of github.com:diging/quadriga-2.0 into st…
Pooja444 Oct 14, 2021
3af5222
[Q20-19] added pagination for networks in a collection
Pooja444 Oct 14, 2021
d191254
Merge branch 'story/Q20-18' of github.com:diging/quadriga-2.0 into st…
Pooja444 Oct 14, 2021
3956605
[Q20-7] - Made the getAccessToken() method private
MaulikLim Oct 15, 2021
b25b927
[Q20-7] - renamed CitesphereConnector classes
MaulikLim Oct 15, 2021
e2e25cf
[Q20-7] Included javadocs
MaulikLim Oct 15, 2021
509e3cb
[Q20-18] added default mappings and number of triples
Pooja444 Oct 15, 2021
95bd65c
Merge branch 'story/Q20-7' of github.com:diging/quadriga-2.0 into sto…
Pooja444 Oct 15, 2021
49981cf
[Q20-3] moved getToken methods to citeshere service
Pooja444 Oct 15, 2021
5ebd99c
[Q20-3] removed unnecessary extra dependency for nimbusds
Pooja444 Oct 15, 2021
e1654dc
Merge branch 'story/Q20-18' of github.com:diging/quadriga-2.0 into st…
Pooja444 Oct 19, 2021
d77619d
[Q20-19] added network controller and page
Pooja444 Oct 19, 2021
d4e32a1
[Q20-19] added network graph to network page with dummy data
Pooja444 Oct 21, 2021
12ca58d
[Q20-19] started with algorithm for displaying graph
Pooja444 Oct 22, 2021
12e5325
[Q20-19] added graph visualization logic from eventGraph
Pooja444 Oct 26, 2021
1cc84ce
[story/Q20-18] corrected defaultMapping logic
Pooja444 Oct 28, 2021
8a51ab0
Merge branch 'story/Q20-18' of github.com:diging/quadriga-2.0 into st…
Pooja444 Oct 29, 2021
7c2ed96
[Q20-19] implemented custom pagination for networks
Pooja444 Oct 29, 2021
1a64864
[Q20-19] added logic to convert multiple eventgraphs to one network
Pooja444 Nov 2, 2021
a5be290
[Q20-19] added test cases for EventGraphService
Pooja444 Nov 4, 2021
bbc9813
[Q20-19] started implementing conceptpower retrieval and persistence
Pooja444 Nov 5, 2021
d0575da
[Q20-19] added network details to network page
Pooja444 Nov 9, 2021
5ecab8b
[Q20-19] added conceptpower JSON parsing logic
Pooja444 Nov 12, 2021
9815c06
[Q20-19] created tables for ConceptPower in MySQL
Pooja444 Nov 16, 2021
ebf3325
[Q20-19] implemented concept caching logic
Pooja444 Nov 18, 2021
3b08100
[Q20-19] added logic for alternativeURIs, lastUpdated and deleting co…
Pooja444 Nov 19, 2021
29acec1
[Q20-19] added sourceURI validation, fixed alternativeURI bug
Pooja444 Nov 23, 2021
2091064
[Q20-19] added lazy collection fix
Pooja444 Nov 23, 2021
ece353e
[Q20-19] added lazy collection fix
Pooja444 Nov 23, 2021
425ecaf
[Q20-19] resolved few issues with conceptcache
Pooja444 Nov 30, 2021
cc5b478
[Q20-19] started with test cases for graph creation
Pooja444 Nov 30, 2021
ebd5a60
added test cases for ConceptPower cache and connector services
Pooja444 Dec 2, 2021
e4c4ca4
[Q20-19] added unit tests for ConceptPowerService
Pooja444 Dec 3, 2021
2313e87
[Q20-19] added adll GraphCreationServiceImpl tests
Pooja444 Dec 13, 2021
430ca90
[Q20-19] added tests for saveConceptCacheFromConceptPowerReply
Pooja444 Dec 13, 2021
b9c036c
[Q20-19] completed all unit tests
Pooja444 Dec 14, 2021
a63b893
[Q20-19] removed unnecessary TODO
Pooja444 Dec 14, 2021
5d41516
Merge branch 'story/Q20-3' of github.com:diging/quadriga-2.0 into sto…
Pooja444 Dec 14, 2021
ed1746a
[Q20-19] corrected indentation level, added missing dependency
Pooja444 Dec 15, 2021
8b8ae17
[Q20-18] added missing dependency
Pooja444 Dec 15, 2021
f2ff9e2
Merge branch 'story/Q20-18' of github.com:diging/quadriga-2.0 into st…
Pooja444 Dec 15, 2021
c1f4f09
[Q20-19] corrected indentation level
Pooja444 Dec 15, 2021
e8718ee
[Q20-19] fixing codefactor issues
Pooja444 Dec 15, 2021
2cba6cc
[Q20-19] fixing codefactor issues
Pooja444 Dec 15, 2021
25513df
[Q20-19] fixing codefactor issues
Pooja444 Dec 15, 2021
bc33ec1
[Q20-12] made changes as per PR comments
Pooja444 Jan 4, 2022
43de630
Merge branch 'story/Q20-12' of github.com:diging/quadriga-2.0 into st…
Pooja444 Jan 4, 2022
419f668
[Q20-18] removed unnecessary mappingType from Concepts and Predicates
Pooja444 Jan 5, 2022
14e261d
[Q20-12] added logic where new MappedTripleGroup is created per network
Pooja444 Jan 5, 2022
1305bb7
Merge branch 'story/Q20-12' of github.com:diging/quadriga-2.0 into st…
Pooja444 Jan 5, 2022
6f222c9
[Q20-18] added MappedTripleGroup related changes
Pooja444 Jan 5, 2022
86208ab
Merge branch 'story/Q20-18' of github.com:diging/quadriga-2.0 into st…
Pooja444 Jan 5, 2022
433d214
[Q20-12] addressed review comments
Pooja444 Jan 6, 2022
23ad602
Merge branch 'story/Q20-12' of github.com:diging/quadriga-2.0 into st…
Pooja444 Jan 6, 2022
b22d407
[Q20-18] updated defaultMapping logic as per MappedTripleGroups
Pooja444 Jan 6, 2022
4058d2c
Merge branch 'story/Q20-3' of github.com:diging/quadriga-2.0 into sto…
Pooja444 Jan 6, 2022
a2d6d5b
[Q20-12] updated javadoc comments
Pooja444 Jan 6, 2022
e1c3b33
[Q20-12] resolved code factor issue
Pooja444 Jan 6, 2022
dde92e1
[Q20-18] completed changes for OffsetDateTime
Pooja444 Jan 7, 2022
14b2ff4
[Q20-18] fixed CodeFactor issues
Pooja444 Jan 7, 2022
aad3e95
Merge branch 'story/Q20-18' of github.com:diging/quadriga-2.0 into st…
Pooja444 Jan 7, 2022
830bdc4
[Q20-19] completed changes as per updates to Q20-18
Pooja444 Jan 7, 2022
cedf185
[Q20-12] addressed review comments
Pooja444 Jan 11, 2022
2eede6c
Merge branch 'story/Q20-12' of github.com:diging/quadriga-2.0 into st…
Pooja444 Jan 11, 2022
4d92223
[Q20-18] removed unnecessary method from MappedTripleGroupService
Pooja444 Jan 11, 2022
7d7e144
Merge branch 'story/Q20-18' of github.com:diging/quadriga-2.0 into st…
Pooja444 Jan 11, 2022
af95ceb
Merge branch 'develop' of github.com:diging/quadriga-2.0 into story/Q…
Pooja444 Jan 31, 2022
28cc4c7
[Q20-18] updated Q20-18 as per modified Q20-12
Pooja444 Jan 31, 2022
39e7bc5
[Q20-18] corrected code factor issue
Pooja444 Jan 31, 2022
54e39a3
[Q20-18] review comments
Mar 8, 2022
7eaaa43
[Q20-18] refactor
Mar 17, 2022
aecbb8e
[Q20-18] added test case
Mar 18, 2022
cf42c39
[Q20-18] code factor
Mar 18, 2022
6743f67
[Q20-18] refactor
Mar 18, 2022
c8e2cfa
[Q20-18] refactor
Mar 18, 2022
5be7a71
[Q20-18] refactor
Mar 18, 2022
042da8f
[Q20-18] review comments
Mar 22, 2022
d539efb
[Q20-18] modified event graph aggregation
Mar 25, 2022
23c1dba
[Q20-18] refactored
Mar 25, 2022
4bdd28c
[Q20-18] modified find all to findFirst eventgraph to get latest
Mar 25, 2022
11c7322
[Q20-18] removed unwanted import
Mar 25, 2022
e374c05
[Q20-19] pulled latest changes from Q20-18
Mar 29, 2022
468f35c
[Q20-19] fixed test cases
Mar 31, 2022
a194e14
[Q20-18] modified find first return type
Apr 1, 2022
4848a2f
[Q20-18] refactor
Apr 1, 2022
a83519e
[Q20-18] indentation
Apr 1, 2022
6ccb356
[Q20-18] review comment
Apr 7, 2022
38d9994
[Q20-18] addded null and empty check
Apr 7, 2022
1775498
[Q20-19] updated branch with latest changes from Q20-18
Apr 8, 2022
643c0c1
[Q20-19] removed commented code
Apr 14, 2022
def1c1a
[Q20-19] indentation
Apr 14, 2022
489a236
[Q20-18] addressed review comments
Apr 19, 2022
46cfbd4
[Q20-18] removed unwanted lines
Apr 19, 2022
37d1f81
[Q20-18] merged develop into story/q20-18
Apr 19, 2022
7784067
[Q20-19] fixed merge conflict
Apr 19, 2022
4c0ca46
[Q20-18] removed unwanted lines
Apr 19, 2022
517d697
[Q20-18] remove unwanted file changes
Apr 19, 2022
0058a6c
[Q20-18] refactored add network api controller
Apr 22, 2022
c4c4436
[Q20-18] refactored collectionController
Apr 22, 2022
ca54d84
[Q20-18] latest network
Apr 22, 2022
56d6635
[Q20-18] latest network null condition
May 5, 2022
0ef1a95
[Q20-19] merged develop
May 5, 2022
fc99228
[Q20-19] updated story/q20-18
May 5, 2022
3e05448
[Q20-19] refactor
May 5, 2022
2ca90e5
[Q20-19] concept cache refactor
May 6, 2022
29ee7b9
[Q20-19] pom xml
May 6, 2022
fa56f02
[Q20-19]
May 6, 2022
47e1274
[Q20-19] resolved conflicts
May 17, 2022
6e362ee
[Q20-19] revert config.properties change
May 17, 2022
cc54be3
[Q20-19] removed unnecessary changes
May 17, 2022
7b4acc0
[Q20-19] addressed PR review comments
May 24, 2022
24666d4
[Q20-19] added pagination for display networks
May 25, 2022
2492f19
[Q20-19] refactor
May 25, 2022
740c589
[Q20-19] removed appName
May 25, 2022
5570d08
[Q20-19] added page and size as request param
May 25, 2022
6626db7
[Q20-19] pr review comments
Jun 9, 2022
ce57820
[Q20-19] review comment
Jun 9, 2022
050afff
[Q20-19] refactor
Jun 9, 2022
0a429ba
[Q20-19] refactor
Jun 9, 2022
4f77dc2
[Q20-19] Addressed review comments.
ShivaniYerram May 23, 2023
2de4433
Merge branch 'develop' into story/Q20-19
pooja-thalur Sep 17, 2024
2db6fc6
[Q20-19] review comments addressed
pooja-thalur Sep 17, 2024
7519a39
[Q20-19] fixing codefactor issue
pooja-thalur Sep 24, 2024
2527a8b
[Q20-19] codefactor issue
pooja-thalur Sep 24, 2024
6fe474e
[Q20-19] indentation changes
pooja-thalur Sep 24, 2024
7edb536
[Q20-19] upgrading security core dependency
pooja-thalur Sep 24, 2024
09d697f
[Q20-19] dependency upgrade
pooja-thalur Sep 24, 2024
4228f31
[Q20-19] jackson dependency upgraded
pooja-thalur Sep 24, 2024
c18e489
[Q20-19] reverting dependency update changes
pooja-thalur Sep 25, 2024
5cbc2a1
[Q20-19] unnecessary change removed
pooja-thalur Sep 25, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion quadriga/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@
<citesphere.base.url></citesphere.base.url>
<citesphere.client.id></citesphere.client.id>
<citesphere.client.secret></citesphere.client.secret>

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

Choose a reason for hiding this comment

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

is this used?


<log.level>info</log.level>

Expand Down Expand Up @@ -315,13 +318,15 @@
<version>3.1.0</version>
<scope>provided</scope>
</dependency>

<!-- https://mvnrepository.com/artifact/commons-validator/commons-validator -->
<dependency>
<groupId>commons-validator</groupId>
<artifactId>commons-validator</artifactId>
<version>1.7</version>
</dependency>

<!-- https://mvnrepository.com/artifact/org.ehcache/ehcache -->
</dependency>
<dependency>
<groupId>org.ehcache</groupId>
<artifactId>ehcache</artifactId>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package edu.asu.diging.quadriga.api.v1.model;

import edu.asu.diging.quadriga.core.model.Context;
import edu.asu.diging.quadriga.core.model.DefaultMapping;

public class Metadata {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package edu.asu.diging.quadriga.api.v1.model;

import edu.asu.diging.quadriga.core.model.Context;

public class NodeData {

private String label;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,11 @@
@Configuration
@PropertySource("classpath:config.properties")
@EnableTransactionManagement
@EnableJpaRepositories(basePackages = { "edu.asu.diging.quadriga.core.data", "edu.asu.diging.simpleusers.core.data" })
@EnableJpaRepositories(basePackages = {
"edu.asu.diging.quadriga.core.data",
"edu.asu.diging.quadriga.core.conceptpower.data",
"edu.asu.diging.simpleusers.core.data"
})
public class PersistenceConfig {

@Autowired
Expand All @@ -45,7 +49,10 @@ public DataSource dataSource() {
public LocalContainerEntityManagerFactoryBean entityManagerFactory() {
LocalContainerEntityManagerFactoryBean em = new LocalContainerEntityManagerFactoryBean();
em.setDataSource(dataSource());
em.setPackagesToScan(new String[] { "edu.asu.diging.quadriga.core.model", "edu.asu.diging.simpleusers.core.model" });
em.setPackagesToScan(new String[] { "edu.asu.diging.quadriga.core.model",
"edu.asu.diging.quadriga.core.conceptpower.model",
"edu.asu.diging.simpleusers.core.model"
});

JpaVendorAdapter vendorAdapter = new HibernateJpaVendorAdapter();
em.setJpaVendorAdapter(vendorAdapter);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package edu.asu.diging.quadriga.core.conceptpower.data;

import java.util.List;

import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
import org.springframework.stereotype.Repository;

import edu.asu.diging.quadriga.core.conceptpower.model.ConceptCache;

/**
*
* An interface used to retrieve data from conceptpower_concept_entry table that
* stores data extracted from ConceptPower
*
* @author poojakulkarni
*
*/
@Repository
public interface ConceptCacheRepository extends PagingAndSortingRepository<ConceptCache, String> {

@Query("SELECT c from ConceptCache c WHERE ?1 in elements(c.alternativeUris)")
public List<ConceptCache> findConceptByAlternativeURI(String uri);

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package edu.asu.diging.quadriga.core.conceptpower.data;

import org.springframework.data.repository.PagingAndSortingRepository;
import org.springframework.stereotype.Repository;

import edu.asu.diging.quadriga.core.conceptpower.model.ConceptType;

/**
* An interface used to retrieve data from conceptpower_concept_type table that
* stores information for a concept's type extracted from ConceptPower
*
* @author poojakulkarni
*
*/
@Repository
public interface ConceptTypeRepository extends PagingAndSortingRepository<ConceptType, String> {

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,226 @@
package edu.asu.diging.quadriga.core.conceptpower.model;

import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.List;

import javax.persistence.CollectionTable;
import javax.persistence.ElementCollection;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Lob;
import javax.persistence.Table;
import javax.persistence.Transient;

import org.apache.commons.lang3.StringUtils;
import org.hibernate.annotations.LazyCollection;
import org.hibernate.annotations.LazyCollectionOption;

/**
* This class represents the 'conceptpower_concept_cache' table present in the
* database that stores cached concept data
*
* @author Digital Innovation Group
*
*/
@Entity
@Table(name = "conceptpower_concept_cache")
public class ConceptCache implements Serializable, Comparable<ConceptCache> {

/**
*
*/
Copy link
Member

Choose a reason for hiding this comment

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

remove if there is no javadoc

private static final long serialVersionUID = 6260562492095202271L;
Copy link
Member

Choose a reason for hiding this comment

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

should start at 1


@Id
private String uri;
private String id;
private String word;
private String pos;

@Lob
private String description;

private String conceptList;
private String typeId;
private boolean deleted;
private LocalDateTime lastUpdated;

@ElementCollection
@LazyCollection(LazyCollectionOption.FALSE)
@CollectionTable(name = "conceptpower_alternative_uris")
private List<String> alternativeUris;

@ElementCollection
@LazyCollection(LazyCollectionOption.FALSE)
@CollectionTable(name = "conceptpower_equal_to")
private List<String> equalTo;

@ElementCollection
@LazyCollection(LazyCollectionOption.FALSE)
@CollectionTable(name = "conceptpower_wordnetids")
private List<String> wordNetIds;

private String creatorId;

@Transient
private ConceptType conceptType;

public ConceptCache() {
this.lastUpdated = LocalDateTime.now();
}

public String getUri() {
return uri;
}

public void setUri(String uri) {
this.uri = uri;
}

public String getId() {
return id;
}

public void setId(String id) {
this.id = id;
}

public String getWord() {
return word;
}

public void setWord(String word) {
this.word = word;
}

public String getPos() {
return pos;
}

public void setPos(String pos) {
this.pos = pos;
}

public String getDescription() {
return description;
}

public void setDescription(String description) {
this.description = description;
}

public String getConceptList() {
return conceptList;
}

public void setConceptList(String conceptList) {
this.conceptList = conceptList;
}

public String getTypeId() {
return typeId;
}

public void setTypeId(String typeId) {
this.typeId = typeId;
}

public boolean isDeleted() {
return deleted;
}

public void setDeleted(boolean deleted) {
this.deleted = deleted;
}

public LocalDateTime getLastUpdated() {
return lastUpdated;
}

public void setLastUpdated(LocalDateTime lastUpdated) {
this.lastUpdated = lastUpdated;
}

public List<String> getAlternativeUris() {
return alternativeUris;
}

public void setAlternativeUris(List<String> alternativeUris) {
this.alternativeUris = alternativeUris;
}

public List<String> getEqualTo() {
return equalTo;
}

public void setEqualTo(List<String> equalTo) {
this.equalTo = equalTo;
}

public List<String> getWordNetIds() {
return wordNetIds;
}

public void setWordNetIds(List<String> wordNetIds) {
this.wordNetIds = wordNetIds;
}

public String getCreatorId() {
return creatorId;
}

public void setCreatorId(String creatorId) {
this.creatorId = creatorId;
}

public ConceptType getConceptType() {
return conceptType;
}

public void setConceptType(ConceptType conceptType) {
this.conceptType = conceptType;
}

@Override
public int compareTo(ConceptCache conceptCache) {
// 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

if(isDifferentList(conceptCache.getAlternativeUris(), this.getAlternativeUris())) return -1;
if(isDifferentList(conceptCache.getEqualTo(), this.getEqualTo())) return -1;
if(isDifferentList(conceptCache.getWordNetIds(), this.getWordNetIds())) return -1;
if (isDifferentString(conceptCache.getConceptList(), this.getConceptList())) return -1;
if (isDifferentString(conceptCache.getCreatorId(), this.getCreatorId())) return -1;
if (isDifferentString(conceptCache.getDescription(), this.getDescription())) return -1;
if (isDifferentString(conceptCache.getId(), this.getId())) return -1;
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;
return 0;
}

private static boolean isDifferentString(String str1, String str2) {
if(!(StringUtils.isEmpty(str1) && StringUtils.isEmpty(str2))
&& (StringUtils.isEmpty(str1) || !str1.equals(str2))) {
return true;
}
return false;
}

private static boolean isDifferentList(List<String> list1, List<String> list2) {
if (!(isNullOrEmpty(list1) && isNullOrEmpty(list2)
&& (isNullOrEmpty(list1) || !list1.equals(list2)))) {
return true;
}
return false;
}

private static boolean isNullOrEmpty(List<String> list) {
return list == null || list.isEmpty();
}

}
Loading