goneo

package module
v0.0.0-...-af33e7b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 28, 2023 License: BSD-3-Clause, MIT Imports: 10 Imported by: 0

README

goneo

Author: Jonathan Buch jonathan.buch@gmail.com

This software contains:

  • a simple in-memory node/edge database for a directed graph
  • a query mechanism on the db for single nodes and a simple depth first path
  • a simple cypher-like language
  • an http server for access
Hacking

Build Status

This project uses go modules to handle dependencies.

Testing:

go test ./...

Building:

go build github.com/BuJo/goneo/cmd/goneo

Running the program with a few generated nodes in the in-memory-db:

./goneo -size universe

Running cypher to search for some labelled nodes:

curl -F 'gocy=match (t:Tag) RETURN t.tag AS tag' localhost:7474/table

The web interface can also render out the db as graphviz format via /graphviz (which also understands form field gocy with a search query).

Release
govendor sync
VERSION=v1.0
go install -ldflags "-X main.buildversion=$VERSION"
Literature
  • OPTIMIZED BACKTRACKING FOR SUBGRAPH ISOMORPHISM Lixin Fu and Shruthi Chandra
  • A (Sub)Graph Isomorphism Algorithm for Matching Large Graphs Luigi P. Cordella, Pasquale Foggia, Carlo Sansone, and Mario Vento
  • Labeled Subgraph Matching Using Degree Filtering Lixin Fu and Surya Prakash R Kommireddy
  • An Improved Algorithm for Matching Large Graphs L. P. Cordella, P. Foggia, C. Sansone, M. Vento
  • Read, R. C. and Corneil, D. G. (1977). The graph isomorphism disease. Journal of Graph Theory 1, 339–363.
  • Gati, G. (1979). Further annotated bibliography on the isomorphism disease. Journal of Graph Theory 3, 95–109.
  • An Algorithm for Subgraph Isomorphism J. R. ULLMANN

Documentation

Overview

Package goneo implements a most basic graph database for Go.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DumpDot

func DumpDot(db DatabaseService) string

DumpDot formats the given DB in Graphviz format.

func OpenDb

func OpenDb(dbUri string) (DatabaseService, error)

OpenDb opens a database by URI. Example:

OpenDb("mem:testdb")

Types

type TabularData

type TabularData struct {
	// contains filtered or unexported fields
}

TabularData describes information in a tabular format.

func Evaluate

func Evaluate(db DatabaseService, qry string) (*TabularData, error)

Evaluate a gcy query

Example:

start n=node(*) return n

func (*TabularData) Columns

func (t *TabularData) Columns() []string

Columns returns column names

func (*TabularData) Get

func (t *TabularData) Get(row int, column string) interface{}

Get returns a single field

func (*TabularData) Len

func (t *TabularData) Len() int

Len returns the count of lines

func (*TabularData) Merge

func (t *TabularData) Merge(t2 *TabularData) *TabularData

Merge two tables.

func (*TabularData) String

func (t *TabularData) String() string

Notes

Bugs

  • db cannot encode undirected graph

  • cannot encode more than one possible relation type

  • TabularData does not handle tables of different sizes.

Directories

Path Synopsis
cmd
goneo
Commandline test application serving an in memory DB via http.
Commandline test application serving an in memory DB via http.
Package data containing test data
Package data containing test data
db
Package db is the basic contract package for a database handled by goneo.
Package db is the basic contract package for a database handled by goneo.
mem
Package mem is a simple memory based implementation of DatabaseService.
Package mem is a simple memory based implementation of DatabaseService.
simplefile
Package simplefile for a simple file backed DatabaseService.
Package simplefile for a simple file backed DatabaseService.
Package gcy contains a lexer and parser for a graph language.
Package gcy contains a lexer and parser for a graph language.
Package log initializes our logger
Package log initializes our logger
Package sgi implementing graph isomorphism algorithms and helpers.
Package sgi implementing graph isomorphism algorithms and helpers.
Package web interface for goneo.
Package web interface for goneo.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL