datacat 0.0.1
Lightweight Datalog engine intended to be embedded in other D programs
To use this package, run the following command in your project's root directory:
Manual usage
Put the following dependency into your project's dependences section:
datacat 
datacat is a lightweight Datalog engine intended to be embedded in other D programs.
Getting Started
datacat depends on the following software packages:
- D compiler (dmd 2.079+, ldc 1.8.0+)
Download the D compiler of your choice, extract it and add to your PATH shell variable.
# example with an extracted DMD
export PATH=/path/to/dmd/linux/bin64/:$PATH
Once the dependencies are installed it is time to download the source code to install datacat.
git clone https://github.com/joakim-brannstrom/datacat.git
cd datacat
dub build -b release
Done! Have fun. Don't be shy to report any issue that you find.
Example
Datacat has no runtime, and relies on you to build and repeatedly apply the update rules.
It tries to help you do this correctly. As an example, here is how you might write a reachability
query using Datacat (minus the part where we populate the nodes
and edges
initial relations).
auto fun() {
import datacat;
// Create a new iteration context, ...
Iteration!(uint, uint) iteration;
// .. some variables, ..
auto nodes = iteration.variable("nodes");
auto edges = iteration.variable("edges");
// .. load them with some initial values, ..
nodes.insert(relation!(uint, uint).from(....));
edges.insert(relation!(uint, uint).from(....));
// .. and then start iterating rules!
while iteration.changed() {
static auto joiner(T0, T1, T2)(T0 b, T1 a, T2 c) {
return kvTuple(c, a);
}
// nodes(a,c) <- nodes(a,b), edges(b,c)
nodes.fromJoin!joiner(nodes, edges);
}
// extract the final results.
return nodes.complete;
}
Credit
All credit goes to Frank McSherry fmcsherry@me.com for the excellent blog post and implementation (this port). I highly recommend to read Frank's blog.
- Registered by Joakim Brännström
- 0.0.1 released 5 years ago
- joakim-brannstrom/datacat
- Apache-2.0
- Copyright © 2018, Joakim Brännström
- Authors:
- Dependencies:
- none
- Versions:
-
0.0.4 2018-Jul-26 0.0.3 2018-Jul-25 0.0.2 2018-Jul-24 0.0.1 2018-Jul-23 ~master 2018-Jul-27 - Download Stats:
-
-
0 downloads today
-
1 downloads this week
-
1 downloads this month
-
13 downloads total
-
- Score:
- 0.0
- Short URL:
- datacat.dub.pm