@@ -520,10 +520,11 @@ function addPPE!(dfg::CloudGraphsDFG, variablekey::Symbol, ppe::P, ppekey::Symbo
520
520
if ppekey in listPPEs (dfg, variablekey, currentTransaction= currentTransaction)
521
521
error (" PPE '$(ppekey) ' already exists" )
522
522
end
523
- return updatePPE ! (dfg, variablekey, ppe, ppekey, currentTransaction= currentTransaction)
523
+ return _matchmergePPE ! (dfg, variablekey, ppe, ppekey, currentTransaction= currentTransaction)
524
524
end
525
525
526
- function updatePPE! (dfg:: CloudGraphsDFG , variablekey:: Symbol , ppe:: P , ppekey:: Symbol = :default ; currentTransaction:: Union{Nothing, Neo4j.Transaction} = nothing ):: P where P <: AbstractPointParametricEst
526
+ # TODO clean this, just to match api for update
527
+ function _matchmergePPE! (dfg:: CloudGraphsDFG , variablekey:: Symbol , ppe:: P , ppekey:: Symbol = :default ; currentTransaction:: Union{Nothing, Neo4j.Transaction} = nothing ):: P where P <: AbstractPointParametricEst
527
528
packed = packPPE (dfg, ppe)
528
529
query = """
529
530
MATCH (var:$variablekey :$(join (_getLabelsForType (dfg, DFGVariable, parentKey= variablekey),' :' )) )
@@ -546,10 +547,17 @@ function updatePPE!(dfg::CloudGraphsDFG, variablekey::Symbol, ppe::P, ppekey::Sy
546
547
return unpackPPE (dfg, result. results[1 ][" data" ][1 ][" row" ][1 ])
547
548
end
548
549
550
+ function updatePPE! (dfg:: CloudGraphsDFG , variablekey:: Symbol , ppe:: P , ppekey:: Symbol = :default ; currentTransaction:: Union{Nothing, Neo4j.Transaction} = nothing ):: P where P <: AbstractPointParametricEst
551
+ if ! (ppekey in listPPEs (dfg, variablekey, currentTransaction= currentTransaction))
552
+ @warn " PPE '$(ppekey) ' does not exist, adding"
553
+ end
554
+ return _matchmergePPE! (dfg, variablekey, ppe, ppekey, currentTransaction= currentTransaction)
555
+ end
556
+
549
557
function updatePPE! (dfg:: CloudGraphsDFG , sourceVariables:: Vector{<:DFGVariable} , ppekey:: Symbol = :default ; currentTransaction:: Union{Nothing, Neo4j.Transaction} = nothing )
550
558
tx = currentTransaction == nothing ? transaction (dfg. neo4jInstance. connection) : currentTransaction
551
559
for var in sourceVariables
552
- updatePPE! (dfg, var. label, getPPE (dfg, var, ppekey), ppekey, currentTransaction= tx)
560
+ updatePPE! (dfg, var. label, getPPE (var, ppekey), ppekey, currentTransaction= tx)
553
561
end
554
562
if currentTransaction == nothing
555
563
result = commit (tx)
0 commit comments