All Projects → joshday → SQLiteGraph.jl

joshday / SQLiteGraph.jl

Licence: MIT license
A lightweight SQLite-based Graph Database for Julia.

Programming Languages

julia
2034 projects

Projects that are alternatives of or similar to SQLiteGraph.jl

database-journal
Databases: Concepts, commands, codes, interview questions and more...
Stars: ✭ 50 (+138.1%)
Mutual labels:  graph-database
Cayley.Net
.Net Client for an open-source graph database Cayley
Stars: ✭ 14 (-33.33%)
Mutual labels:  graph-database
nebula-graph
A distributed, fast open-source graph database featuring horizontal scalability and high availability. This is an archived repo for v2.5 only, from 2.6.0 +, NebulaGraph switched back to https://github.com/vesoft-inc/nebula
Stars: ✭ 833 (+3866.67%)
Mutual labels:  graph-database
uber-graph-benchmark
A framework to benchmark different graph databases, based on generated data from customizable schema, distribution, and size.
Stars: ✭ 25 (+19.05%)
Mutual labels:  graph-database
grafito
Portable, Serverless & Lightweight SQLite-based Graph Database in Arturo
Stars: ✭ 95 (+352.38%)
Mutual labels:  graph-database
yildiz
🦄🌟 Graph Database layer on top of Google Bigtable
Stars: ✭ 24 (+14.29%)
Mutual labels:  graph-database
NoSQLDataEngineering
NoSQL Data Engineering
Stars: ✭ 25 (+19.05%)
Mutual labels:  graph-database
ml-models
Machine Learning Procedures and Functions for Neo4j
Stars: ✭ 63 (+200%)
Mutual labels:  graph-database
CyFHIR
A Neo4j Plugin for Handling HL7 FHIR Data
Stars: ✭ 39 (+85.71%)
Mutual labels:  graph-database
Public-Transport-SP-Graph-Database
Metropolitan Transport Network from São Paulo mapped in a NoSQL graph database.
Stars: ✭ 25 (+19.05%)
Mutual labels:  graph-database
docs
Source code of the ArangoDB online documentation
Stars: ✭ 18 (-14.29%)
Mutual labels:  graph-database
angular-neo4j
Neo4j Bolt driver wrapper for Angular
Stars: ✭ 18 (-14.29%)
Mutual labels:  graph-database
greycat
GreyCat - Data Analytics, Temporal data, What-if, Live machine learning
Stars: ✭ 104 (+395.24%)
Mutual labels:  graph-database
janusgraph-docker
Yet another JanusGraph, Cassandra/Scylla and Elasticsearch in Docker Compose setup
Stars: ✭ 54 (+157.14%)
Mutual labels:  graph-database
nebula
A distributed, fast open-source graph database featuring horizontal scalability and high availability
Stars: ✭ 8,196 (+38928.57%)
Mutual labels:  graph-database
neo4j-faker
Use faker cypher functions to generate demo and test data with cypher
Stars: ✭ 30 (+42.86%)
Mutual labels:  graph-database
GraphOfDocs
GraphOfDocs: Representing multiple documents as a single graph
Stars: ✭ 13 (-38.1%)
Mutual labels:  graph-database
cqlite
Embedded graph database
Stars: ✭ 74 (+252.38%)
Mutual labels:  graph-database
neo4j.cr
Pure-Crystal implementation of Neo4j's Bolt protocol
Stars: ✭ 29 (+38.1%)
Mutual labels:  graph-database
gstate
A crazy state management for lazy programmers
Stars: ✭ 27 (+28.57%)
Mutual labels:  graph-database

Build status Codecov

SQLiteGraph

A Graph Database for Julia, built on top of SQLite.jl.



Definitions

SQLiteGraph.jl uses the Property Graph Model of the Cypher Query Language (PDF).

  • A Node describes a discrete object in a domain.
  • Nodes can have 0+ labels that classify what kind of node they are.
  • An Edge describes a directional relationship between nodes.
  • An edge must have a type that classifies the relationship.
  • Both edges and nodes can have additional key-value properties that provide further information.



Edges and Nodes

  • Nodes and Edges have a simple representation:
struct Node
    id::Int
    labels::Vector{String}
    props::EasyConfig.Config
end

struct Edge
    source::Int
    target::Int
    type::String
    props::EasyConfig.Config
end
  • With simple constructors:
Node(id, labels...; props...)

Edge(source_id, target_id, type; props...)



Adding Elements to the Graph

using SQLiteGraph

db = DB()

insert!(db, Node(1, "Person", "Actor"; name="Tom Hanks"))

insert!(db, Node(2, "Movie"; title="Forest Gump"))

insert!(db, Edge(1, 2, "Acts In"; awards=["Best Actor in a Leading Role"]))



Editing Elements

insert! will not replace an existing node or edge. Instead, use replace!.

replace!(db, Node(2, "Movie"; title="Forest Gump", genre="Drama"))



Simple Queries

  • Use getindex to access elements.
  • If : is used as an index, an iterator is returned.
  • If s::String is used as an index, an iterator of nodes where s is one of the labels is returned.
db[1]  # Node(1, "Person", "Actor"; name="Tom Hanks")

for node in db[:]
    println(node)
end

only(db["Movie"])  # Node(2, "Movie"; title="Forest Gump", genre="Drama")

# (Pretend the graph is populated with many more items.  The following return iterators.)

db[1, :, "Acts In"]  # All movies that Tom Hanks acts in

db[:, 2, "Acts In"]  # All actors in "Forest Gump"

db[1, 2, :]  # All relationships between "Tom Hanks" and "Forest Gump"

db[:, :, :]  # All edges



Attribution

SQLiteGraph is STRONGLY influenced by https://github.com/dpapathanasiou/simple-graph.



Under the Hood Details

  • Nodes and edges are saved in the nodes and edges tables, respectively.
  • nodes
    • id (INTEGER): unique identifier of a node
    • labels (TEXT): stored as ;-delimited (thus ; cannot be used in a label)
    • props (TEXT): stored as JSON3.write(props)
  • edges
    • source (INTEGER): id of "from" node (nodes(id) is a foreign key)
    • target (INTEGER): id of "to" node (nodes(id) is a foreign key)
    • type (TEXT): the "class" of the edge/relationship
    • props (TEXT)
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].