Skip to content

Commit bf60510

Browse files
committed
Fixing up the CG structure refactor
1 parent ee32247 commit bf60510

File tree

2 files changed

+19
-20
lines changed

2 files changed

+19
-20
lines changed

src/DistributedFactorGraphs.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -323,11 +323,11 @@ include("Common.jl")
323323
# Data Blob extensions
324324
include("DataBlobs/DataBlobs.jl")
325325

326-
if get(ENV, "DFG_USE_CGDFG", "") == "true"
326+
# if get(ENV, "DFG_USE_CGDFG", "") == "true"
327327
@info "Detected ENV[\"DFG_USE_CGDFG\"]: Including optional Neo4jDFG (LGPL) Driver"
328328
include("Neo4jDFG/Neo4jDFG.jl")
329329
@reexport using .Neo4jDFGs
330-
end
330+
# end
331331

332332
function __init__()
333333
@require GraphPlot = "a2cc645c-3eea-5389-862e-a155d0052231" begin

src/Neo4jDFG/services/CGStructure.jl

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ end
5858
$(SIGNATURES)
5959
Efficient shortcut method to create the user, robot, and session if it doesn't already exist.
6060
"""
61-
function createDfgSessionIfNotExist(dfg::CloudGraphsDFG)
61+
function createDfgSessionIfNotExist(dfg::Neo4jDFG)
6262
strip(dfg.userId) == "" && error("User ID is not populated in DFG.")
6363
strip(dfg.robotId) == "" && error("Robot ID is not populated in DFG.")
6464
strip(dfg.sessionId) == "" && error("Session ID is not populated in DFG.")
@@ -91,7 +91,7 @@ Returns nothing if it isn't found.
9191
Notes
9292
- Returns `Vector{Session}`
9393
"""
94-
function lsSessions(dfg::CloudGraphsDFG)
94+
function lsSessions(dfg::Neo4jDFG)
9595
sessionNodes = _getNeoNodesFromCyphonQuery(dfg.neo4jInstance, "(node:SESSION:`$(dfg.robotId)`:`$(dfg.userId)`)")
9696
return map(s -> _convertDictToSession(Neo4j.getnodeproperties(s)), sessionNodes)
9797
end
@@ -104,7 +104,7 @@ Returns nothing if it isn't found.
104104
Notes
105105
- Returns `::Vector{Robot}`
106106
"""
107-
function lsRobots(dfg::CloudGraphsDFG)
107+
function lsRobots(dfg::Neo4jDFG)
108108
robotNodes = _getNeoNodesFromCyphonQuery(dfg.neo4jInstance, "(node:ROBOT:`$(dfg.userId)`)")
109109
return map(s -> _convertDictToRobot(Neo4j.getnodeproperties(s)), robotNodes)
110110
end
@@ -117,7 +117,7 @@ Returns nothing if it isn't found.
117117
Notes
118118
- Returns `::Vector{User}`
119119
"""
120-
function lsUsers(dfg::CloudGraphsDFG)
120+
function lsUsers(dfg::Neo4jDFG)
121121
userNodes = _getNeoNodesFromCyphonQuery(dfg.neo4jInstance, "(node:USER)")
122122
return map(s -> _convertDictToUser(Neo4j.getnodeproperties(s)), userNodes)
123123
end
@@ -130,7 +130,7 @@ Returns nothing if it isn't found.
130130
Notes
131131
- Returns either `::Union{Session, Nothing}`
132132
"""
133-
function getSession(dfg::CloudGraphsDFG, userId::Symbol, robotId::Symbol, sessionId::Symbol)
133+
function getSession(dfg::Neo4jDFG, userId::Symbol, robotId::Symbol, sessionId::Symbol)
134134
!isValidLabel(userId) && error("Can't retrieve session with user ID '$(userId)'.")
135135
!isValidLabel(robotId) && error("Can't retrieve session with robot ID '$(robotId)'.")
136136
!isValidLabel(sessionId) && error("Can't retrieve session with session ID '$(sessionId)'.")
@@ -148,8 +148,7 @@ Returns nothing if it isn't found.
148148
Notes
149149
- Returns either `::Union{Nothing, Session}`
150150
"""
151-
<<<<<<< HEAD:src/CloudGraphsDFG/services/CGStructure.jl
152-
function getSession(dfg::CloudGraphsDFG)
151+
function getSession(dfg::Neo4jDFG)
153152
return getSession(dfg, Symbol(dfg.userId), Symbol(dfg.robotId), Symbol(dfg.sessionId))
154153
end
155154

@@ -161,7 +160,7 @@ Returns nothing if it isn't found.
161160
Notes
162161
- Returns either `::Union{Robot, Nothing}`
163162
"""
164-
function getRobot(dfg::CloudGraphsDFG, userId::Symbol, robotId::Symbol)
163+
function getRobot(dfg::Neo4jDFG, userId::Symbol, robotId::Symbol)
165164
!isValidLabel(userId) && error("Can't retrieve robot with user ID '$(userId)'.")
166165
!isValidLabel(robotId) && error("Can't retrieve robot with robot ID '$(robotId)'.")
167166
robotNode = _getNeoNodesFromCyphonQuery(dfg.neo4jInstance, "(node:ROBOT:`$(robotId)`:`$(userId)`)")
@@ -178,7 +177,7 @@ Returns nothing if it isn't found.
178177
Notes
179178
- Returns either `::Union{Nothing, Robot}`
180179
"""
181-
function getRobot(dfg::CloudGraphsDFG)
180+
function getRobot(dfg::Neo4jDFG)
182181
return getRobot(dfg, Symbol(dfg.userId), Symbol(dfg.robotId))
183182
end
184183

@@ -190,7 +189,7 @@ Returns nothing if it isn't found.
190189
Notes
191190
- Returns either `::Union{User, Nothing}`
192191
"""
193-
function getUser(dfg::CloudGraphsDFG, userId::Symbol)
192+
function getUser(dfg::Neo4jDFG, userId::Symbol)
194193
!isValidLabel(userId) && error("Can't retrieve user with user ID '$(userId)'.")
195194
userNode = _getNeoNodesFromCyphonQuery(dfg.neo4jInstance, "(node:USER:`$(userId)`)")
196195
length(userNode) == 0 && return nothing
@@ -206,7 +205,7 @@ Returns nothing if it isn't found.
206205
Notes
207206
- Returns either `::Union{Nothing, User}`
208207
"""
209-
function getUser(dfg::CloudGraphsDFG)
208+
function getUser(dfg::Neo4jDFG)
210209
return getUser(dfg, Symbol(dfg.userId))
211210
end
212211

@@ -218,7 +217,7 @@ DANGER: Clears the whole session from the database.
218217
Notes
219218
- Returns `::Nothing`
220219
"""
221-
function clearSession!!(dfg::CloudGraphsDFG)
220+
function clearSession!!(dfg::Neo4jDFG)
222221
# Perform detach+deletion
223222
_queryNeo4j(dfg.neo4jInstance, "match (node:`$(dfg.userId)`:`$(dfg.robotId)`:`$(dfg.sessionId)`) detach delete node ")
224223

@@ -234,7 +233,7 @@ DANGER: Clears the whole robot + sessions from the database.
234233
Notes
235234
- Returns `::Nothing`
236235
"""
237-
function clearRobot!!(dfg::CloudGraphsDFG)
236+
function clearRobot!!(dfg::Neo4jDFG)
238237
# Perform detach+deletion
239238
_queryNeo4j(dfg.neo4jInstance, "match (node:`$(dfg.userId)`:`$(dfg.robotId)`) detach delete node ")
240239

@@ -250,7 +249,7 @@ DANGER: Clears the whole user + robot + sessions from the database.
250249
Notes
251250
- Returns `::Nothing`
252251
"""
253-
function clearUser!!(dfg::CloudGraphsDFG)
252+
function clearUser!!(dfg::Neo4jDFG)
254253
# Perform detach+deletion
255254
_queryNeo4j(dfg.neo4jInstance, "match (node:`$(dfg.userId)`) detach delete node ")
256255

@@ -265,9 +264,9 @@ DANGER: Copies and overwrites the destination session.
265264
If no destination specified then it creates a unique one.
266265
267266
Notes
268-
- Returns `::CloudGraphsDFG `
267+
- Returns `::Neo4jDFG `
269268
"""
270-
function copySession!(sourceDFG::CloudGraphsDFG, destDFG::Union{Nothing, <:Neo4jDFG})
269+
function copySession!(sourceDFG::Neo4jDFG, destDFG::Union{Nothing, <:Neo4jDFG})
271270
if destDFG === nothing
272271
destDFG = _getDuplicatedEmptyDFG(sourceDFG)
273272
end
@@ -279,6 +278,6 @@ end
279278
DANGER: Copies the source to a new unique destination.
280279
281280
Notes
282-
- Returns `::CloudGraphsDFG`
281+
- Returns `::Neo4jDFG`
283282
"""
284-
copySession!(sourceDFG::CloudGraphsDFG) = copySession!(sourceDFG, nothing)
283+
copySession!(sourceDFG::Neo4jDFG) = copySession!(sourceDFG, nothing)

0 commit comments

Comments
 (0)