• Stars
    star
    197
  • Rank 197,722 (Top 4 %)
  • Language
    Go
  • License
    MIT License
  • Created over 5 years ago
  • Updated about 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Fabric is a simple triplestore written in Golang

Fabric

GoDoc Go Report Card

Fabric is a triple-store written in Go. Fabric provides simple functions and store options to deal with "Subject->Predicate->Object" relations or so called triples.

Usage

Get fabric by using go get -u github.com/spy16/fabric (Fabric as a library has no external dependencies)

// See next snippet for using persistent SQL backend
fab := fabric.New(&fabric.InMemoryStore{})

fab.Insert(context.Background(), fabric.Triple{
    Source: "Bob",
    Predicate: "Knows",
    Target: "John",
})

fab.Query(context.Background(), fabric.Query{
    Source: fabric.Clause{
        Type: "equal",
        Value: "Bob",
    },
})

To use a SQL database for storing the triples, use the following snippet:

db, err := sql.Open("sqlite3", "fabric.db")
if err != nil {
    panic(err)
}

store := &fabric.SQLStore{DB: db}
store.Setup(context.Background()) // to create required tables

fab := fabric.New(store)

Fabric SQLStore uses Go's standard database/sql package. So any SQL database supported through this interface (includes most major SQL databases) should work.

Additional store support can be added by implementing the Store interface.

type Store interface {
    Insert(ctx context.Context, tri Triple) error
    Query(ctx context.Context, q Query) ([]Triple, error)
    Delete(ctx context.Context, q Query) (int, error)
}

Optional Counter and ReWeighter can be implemented by the store implementations to support extended query options.

REST API

The server package exposes REST APIs (/triples endpoint) which can be used to query, insert/delete or reweight triples using any HTTP client.

More Repositories

1

pyschemes

PySchemes is a library for validating data structures in python
Python
365
star
2

droplets

Droplets is a platform for Gophers.
Go
321
star
3

radium

radium is a platform (client and optional server) for viewing reference articles, cheat sheets, snippets etc.
Go
61
star
4

skit

Build slack bots quickly and easily!
Go
45
star
5

delayq

DelayQ is a Go library that provides a performant, reliable, distributed delay-queue using Redis.
Go
39
star
6

slurp

Slurp is a highly customisable LISP toolkit for Go applications. 💻
Go
34
star
7

parens

Parens is a highly flexible and embeddable LISP toolkit. 💻
Go
33
star
8

radio

Radio is a library for creating RESP (REdis Serialization Protocol) comaptible services. 📻
Go
31
star
9

sabre

Sabre is highly customisable, embeddable LISP engine for Go. 💻
Go
28
star
10

sukit

Supabase + SvelteKit SaaS template.
Svelte
25
star
11

fusion

💥 Fusion is a tiny stream processing library written in Go.
Go
17
star
12

kiwi

Kiwi is a multi-backend key-value store written in Go.
Go
13
star
13

taurishell

A Raycast/Spotlight like app shell using https://tauri.studio/
Rust
12
star
14

slang

Slang (short for Sabre Lang) is a tiny LISP dialect built using Sabre
Go
7
star
15

avabot

A ChatGPT personal assistant bot on Telegram
TypeScript
6
star
16

forge

Where the apps are forged! 🔥
Go
6
star
17

moonshot

🌔 A boilerplate Go library for quickly setting up backend for your next moonshot idea!
Go
4
star
18

pkg

Random, re-usable, probably useful packages.
Go
3
star
19

envision

Envision is a dynamic system simulator similar to Simulink.
C#
3
star
20

goworm

🐛 GoWorm is a simulation tool for simple point neuron based spiking neural network models.
Go
2
star
21

connote

📝 connote is a dead-simple console-based note taking tool.
Go
2
star
22

cats-and-dogs

cats-and-dogs is a Convolutional Neural Network for classifying cats and dog pictures.
Python
1
star
23

enforcer

Enforcer is a dynamic rule based workflow/journey system
Go
1
star
24

myvim

My (neo)Vim configurations
Vim Script
1
star
25

liftoff

🚀 A sample React application for quickly getting started.
TypeScript
1
star
26

snowman

⛄️ Snowman is a Go library & tool for building chatbots.
Go
1
star
27

ticktock

Go
1
star
28

churn-prediction

Customer churn prediction using Deep Neural Network.
Python
1
star