Skip to content

Commit 65e530f

Browse files
authored
Merge pull request #41 from JuliaRobotics/feature/cloudgraphdfg
CloudGraphsDFG implementation
2 parents e6acfb2 + 3a2ecea commit 65e530f

21 files changed

+1728
-114
lines changed

.travis.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ language: julia
33
os:
44
- linux
55

6+
services:
7+
- neo4j
8+
69
julia:
710
- 1.0
811
- 1.1

Project.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ Dates = "ade2ca70-3891-5945-98fb-dc099432e06a"
88
Distributions = "31c24e10-a181-5473-b8eb-7969acd0382f"
99
DocStringExtensions = "ffbed154-4ef7-542d-bbb7-c09d3a79fcae"
1010
Graphs = "86223c79-3864-5bf0-83f7-82e725a168b6"
11+
JSON2 = "2535ab7d-5cd8-5a07-80ac-9b1792aadce3"
12+
Neo4j = "d2adbeaf-5838-5367-8a2f-e46d570981db"
1113
Reexport = "189a3867-3050-52da-a836-e630ba90ab69"
1214
Requires = "ae029012-a4dd-5104-9daa-d747884805df"
1315

@@ -21,6 +23,8 @@ julia = "0.7, 1"
2123

2224
[extras]
2325
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
26+
IncrementalInference = "904591bb-b899-562f-9e6f-b8df64c7d480"
27+
RoME = "91fb55c2-4c03-5a59-ba21-f4ea956187b8"
2428

2529
[targets]
2630
test = ["Test"]

src/CloudGraphsDFG/CloudGraphsDFG.jl

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
using Neo4j
2+
using JSON2
3+
4+
# Entities
5+
include("entities/CloudGraphsDFG.jl")
6+
7+
# Services
8+
include("services/CommonFunctions.jl")
9+
include("services/CloudGraphsDFG.jl")
10+
11+
# Exports
12+
export Neo4jInstance, CloudGraphsDFG
13+
export exists
14+
export clearSession!
15+
export getLabelDict, getDescription, setDescription, getInnerGraph, getAddHistory, getSolverParams, setSolverParams
16+
17+
export getAddHistory, getDescription, getLabelDict
18+
export addVariable!, addFactor!
19+
export ls, lsf, getVariables, getFactors, getVariableIds, getFactorIds
20+
export getVariable, getFactor
21+
export updateVariable!, updateFactor!
22+
export deleteVariable!, deleteFactor!
23+
export getAdjacencyMatrix
24+
export getAdjacencyMatrixDataFrame
25+
export getNeighbors
26+
export getSubgraphAroundNode
27+
export getSubgraph
28+
export isFullyConnected, hasOrphans
29+
export toDot, toDotFile
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
import Base.show
2+
3+
mutable struct Neo4jInstance
4+
connection::Neo4j.Connection
5+
graph::Neo4j.Graph
6+
end
7+
8+
mutable struct CloudGraphsDFG{T <: AbstractParams} <: AbstractDFG
9+
neo4jInstance::Neo4jInstance
10+
description::String
11+
userId::String
12+
robotId::String
13+
sessionId::String
14+
encodePackedTypeFunc
15+
getPackedTypeFunc
16+
decodePackedTypeFunc
17+
labelDict::Dict{Symbol, Int64}
18+
variableCache::Dict{Symbol, DFGVariable}
19+
factorCache::Dict{Symbol, DFGFactor}
20+
addHistory::Vector{Symbol} #TODO: Discuss more - is this an audit trail?
21+
solverParams::T # Solver parameters
22+
useCache::Bool
23+
end
24+
25+
function show(io::IO, c::CloudGraphsDFG)
26+
println("CloudGraphsDFG:")
27+
println(" - Neo4J instance: $(c.neo4jInstance.connection.host)")
28+
println(" - Session: $(c.userId):$(c.robotId):$(c.sessionId)")
29+
println(" - Caching: $(c.useCache)")
30+
end

0 commit comments

Comments
 (0)