@@ -155,7 +155,7 @@ isFactor(dfg::CloudGraphsDFG, sym::Symbol)::Bool =
155
155
function getSofttype (dfg:: CloudGraphsDFG , lbl:: Symbol ; currentTransaction:: Union{Nothing, Neo4j.Transaction} = nothing )
156
156
st = _getNodeProperty (dfg. neo4jInstance, union (_getLabelsForType (dfg, DFGVariable), [String (lbl)]), " softtype" , currentTransaction= currentTransaction)
157
157
@debug " Trying to find softtype: $st "
158
- softType = getTypeFromSerializationModule (dfg, Symbol (st) )
158
+ softType = getTypeFromSerializationModule (st )
159
159
return softType ()
160
160
end
161
161
@@ -177,8 +177,12 @@ function updateVariable!(dfg::CloudGraphsDFG, variable::DFGVariable; skipAddErro
177
177
# Create/update the base variable
178
178
# NOTE: We are not merging the variable.tags into the labels anymore. We can index by that but not
179
179
# going to pollute the graph with unnecessary (and potentially dangerous) labels.
180
+ <<<<<< < HEAD
180
181
addProps = Dict (
181
182
" softtype" => " \" $(string (typeof (getSofttype (variable)))) \" " )
183
+ ====== =
184
+ addProps = Dict (" softtype" => " \" $(DistributedFactorGraphs. typeModuleName (getSofttype (variable))) \" " )
185
+ >>>>>> > ff56034195104ff1cd5cdee9b10f7d271eb1d5f8
182
186
query = """
183
187
MATCH (session:$(join (_getLabelsForType (dfg, Session), " :" )) )
184
188
MERGE (node:$(join (_getLabelsForInst (dfg, variable), " :" )) )
@@ -237,12 +241,12 @@ function getVariable(dfg::CloudGraphsDFG, label::Union{Symbol, String})
237
241
for ppe in listPPEs (dfg, label)
238
242
variable. ppeDict[ppe] = getPPE (dfg, label, ppe)
239
243
end
240
- for solverKey in listVariableSolverData (dfg, label)
241
- variable. solverDataDict[solverKey ] = getVariableSolverData (dfg, label, solverKey )
244
+ for solveKey in listVariableSolverData (dfg, label)
245
+ variable. solverDataDict[solveKey ] = getVariableSolverData (dfg, label, solveKey )
242
246
end
243
- dataDict = getDataEntries (dfg, label)
244
- for (k,v) in dataDict
245
- variable. dataDict[k ] = v
247
+ dataSet = getDataEntries (dfg, label)
248
+ for v in dataSet
249
+ variable. dataDict[v . label ] = v
246
250
end
247
251
248
252
return variable
@@ -259,7 +263,7 @@ function mergeVariableData!(dfg::CloudGraphsDFG, sourceVariable::DFGVariable; cu
259
263
updateVariableSolverData! (dfg, getLabel (sourceVariable), v, currentTransaction= currentTransaction)
260
264
end
261
265
for (k,v) in sourceVariable. dataDict
262
- updateDatEntry ! (dfg, getLabel (sourceVariable), v, currentTransaction= currentTransaction)
266
+ updateDataEntry ! (dfg, getLabel (sourceVariable), v, currentTransaction= currentTransaction)
263
267
end
264
268
return sourceVariable
265
269
end
@@ -545,7 +549,7 @@ function _unpackPPE(dfg::G, packedPPE::Dict{String, Any})::AbstractPointParametr
545
549
end
546
550
547
551
function listPPEs (dfg:: CloudGraphsDFG , variablekey:: Symbol ; currentTransaction:: Union{Nothing, Neo4j.Transaction} = nothing ):: Vector{Symbol}
548
- return _listVarSubnodesForType (dfg, variablekey, MeanMaxPPE, " solverKey " ; currentTransaction= currentTransaction)
552
+ return _listVarSubnodesForType (dfg, variablekey, MeanMaxPPE, " solveKey " ; currentTransaction= currentTransaction)
549
553
end
550
554
551
555
function getPPE (dfg:: CloudGraphsDFG , variablekey:: Symbol , ppekey:: Symbol = :default ; currentTransaction:: Union{Nothing, Neo4j.Transaction} = nothing ):: AbstractPointParametricEst
@@ -580,8 +584,8 @@ function addPPE!(dfg::CloudGraphsDFG,
580
584
ppe:: P ;
581
585
currentTransaction:: Union{Nothing, Neo4j.Transaction} = nothing ):: AbstractPointParametricEst where
582
586
{P <: AbstractPointParametricEst }
583
- if ppe. solverKey in listPPEs (dfg, variablekey, currentTransaction= currentTransaction)
584
- error (" PPE '$(ppe. solverKey ) ' already exists" )
587
+ if ppe. solveKey in listPPEs (dfg, variablekey, currentTransaction= currentTransaction)
588
+ error (" PPE '$(ppe. solveKey ) ' already exists" )
585
589
end
586
590
softType = getSofttype (dfg, variablekey)
587
591
# Add additional properties for the PPE
@@ -602,8 +606,8 @@ function updatePPE!(
602
606
ppe:: P ;
603
607
currentTransaction:: Union{Nothing, Neo4j.Transaction} = nothing ):: P where
604
608
{P <: AbstractPointParametricEst }
605
- if ! (ppe. solverKey in listPPEs (dfg, variablekey, currentTransaction= currentTransaction))
606
- @warn " PPE '$(ppe. solverKey ) ' does not exist, adding"
609
+ if ! (ppe. solveKey in listPPEs (dfg, variablekey, currentTransaction= currentTransaction))
610
+ @warn " PPE '$(ppe. solveKey ) ' does not exist, adding"
607
611
end
608
612
softType = getSofttype (dfg, variablekey, currentTransaction= currentTransaction)
609
613
# Add additional properties for the PPE
645
649
function getDataEntries (dfg:: CloudGraphsDFG , label:: Symbol ; currentTransaction:: Union{Nothing, Neo4j.Transaction} = nothing )
646
650
entries = Dict {Symbol, BlobStoreEntry} ()
647
651
# TODO : Optimize if necessary.
648
- for key in listDataEntries (dfg, label, currentTransaction= currentTransaction)
649
- entry = getDataEntry (dfg, label, key, currentTransaction= currentTransaction)
650
- entries[entry. label] = entry
651
- end
652
- return entries
652
+ delist = listDataEntries (dfg, label, currentTransaction= currentTransaction)
653
+ return getDataEntry .(dfg, label, delist; currentTransaction= currentTransaction)
654
+
653
655
end
654
656
655
657
function listDataEntries (dfg:: CloudGraphsDFG , label:: Symbol ; currentTransaction:: Union{Nothing, Neo4j.Transaction} = nothing )
@@ -667,6 +669,10 @@ function getDataEntry(dfg::CloudGraphsDFG, label::Symbol, key::Symbol; currentTr
667
669
BlobStoreEntry,
668
670
key;
669
671
currentTransaction= currentTransaction)
672
+
673
+ # FIXME
674
+ properties[" createdTimestamp" ] = DistributedFactorGraphs. getStandardZDTString (properties[" createdTimestamp" ])
675
+
670
676
return Unmarshal. unmarshal (
671
677
BlobStoreEntry,
672
678
properties)
@@ -683,6 +689,10 @@ function addDataEntry!(dfg::CloudGraphsDFG, label::Symbol, bde::BlobStoreEntry;
683
689
bde,
684
690
:DATA ,
685
691
currentTransaction= currentTransaction)
692
+
693
+ # FIXME
694
+ packed[" createdTimestamp" ] = DistributedFactorGraphs. getStandardZDTString (packed[" createdTimestamp" ])
695
+
686
696
return Unmarshal. unmarshal (
687
697
BlobStoreEntry,
688
698
packed)
@@ -699,6 +709,10 @@ function updateDataEntry!(dfg::CloudGraphsDFG, label::Symbol, bde::BlobStoreEnt
699
709
bde,
700
710
:DATA ,
701
711
currentTransaction= currentTransaction)
712
+
713
+ # FIXME
714
+ packed[" createdTimestamp" ] = DistributedFactorGraphs. getStandardZDTString (packed[" createdTimestamp" ])
715
+
702
716
return Unmarshal. unmarshal (
703
717
BlobStoreEntry,
704
718
packed)
@@ -712,6 +726,10 @@ function deleteDataEntry!(dfg::CloudGraphsDFG, label::Symbol, key::Symbol; curre
712
726
_getLabelsForType (dfg, BlobStoreEntry, parentKey= label),
713
727
key,
714
728
currentTransaction= currentTransaction)
729
+
730
+ # FIXME
731
+ props[" createdTimestamp" ] = DistributedFactorGraphs. getStandardZDTString (props[" createdTimestamp" ])
732
+
715
733
return Unmarshal. unmarshal (
716
734
BlobStoreEntry,
717
735
props)
@@ -729,20 +747,20 @@ function _unpackVariableNodeData(dfg::G, packedDict::Dict{String, Any})::Variabl
729
747
end
730
748
731
749
function listVariableSolverData (dfg:: CloudGraphsDFG , variablekey:: Symbol ; currentTransaction:: Union{Nothing, Neo4j.Transaction} = nothing ):: Vector{Symbol}
732
- return _listVarSubnodesForType (dfg, variablekey, VariableNodeData, " solverKey " ; currentTransaction= currentTransaction)
750
+ return _listVarSubnodesForType (dfg, variablekey, VariableNodeData, " solveKey " ; currentTransaction= currentTransaction)
733
751
end
734
752
735
- function getVariableSolverData (dfg:: CloudGraphsDFG , variablekey:: Symbol , solverKey :: Symbol = :default ; currentTransaction:: Union{Nothing, Neo4j.Transaction} = nothing ):: VariableNodeData
736
- properties = _getVarSubnodeProperties (dfg, variablekey, VariableNodeData, solverKey ; currentTransaction= currentTransaction)
753
+ function getVariableSolverData (dfg:: CloudGraphsDFG , variablekey:: Symbol , solveKey :: Symbol = :default ; currentTransaction:: Union{Nothing, Neo4j.Transaction} = nothing ):: VariableNodeData
754
+ properties = _getVarSubnodeProperties (dfg, variablekey, VariableNodeData, solveKey ; currentTransaction= currentTransaction)
737
755
return _unpackVariableNodeData (dfg, properties)
738
756
end
739
757
740
758
function addVariableSolverData! (dfg:: CloudGraphsDFG ,
741
759
variablekey:: Symbol ,
742
760
vnd:: VariableNodeData ;
743
761
currentTransaction:: Union{Nothing, Neo4j.Transaction} = nothing ):: VariableNodeData
744
- if vnd. solverKey in listVariableSolverData (dfg, variablekey, currentTransaction= currentTransaction)
745
- error (" Solver data '$(vnd. solverKey ) ' already exists" )
762
+ if vnd. solveKey in listVariableSolverData (dfg, variablekey, currentTransaction= currentTransaction)
763
+ error (" Solver data '$(vnd. solveKey ) ' already exists" )
746
764
end
747
765
retPacked = _matchmergeVariableSubnode! (
748
766
dfg,
@@ -760,8 +778,8 @@ function updateVariableSolverData!(dfg::CloudGraphsDFG,
760
778
useCopy:: Bool = true ,
761
779
fields:: Vector{Symbol} = Symbol[];
762
780
currentTransaction:: Union{Nothing, Neo4j.Transaction} = nothing ):: VariableNodeData
763
- if ! (vnd. solverKey in listVariableSolverData (dfg, variablekey, currentTransaction= currentTransaction))
764
- @warn " Solver data '$(vnd. solverKey ) ' does not exist, adding rather than updating."
781
+ if ! (vnd. solveKey in listVariableSolverData (dfg, variablekey, currentTransaction= currentTransaction))
782
+ @warn " Solver data '$(vnd. solveKey ) ' does not exist, adding rather than updating."
765
783
end
766
784
# TODO : Update this to use the selective parameters from fields.
767
785
retPacked = _matchmergeVariableSubnode! (
@@ -774,13 +792,13 @@ function updateVariableSolverData!(dfg::CloudGraphsDFG,
774
792
return _unpackVariableNodeData (dfg, retPacked)
775
793
end
776
794
777
- function deleteVariableSolverData! (dfg:: CloudGraphsDFG , variablekey:: Symbol , solverKey :: Symbol = :default ; currentTransaction:: Union{Nothing, Neo4j.Transaction} = nothing ):: VariableNodeData
795
+ function deleteVariableSolverData! (dfg:: CloudGraphsDFG , variablekey:: Symbol , solveKey :: Symbol = :default ; currentTransaction:: Union{Nothing, Neo4j.Transaction} = nothing ):: VariableNodeData
778
796
retPacked = _deleteVarSubnode! (
779
797
dfg,
780
798
variablekey,
781
799
:SOLVERDATA ,
782
800
_getLabelsForType (dfg, VariableNodeData, parentKey= variablekey),
783
- solverKey ,
801
+ solveKey ,
784
802
currentTransaction= currentTransaction)
785
803
return _unpackVariableNodeData (dfg, retPacked)
786
804
end
@@ -841,12 +859,12 @@ function updateVariableSolverData!(dfg::CloudGraphsDFG,
841
859
end
842
860
843
861
function mergeVariableSolverData! (dfg:: CloudGraphsDFG , sourceVariable:: DFGVariable )
844
- for solverKey in listVariableSolverData (dfg, sourceVariable. label)
862
+ for solveKey in listVariableSolverData (dfg, sourceVariable. label)
845
863
updateVariableSolverData! (
846
864
dfg,
847
865
sourceVariable. label,
848
- getVariableSolverData (dfg, sourceVariable, solverKey ),
849
- solverKey )
866
+ getVariableSolverData (dfg, sourceVariable, solveKey ),
867
+ solveKey )
850
868
end
851
869
end
852
870
0 commit comments