@@ -54,7 +54,7 @@ function _getDuplicatedEmptyDFG(dfg::CloudGraphsDFG)::CloudGraphsDFG
54
54
length (_getLabelsFromCyphonQuery (dfg. neo4jInstance, " (node:$(dfg. userId) :$(dfg. robotId) :$(sessionId) )" )) == 0 && break
55
55
end
56
56
@debug " Unique+empty copy session name: $sessionId "
57
- return CloudGraphsDFG {typeof(dfg.solverParams)} (dfg. neo4jInstance. connection, dfg. userId, dfg. robotId, sessionId, dfg. encodePackedTypeFunc, dfg. getPackedTypeFunc, dfg. decodePackedTypeFunc, solverParams= deepcopy (dfg. solverParams), description= " (Copy of) $(dfg. description) " , useCache= dfg. useCache)
57
+ return CloudGraphsDFG {typeof(dfg.solverParams)} (dfg. neo4jInstance. connection, dfg. userId, dfg. robotId, sessionId, dfg. encodePackedTypeFunc, dfg. getPackedTypeFunc, dfg. decodePackedTypeFunc, dfg . rebuildFactorMetadata!, solverParams= deepcopy (dfg. solverParams), description= " (Copy of) $(dfg. description) " , useCache= dfg. useCache)
58
58
end
59
59
60
60
# Accessors
@@ -158,9 +158,7 @@ Add a DFGVariable to a DFG.
158
158
"""
159
159
function addVariable! (dfg:: CloudGraphsDFG , variable:: DFGVariable ):: Bool
160
160
if exists (dfg, variable)
161
- @warn " Variable '$(variable. label) ' already exists in the graph, so updating it."
162
- updateVariable! (dfg, variable)
163
- return true
161
+ error (" Variable '$(variable. label) ' already exists in the factor graph" )
164
162
end
165
163
props = Dict {String, Any} ()
166
164
props[" label" ] = string (variable. label)
@@ -192,9 +190,7 @@ Add a DFGFactor to a DFG.
192
190
"""
193
191
function addFactor! (dfg:: CloudGraphsDFG , variables:: Vector{DFGVariable} , factor:: DFGFactor ):: Bool
194
192
if exists (dfg, factor)
195
- @warn " Factor '$(factor. label) ' already exist in the graph, so updating it."
196
- updateFactor! (dfg, variables, factor)
197
- return true
193
+ error (" Factor '$(variable. label) ' already exists in the factor graph" )
198
194
end
199
195
200
196
# Update the variable ordering
@@ -363,9 +359,7 @@ Update a complete DFGVariable in the DFG.
363
359
"""
364
360
function updateVariable! (dfg:: CloudGraphsDFG , variable:: DFGVariable ):: DFGVariable
365
361
if ! exists (dfg, variable)
366
- @warn " Variable '$(variable. label) ' doesn't exist in the graph, so adding it."
367
- addVariable! (dfg, variable)
368
- return variable
362
+ error (" Variable label '$(variable. label) ' does not exist in the factor graph" )
369
363
end
370
364
nodeId = _tryGetNeoNodeIdFromNodeLabel (dfg. neo4jInstance, dfg. userId, dfg. robotId, dfg. sessionId, variable. label)
371
365
# Update the node ID
@@ -409,9 +403,7 @@ Update a complete DFGFactor in the DFG.
409
403
"""
410
404
function updateFactor! (dfg:: CloudGraphsDFG , factor:: DFGFactor ):: DFGFactor
411
405
if ! exists (dfg, factor)
412
- @warn " Factor '$(factor. label) ' doesn't exist in the graph, so adding it."
413
- addFactor! (dfg, factor)
414
- return factor
406
+ error (" Factor label '$(factor. label) ' does not exist in the factor graph" )
415
407
end
416
408
nodeId = _tryGetNeoNodeIdFromNodeLabel (dfg. neo4jInstance, dfg. userId, dfg. robotId, dfg. sessionId, factor. label)
417
409
# Update the _internalId
0 commit comments