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

Issue #KN-1041 : Enhance the graph database configuration to support connection for JanusGraph #1088

Open
wants to merge 50 commits into
base: janusgraph
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
0fe1a8e
Issue KN-000 merge: Merge Release 5.6.0 into Master (#984)
pallakartheekreddy Sep 8, 2023
96390d4
Issue #KN fix: Updated the mvn command to build for content service
aimansharief Sep 13, 2023
4827b54
Merge pull request #990 from aimansharief/KN-UpdateReadme
pallakartheekreddy Nov 9, 2023
56ce3e5
Issue #KN-1041 fix: updated code to create vertices and edges
aimansharief May 19, 2024
9711990
Issue #KN-1041 fix: updated code for Gremlin Operations
aimansharief May 21, 2024
e82cb63
Issue #KN-1041 fix: Added fix for the vertex creation
aimansharief May 22, 2024
82a8551
Issue #KN-1041 fix: Restructure code specific for JanusGraph
aimansharief May 22, 2024
c908ece
Issue #KN-1041 fix: Unique key constraint violation error handling added
pallakartheekreddy May 22, 2024
4c55f1e
Issue #KN-1041 fix: Updated code to support the read vertex functiona…
aimansharief May 23, 2024
a45c601
Read Vertex changes initial commit
pallakartheekreddy May 23, 2024
815a463
Issue #KN-1041 fix: Updated the code to create and read vertex
aimansharief May 24, 2024
b030a54
Update relation changes
pallakartheekreddy May 24, 2024
37a742b
Issue #KN-1041 fix: added upsert vertex changes
shourya-solanki May 24, 2024
0e5b465
Issue #KN-1041 fix: Fixed the code to get values in a proper format
aimansharief May 24, 2024
a4ac065
Update Vertex fixes
pallakartheekreddy May 24, 2024
dd12903
Issue #KN-1041 fix: Added code to delete vertex
aimansharief May 24, 2024
6fa3853
Issue #KN-1041 fix: Added getNodeProperty and checkCyclicLoop
aimansharief May 27, 2024
b44ef9d
Issue #KN-1041 fix: 1. added updateVertexes changes, 2. added updateR…
ShouraySolanki May 27, 2024
dc127d5
Issue #KN-1041 fix: resolved merge conflicts
ShouraySolanki May 27, 2024
aed8969
Issue #KN-1041 fix: updated updateVertexes code
ShouraySolanki May 27, 2024
9689f73
Subgraph changes
pallakartheekreddy May 27, 2024
d84de81
Issue #KN-1041 fix: Vertex read and subgraph queries issue fixes
pallakartheekreddy May 30, 2024
5ea9a6b
Remove Neo4j dependency from Relation Model
pallakartheekreddy May 30, 2024
a271446
getNodeByUniqueIds added for JanusGraph
pallakartheekreddy Jun 3, 2024
9ead086
Issue #KN-1041 fix: getNodeByUniqueIds code refactoring
pallakartheekreddy Jun 5, 2024
b4b95ba
Issue #KN-1041 fix: Create Vertex changes
pallakartheekreddy Jun 5, 2024
86c2535
Issue #KN-1041 fix: Create Relations refactoring
pallakartheekreddy Jun 5, 2024
575d691
Issue #KN-1041 fix: Refactoring Code to use graph client to run queries
aimansharief Jun 5, 2024
6f75d50
Issue #KN-1041 fix: Refactoring Code to use graph client to run queries
pallakartheekreddy Jun 5, 2024
306d554
Issue #KN-1041 fix: Updated the upsert vertex query
aimansharief Jun 5, 2024
e25da51
Issue #KN-1041 fix: Added fix to handle null values
aimansharief Jun 5, 2024
bb6bf87
Issue #KN-1041 fix: Updated upsert, upsertRootVertex and updateVertic…
aimansharief Jun 6, 2024
2448831
Issue #KN-1041 fix: Graph Service generalization support multiple gra…
pallakartheekreddy Jun 6, 2024
5d15c4e
Issue #KN-1041 fix: Added fix for the queries getting created
aimansharief Jun 6, 2024
afe4d79
Issue #KN-1041 fix: Updated delete query to return Boolean value afte…
aimansharief Jun 7, 2024
257d979
Issue #KN-1041 fix: Neo4j & Janus are Implementations added
pallakartheekreddy Jun 7, 2024
b02f3fb
Issue #KN-1041 fix: Added fixes for TestCases to use Neo4j Graph Serv…
aimansharief Jun 12, 2024
d2a2c24
Issue #KN-1041 fix: Added fix for read
aimansharief Jun 21, 2024
b4b38c0
Issue #KN-1041 fix: Test case fix
aimansharief Jun 21, 2024
f243996
Issue #KN-1041 fix: Added fix for upsertVertex
aimansharief Jun 24, 2024
fd39121
Merge remote-tracking branch 'upstream/master' into janusGraph
aimansharief Jun 25, 2024
f718a67
Merge branch 'release-6.1.0' into janusGraph
aimansharief Jun 25, 2024
a7c2ca9
Merge branch 'janusGraph' into janusGraph-2.0
aimansharief Jun 25, 2024
5c13038
Issue #KN-1041 fix: Updated fixes in the query generation methods
aimansharief Jun 26, 2024
2db0501
Issue #KN-1041 fix: Updated code to execute queries Asynchronously
aimansharief Jun 27, 2024
13fc8b5
Issue #KN-1041 fix: Added await for the root-node to complete
aimansharief Jun 27, 2024
7bf1528
Issue #KN-1041 fix: Updated code to create edges asynchronously and C…
aimansharief Jun 27, 2024
94dda7a
Issue #KN-1041 fix: Refactoring code to execute async queries
aimansharief Jul 1, 2024
643d714
Update ContentActor.scala
aimansharief Jul 16, 2024
4e9c66c
Update EventActor.scala
aimansharief Jul 16, 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
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import org.sunbird.common.{HttpUtil, JsonUtils}
import org.sunbird.common.dto.{Request, Response}
import org.sunbird.common.exception.ResponseCode
import org.sunbird.graph.dac.model.{Node, SearchCriteria}
import org.sunbird.graph.{GraphService, OntologyEngineContext}
import org.sunbird.graph.{Neo4jGraphService, OntologyEngineContext}

import java.io.File
import java.util.concurrent.TimeUnit
Expand All @@ -26,7 +26,7 @@ class TestCollectionCSVActor extends FlatSpec with Matchers with MockFactory {
val httpUtil: HttpUtil = mock[HttpUtil]
implicit val ss: StorageService = mock[StorageService]
implicit val oec: OntologyEngineContext = mock[OntologyEngineContext]
val graphDB: GraphService = mock[GraphService]
val graphDB: Neo4jGraphService = mock[Neo4jGraphService]
val currentDirectory: String = new java.io.File(".").getCanonicalPath
val resourceDirectory: String = if(currentDirectory.contains("collection-csv-actors")) currentDirectory+"/src/test/resources/" else currentDirectory+"/content-api/collection-csv-actors/src/test/resources/"

Expand Down
13 changes: 13 additions & 0 deletions content-api/content-actors/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,19 @@
<version>2.5.22</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.sunbird</groupId>
<artifactId>graph-janusgraph-impl</artifactId>
<exclusions>
<exclusion>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
</exclusion>
</exclusions>
<version>1.0-SNAPSHOT</version>
<type>jar</type>
</dependency>
</dependencies>

<build>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,4 +79,4 @@ class EventActor @Inject()(implicit oec: OntologyEngineContext, ss: StorageServi
node
}

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import org.scalamock.scalatest.MockFactory
import org.sunbird.cloudstore.StorageService
import org.sunbird.common.dto.Request
import org.sunbird.graph.dac.model.{Node, SearchCriteria}
import org.sunbird.graph.{GraphService, OntologyEngineContext}
import org.sunbird.graph.{Neo4jGraphService, OntologyEngineContext}

import scala.concurrent.ExecutionContext.Implicits.global
import java.util
Expand All @@ -25,7 +25,7 @@ class TestAppActor extends BaseSpec with MockFactory {

it should "return success response for 'create' operation" in {
implicit val oec: OntologyEngineContext = mock[OntologyEngineContext]
val graphDB = mock[GraphService]
val graphDB = mock[Neo4jGraphService]
(oec.graphService _).expects().returns(graphDB).anyNumberOfTimes()
val node = new Node("domain", "DATA_NODE", "App")
node.setIdentifier("android-org.test.sunbird.integration")
Expand Down Expand Up @@ -59,7 +59,7 @@ class TestAppActor extends BaseSpec with MockFactory {

it should "return success response for update" in {
implicit val oec: OntologyEngineContext = mock[OntologyEngineContext]
val graphDB = mock[GraphService]
val graphDB = mock[Neo4jGraphService]
(oec.graphService _).expects().returns(graphDB).anyNumberOfTimes()//.repeated(2)
val node = getValidNode()
(graphDB.getNodeByUniqueId(_: String, _: String, _: Boolean, _: Request)).expects(*, *, *, *).returns(Future(node)).anyNumberOfTimes()
Expand All @@ -78,7 +78,7 @@ class TestAppActor extends BaseSpec with MockFactory {

it should "return success response for read app" in {
implicit val oec: OntologyEngineContext = mock[OntologyEngineContext]
val graphDB = mock[GraphService]
val graphDB = mock[Neo4jGraphService]
(oec.graphService _).expects().returns(graphDB).repeated(1)
val node = getValidNode()
(graphDB.getNodeByUniqueId(_: String, _: String, _: Boolean, _: Request)).expects(*, *, *, *).returns(Future(node)).anyNumberOfTimes()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import org.sunbird.cloudstore.StorageService
import org.sunbird.common.dto.{Request, Response}
import org.sunbird.common.exception.ResponseCode
import org.sunbird.graph.dac.model.{Node, SearchCriteria}
import org.sunbird.graph.{GraphService, OntologyEngineContext}
import org.sunbird.graph.{Neo4jGraphService, OntologyEngineContext}
import java.util

import scala.collection.JavaConversions.mapAsJavaMap
Expand All @@ -23,7 +23,7 @@ class TestAssetActor extends BaseSpec with MockFactory {

it should "return success response for 'copyAsset'" in {
implicit val oec: OntologyEngineContext = mock[OntologyEngineContext]
val graphDB = mock[GraphService]
val graphDB = mock[Neo4jGraphService]
(oec.graphService _).expects().returns(graphDB).anyNumberOfTimes()
val node = getNode()
(graphDB.getNodeByUniqueId(_: String, _: String, _: Boolean, _: Request)).expects(*, *, *, *).returns(Future(getNode()))
Expand All @@ -47,7 +47,7 @@ class TestAssetActor extends BaseSpec with MockFactory {
it should "copy asset with invalid objectType, should through client exception" in {
implicit val ss = mock[StorageService]
implicit val oec: OntologyEngineContext = mock[OntologyEngineContext]
val graphDB = mock[GraphService]
val graphDB = mock[Neo4jGraphService]
(oec.graphService _).expects().returns(graphDB).anyNumberOfTimes()
(graphDB.getNodeByUniqueId(_: String, _: String, _: Boolean, _: Request)).expects(*, *, *, *).returns(Future(getInvalidNode()))
val request = getContentRequest()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import org.scalamock.scalatest.MockFactory
import org.sunbird.cloudstore.StorageService
import org.sunbird.common.dto.Request
import org.sunbird.common.exception.ResponseCode
import org.sunbird.graph.{GraphService, OntologyEngineContext}
import org.sunbird.graph.{Neo4jGraphService, OntologyEngineContext}
import org.sunbird.graph.dac.model.{Node, SearchCriteria}

import scala.collection.JavaConversions.mapAsJavaMap
Expand All @@ -26,7 +26,7 @@ class TestCategoryActor extends BaseSpec with MockFactory{
it should "create a categoryNode and store it in neo4j" in {
implicit val ss = mock[StorageService]
implicit val oec: OntologyEngineContext = mock[OntologyEngineContext]
val graphDB = mock[GraphService]
val graphDB = mock[Neo4jGraphService]
(oec.graphService _).expects().returns(graphDB).anyNumberOfTimes()
(graphDB.addNode(_: String, _: Node)).expects(*, *).returns(Future(getValidNode()))
val nodes: util.List[Node] = getCategoryNode()
Expand Down Expand Up @@ -76,7 +76,7 @@ class TestCategoryActor extends BaseSpec with MockFactory{

it should "return success response for updateCategory" in {
implicit val oec: OntologyEngineContext = mock[OntologyEngineContext]
val graphDB = mock[GraphService]
val graphDB = mock[Neo4jGraphService]
(oec.graphService _).expects().returns(graphDB).anyNumberOfTimes()
val node = getValidNode()
(graphDB.getNodeByUniqueId(_: String, _: String, _: Boolean, _: Request)).expects(*, *, *, *).returns(Future(node)).anyNumberOfTimes()
Expand All @@ -96,7 +96,7 @@ class TestCategoryActor extends BaseSpec with MockFactory{

it should "return success response for readCategory" in {
implicit val oec: OntologyEngineContext = mock[OntologyEngineContext]
val graphDB = mock[GraphService]
val graphDB = mock[Neo4jGraphService]
(oec.graphService _).expects().returns(graphDB).repeated(1)
val node = getValidNode()
(graphDB.getNodeByUniqueId(_: String, _: String, _: Boolean, _: Request)).expects(*, *, *, *).returns(Future(node)).anyNumberOfTimes()
Expand All @@ -111,7 +111,7 @@ class TestCategoryActor extends BaseSpec with MockFactory{

it should "return success response for retireCategory" in {
implicit val oec: OntologyEngineContext = mock[OntologyEngineContext]
val graphDB = mock[GraphService]
val graphDB = mock[Neo4jGraphService]
(oec.graphService _).expects().returns(graphDB).anyNumberOfTimes()
val node = getValidNode()
(graphDB.getNodeByUniqueId(_: String, _: String, _: Boolean, _: Request)).expects(*, *, *, *).returns(Future(node)).anyNumberOfTimes()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import org.scalamock.scalatest.MockFactory
import org.sunbird.channel.actors.ChannelActor
import org.sunbird.common.dto.Request
import org.sunbird.graph.dac.model.{Node, SearchCriteria}
import org.sunbird.graph.{GraphService, OntologyEngineContext}
import org.sunbird.graph.{Neo4jGraphService, OntologyEngineContext}

import scala.collection.JavaConverters._
import scala.concurrent.Future
Expand All @@ -22,7 +22,7 @@ class TestChannelActor extends BaseSpec with MockFactory {

it should "return success response for 'createChannel' operation" in {
implicit val oec: OntologyEngineContext = mock[OntologyEngineContext]
val graphDB = mock[GraphService]
val graphDB = mock[Neo4jGraphService]
(oec.graphService _).expects().returns(graphDB).anyNumberOfTimes()
val node = new Node("domain", "DATA_NODE", "Channel")
node.setIdentifier("channel_test")
Expand Down Expand Up @@ -51,7 +51,7 @@ class TestChannelActor extends BaseSpec with MockFactory {

it should "throw invalid identifier exception for channelUpdate" in {
implicit val oec: OntologyEngineContext = mock[OntologyEngineContext]
val graphDB = mock[GraphService]
val graphDB = mock[Neo4jGraphService]
(oec.graphService _).expects().returns(graphDB)
val node = new Node("domain",mapAsJavaMap(Map("identifier" -> "channel_test", "nodeType"->"DATA_NODE", "objectType"->"Channel")))
node.setIdentifier("channel_test")
Expand All @@ -66,7 +66,7 @@ class TestChannelActor extends BaseSpec with MockFactory {

it should "return success response for 'readChannel' operation" in {
implicit val oec: OntologyEngineContext = mock[OntologyEngineContext]
val graphDB = mock[GraphService]
val graphDB = mock[Neo4jGraphService]
(oec.graphService _).expects().returns(graphDB)
val node = new Node("domain",mapAsJavaMap(Map("identifier" -> "channel_test", "nodeType"->"DATA_NODE", "objectType"->"Channel")))
node.setIdentifier("channel_test")
Expand All @@ -81,7 +81,7 @@ class TestChannelActor extends BaseSpec with MockFactory {

it should "return success response for 'updateChannel' operation" in {
implicit val oec: OntologyEngineContext = mock[OntologyEngineContext]
val graphDB = mock[GraphService]
val graphDB = mock[Neo4jGraphService]
(oec.graphService _).expects().returns(graphDB).anyNumberOfTimes()
val node = getNode("Channel", None)
node.setObjectType("Channel")
Expand All @@ -101,7 +101,7 @@ class TestChannelActor extends BaseSpec with MockFactory {

it should "return success response for 'retireChannel' operation" in {
implicit val oec: OntologyEngineContext = mock[OntologyEngineContext]
val graphDB = mock[GraphService]
val graphDB = mock[Neo4jGraphService]
(oec.graphService _).expects().returns(graphDB).anyNumberOfTimes()
val node = getNode("Channel", None)
node.setObjectType("Channel")
Expand Down
Loading