Open pranavtbhat opened 8 years ago
The use of JDBC or ODBC should make this fairly straightforward.
The current graph definition is:
type Graph
nv::Int
ne::Int
indxs::SparseMatrixCSC{Int,Int}
vdata::AbstractDataFrame
edata::AbstractDataFrame
lmap::LabelMap
end
After adding a layer of abstraction for type of DB in use, this should look like:
abstract GraphDataStore
# Current implementation
immutable TableStore <: GraphDataStore
vdata::AbstractDataFrame
edata::AbstractDataFrame
end
# RDMBS implementation (two tables: Vertex and Edge)
immutable RelationalStore <: GraphDataStore
dbconn:: JConnection
end
# Metadata access should look something like this:
function getvprop(x::RelationalStore, vs::VertexList, prop::Symbol)
# set @VLIST
DataFrames.readtable(executeQuery(createStatement(x.dbconn), "SELECT $prop FROM Vertex WHERE ROWNUM in @VLIST")
end
type Graph
nv::Int
ne::Int
indxs::SparseMatrixCSC{Int,Int}
propgraph::GraphDataStore
lmap::LabelMap
end
There seems to be a wrapper for Neo4j already : https://github.com/glesica/Neo4j.jl. Neo4j.jl
uses HTTP requests to interface with the Neo4j
server. This is quite slow, and returns text data that needs to be parsed.
There is an officially supported python driver that uses a faster BOLT protocol. We can either call this from within Julia or try replicating it. Neo4j
supports a bunch of other languages too, maybe we can add Julia
?
Update : writing a bolt driver for Julia should be straightforward. This tutorial is pretty informative. I will start experimenting with the socket API soon.
fwiw, it looks like the bolt driver info moved to here: https://github.com/neo4j-contrib/boltkit
Just checking if one of you have made progress on the matter of bolt driver for julia withn last year.
This is to scope the work required to integrate
Graft.jl
with relational databases/ graph databases.