Skip to content

Commit 8ef829d

Browse files
committed
Updated the way we write in the data version
1 parent 351bcd3 commit 8ef829d

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

src/CloudGraphsDFG/services/CGStructure.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ function _convertNodeToDict(abstractNode::N)::Dict{String, Any} where N <: Abstr
1010
data = length(cp.data) != 0 ? JSON2.write(cp.data) : "{}"
1111
ser = JSON2.read(JSON2.write(abstractNode), Dict{String, Any})
1212
ser["data"] = base64encode(data)
13+
ser["_version"] = _getDFGVersion()
1314
return ser
1415
end
1516

src/CloudGraphsDFG/services/CloudGraphsDFG.jl

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -178,8 +178,7 @@ function updateVariable!(dfg::CloudGraphsDFG, variable::DFGVariable; skipAddErro
178178
# NOTE: We are not merging the variable.tags into the labels anymore. We can index by that but not
179179
# going to pollute the graph with unnecessary (and potentially dangerous) labels.
180180
addProps = Dict(
181-
"softtype" => "\"$(string(typeof(getSofttype(variable))))\"",
182-
"_version" => "\"$(_getDFGVersion())\"")
181+
"softtype" => "\"$(string(typeof(getSofttype(variable))))\"")
183182
query = """
184183
MATCH (session:$(join(_getLabelsForType(dfg, Session), ":")))
185184
MERGE (node:$(join(_getLabelsForInst(dfg, variable), ":")))
@@ -299,8 +298,7 @@ function updateFactor!(dfg::CloudGraphsDFG, factor::DFGFactor; skipAddError::Boo
299298
# going to pollute the graph with unnecessary (and potentially dangerous) labels.
300299
fnctype = getSolverData(factor).fnc.usrfnc!
301300
addProps = Dict(
302-
"fnctype" => "\"$(String(_getname(fnctype)))\"",
303-
"_version" => "\"$(_getDFGVersion())\"")
301+
"fnctype" => "\"$(String(_getname(fnctype)))\"")
304302
query = """
305303
MATCH (session:$(join(_getLabelsForType(dfg, Session), ":")))
306304
MERGE (node:$(join(_getLabelsForInst(dfg, factor), ":")))

src/CloudGraphsDFG/services/CommonFunctions.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,8 @@ function _structToNeo4jProps(inst::Union{User, Robot, Session, PVND, N, APPE, AB
198198
for (k, v) in addProps
199199
write(io, "$cypherNodeName.$k= $v,")
200200
end
201-
# The node type
201+
# Write in the version and node type
202+
write(io, "$cypherNodeName._version=\"$(_getDFGVersion())\",")
202203
write(io, "$cypherNodeName._type=\"$(typeof(inst))\"")
203204
# Ref String(): "When possible, the memory of v will be used without copying when the String object is created.
204205
# This is guaranteed to be the case for byte vectors returned by take!" # Apparent replacement for takebuf_string()

0 commit comments

Comments
 (0)