SliccDB 0.1.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package SliccDB --version 0.1.0                
NuGet\Install-Package SliccDB -Version 0.1.0                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="SliccDB" Version="0.1.0" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add SliccDB --version 0.1.0                
#r "nuget: SliccDB, 0.1.0"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install SliccDB as a Cake Addin
#addin nuget:?package=SliccDB&version=0.1.0

// Install SliccDB as a Cake Tool
#tool nuget:?package=SliccDB&version=0.1.0                

SliccDB

C# .Net Visual Studio Version

Light Embedded Graph Database for .net

<img src="/SliccDB/SLICC_128.png" width="128" height="128" align="right">

Important News

Since I am now working on my thesis I don't have time neccessary to work on SliccDB. I am looking for contributors. Please reach out by email ja.to.mixer@gmail.com Thanks! I've made SliccDB (actually a companion app, but still) my thesis Project topic! Now I can focus on development of this library to full capacity. Expect new stuff!

Nuget Package

You can download nuget package from here or by using this command

NuGet\Install-Package SliccDB
What is it?

Think of it like SQLite for graph databases. There were some efforts to build something like this (such as Graph Engine) but Microsoft decided to abandon all of their graph database related projects. Be aware that I have no intention to make this some sort of Neo4J .net Clone. It will be not fully compliant with features of mentioned database. I intend on integrating Cypher, because it is an ISO standard GQL (Graph Query Language). More info and resources about cypher can be found on their site (http://opencypher.org/)

Update regarding Cypher

I've decided to focus on extending and optimizing C# ↔ database interaction. Cypher implementation is under consideration.

Examples

Here are some simple examples:

Create Node Programatically
DatabaseConnection connection = new DatabaseConnection("filename");
var properties = new Dictionary<string, string>();
var labels = new HashSet<string>();
properties.Add("Name", "Alice");
labels.Add("Person");

var nodeOne = connection.CreateNode(properties, labels);
properties.Clear();
labels.Clear();
properties.Add("Name", "Steve");
labels.Add("Person");

var nodeTwo = connection.CreateNode(properties, labels);
Create Relations between two nodes

Note that relations also have ability to hold data like Properties and Labels

var properties = new Dictionary<string, string>();
var labels = new HashSet<string>();
properties.Add("How Much", "Very Much");
labels.Add("Label on a node!");
connection.CreateRelation(
"Likes", 
sn => sn.First(x => x.Hash == nodeOne.Hash), tn => tn.First(a => a.Hash == nodeTwo.Hash), properties, labels);
Queries

You can query nodes and relations as you would any collection (With Linq).

Query Nodes
var selectedNode = Connection.Nodes().Properties("Name".Value("Tom")).Labels("Person").FirstOrDefault();
Query Relations
var queriedRelation = Connection.Relations().Properties("Property".Value("PropertyValue"))
                .Labels("RelationLabel");
Update Node/Relation
 var relation = Connection.Relations("Likes").ToList().First();
            relation.Properties["How Much"] = "Not So Much";
            relation.Labels.Add("Love Hate Relationship");

Connection.Update(relation);
            
...

 var node = Connection.Nodes().Properties("Name".Value("Steve")).First();
            node.Properties["Name"] = "Steve2";

Connection.Update(node);
Delete Node/Relation
var toDelete = Connection.CreateNode(
                new Dictionary<string, string>() { { "Name", "Tom" } },
                new HashSet<string>() { "Person" }
            );

var queryToDelete = Connection.Nodes().Properties("Name".Value("Tom")).Labels("Person").FirstOrDefault();

Connection.Delete(queryToDelete);
 var testNode1 = Connection.CreateNode(
                new Dictionary<string, string>() { { "Name", "C" } },
                new HashSet<string>() { "S" }
            );

            var testNode2 = Connection.CreateNode(
                new Dictionary<string, string>() { { "Name", "A" } },
                new HashSet<string>() { "S" }
            );            

var properties = new Dictionary<string, string>();
var labels = new HashSet<string>();
properties.Add("Test", "Test");
labels.Add("Test on a node!");
Connection.CreateRelation("Test", sn => sn.First(x => x.Hash == testNode1.Hash), tn => tn.First(a => a.Hash == testNode2.Hash), properties, labels);

var queriedRelation = Connection.Relations("Test").FirstOrDefault();

Connection.Delete(queriedRelation);
Why it exists?

I just need embedded Graph Database Solution that supports Cypher Language. Graph DBMS is a perfect solution for some gamedev ai-related stuff (Procedural Behaviour Design, Perception and context awareness storage), but every solution needs a server. Imagine that in order to play your game you must install Neo4J's server in the first place, or every time your npc makes a decision it queries Azure Cloud to check how much he likes pizza. It's unreliable and forces you to host a game server for the entirety of a game's lifetime even though your game is singleplayer. Sounds stupid? Well, ask EA about Simcity 2013 - they thought it's a great idea! But really, Graph DBMS has other use cases. Watch this video to know more about Graph DBMS

DB Explorer

DB Explorer is now considered obsolete, but you can still get the source code here DB Explorer Screenshot
DB Explorer is a companion app currently used for interaction with database. It allows for CRUD operations on the database to test its' functionalities. The app is still in development.

Progress

Below you'll find a list of features that will be included in the 1st milestone release of SliccDB:

  • Basic Structures (Relations, Nodes)
  • Serialization (Reading and Writing)
  • Queries
  • Basic Debugger App (Ability to add, remove, edit nodes and relations)
  • ORM (Object Relational Mapper) for Nodes

Can I help?

Of course! Any help with the SliccDB will be appreciated.

Special Thanks!
Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
0.1.1.4 461 2/2/2023
0.1.1 1,480 2/1/2023
0.1.0 353 11/1/2022
0.0.1 351 10/31/2022