|
|
@ -10,27 +10,27 @@ that uses Datalog for query and focuses on graph data.
|
|
|
|
## Features
|
|
|
|
## Features
|
|
|
|
|
|
|
|
|
|
|
|
* Relational database with [Datalog](https://en.wikipedia.org/wiki/Datalog) as the query language
|
|
|
|
* Relational database with [Datalog](https://en.wikipedia.org/wiki/Datalog) as the query language
|
|
|
|
* Supports recursion, including recursion through (safe) aggregation, capable of expressing complex graph operations and algorithms
|
|
|
|
* Recursive queries, especially recursion through (safe) aggregation, capable of expressing complex graph operations and algorithms
|
|
|
|
* Fixed rules providing efficient whole-graph algorithms which integrate seamlessly with Datalog
|
|
|
|
* Fixed rules providing efficient whole-graph algorithms which integrate seamlessly with Datalog
|
|
|
|
* Rich set of built-in functions and aggregations
|
|
|
|
* Rich set of built-in functions and aggregations
|
|
|
|
* Only a single executable, trivial to deploy and run
|
|
|
|
* Only a single executable, trivial to deploy and run
|
|
|
|
* Easy to use from any programming language
|
|
|
|
* Easy to use from any programming language
|
|
|
|
* Special support for [Jupyter](https://jupyter.org/) notebooks, integrate nicely with the Python DataScience ecosystem
|
|
|
|
* Special support for [Jupyter](https://jupyter.org/) notebooks for integration with the Python DataScience ecosystem
|
|
|
|
* Modern, clean, flexible syntax, nice error messages
|
|
|
|
* Modern, clean, flexible syntax, informative error messages
|
|
|
|
|
|
|
|
|
|
|
|
## Teasers
|
|
|
|
## Teasers
|
|
|
|
|
|
|
|
|
|
|
|
In the following, `*route` refers to a relation with two columns named `src` and `dst`,
|
|
|
|
Here `*route` is a relation with two columns `src` and `dst`,
|
|
|
|
representing routes between airports.
|
|
|
|
representing a route between those airports.
|
|
|
|
|
|
|
|
|
|
|
|
Find airports reachable by one stop from Frankfurt Airport (code `FRA`, the busiest airport in the world):
|
|
|
|
Find airports reachable by one stop from Frankfurt Airport (code `FRA`):
|
|
|
|
|
|
|
|
|
|
|
|
```js
|
|
|
|
```js
|
|
|
|
?[dst] := *route{src: 'FRA', dst: stop},
|
|
|
|
?[dst] := *route{src: 'FRA', dst: stop},
|
|
|
|
*route{src: stop, dst}
|
|
|
|
*route{src: stop, dst}
|
|
|
|
```
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
Find _all_ airports reachable from Frankfurt (i.e., the transitive closure)
|
|
|
|
Find airports reachable from Frankfurt with any number of stops
|
|
|
|
with code starting with the letter `A`:
|
|
|
|
with code starting with the letter `A`:
|
|
|
|
|
|
|
|
|
|
|
|
```js
|
|
|
|
```js
|
|
|
@ -39,7 +39,7 @@ reachable[dst] := reachable[src], *route{src, dst}
|
|
|
|
?[airport] := reachable[airport], starts_with(airport, 'A')
|
|
|
|
?[airport] := reachable[airport], starts_with(airport, 'A')
|
|
|
|
```
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
Compute the shortest path between Frankfurt and all airports in the world with recursion through aggregation:
|
|
|
|
Compute the shortest path between Frankfurt and all airports in the world:
|
|
|
|
|
|
|
|
|
|
|
|
```js
|
|
|
|
```js
|
|
|
|
shortest_paths[dst, shortest(path)] := *route{src: 'FRA', dst},
|
|
|
|
shortest_paths[dst, shortest(path)] := *route{src: 'FRA', dst},
|
|
|
@ -50,7 +50,7 @@ shortest_paths[dst, shortest(path)] := shortest_paths[stop, prev_path],
|
|
|
|
?[dst, path] := shortest_paths[dst, path]
|
|
|
|
?[dst, path] := shortest_paths[dst, path]
|
|
|
|
```
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
Use a fixed rule to compute the shortest path:
|
|
|
|
Compute the shortest path again, but with built-in algorithm:
|
|
|
|
|
|
|
|
|
|
|
|
```js
|
|
|
|
```js
|
|
|
|
starting[airport] := airport = 'FRA'
|
|
|
|
starting[airport] := airport = 'FRA'
|
|
|
@ -59,7 +59,7 @@ starting[airport] := airport = 'FRA'
|
|
|
|
|
|
|
|
|
|
|
|
## Learning Cozo
|
|
|
|
## Learning Cozo
|
|
|
|
|
|
|
|
|
|
|
|
* Start with the [Tutorial](https://cozodb.github.io/current/tutorial.html) to learn the basics.
|
|
|
|
* Start with the [Tutorial](https://cozodb.github.io/current/tutorial.html) to learn the basics;
|
|
|
|
* Continue with the [Manual](https://cozodb.github.io/current/manual/) to understand the fine points.
|
|
|
|
* Continue with the [Manual](https://cozodb.github.io/current/manual/) to understand the fine points.
|
|
|
|
|
|
|
|
|
|
|
|
## Bug reports, discussions
|
|
|
|
## Bug reports, discussions
|
|
|
@ -179,17 +179,22 @@ Ideas and discussions are welcome.
|
|
|
|
|
|
|
|
|
|
|
|
## Storage engine
|
|
|
|
## Storage engine
|
|
|
|
|
|
|
|
|
|
|
|
Cozo is written in Rust, with [RocksDB](http://rocksdb.org/) as the storage engine.
|
|
|
|
Cozo is written in Rust, with [RocksDB](http://rocksdb.org/) as the storage engine
|
|
|
|
|
|
|
|
(this may change in the future).
|
|
|
|
We manually wrote the C++/Rust bindings for RocksDB with [cxx](https://cxx.rs/).
|
|
|
|
We manually wrote the C++/Rust bindings for RocksDB with [cxx](https://cxx.rs/).
|
|
|
|
|
|
|
|
|
|
|
|
## Contributing
|
|
|
|
## Contributing
|
|
|
|
|
|
|
|
|
|
|
|
Contributions to code or other materials should be done via [pull requests](https://github.com/cozodb/cozo/pulls).
|
|
|
|
Contributions to code or other materials
|
|
|
|
You will be guided to sign a CLA the first time you contribute.
|
|
|
|
should be done via [pull requests](https://github.com/cozodb/cozo/pulls).
|
|
|
|
|
|
|
|
|
|
|
|
## Licensing
|
|
|
|
For code contributions other than simple bug fixes, please
|
|
|
|
|
|
|
|
[discuss](https://github.com/cozodb/cozo/discussions) it
|
|
|
|
|
|
|
|
with the maintainer first before opening a pull request,
|
|
|
|
|
|
|
|
otherwise it is unlikely to be accepted.
|
|
|
|
|
|
|
|
|
|
|
|
The contents of this project are licensed under AGPL-3.0 or later, with the following exceptions:
|
|
|
|
## Licensing
|
|
|
|
|
|
|
|
|
|
|
|
* Contents in the `cozorocks` directory are licensed under MIT, or Apache-2.0, or BSD-3-Clause;
|
|
|
|
The contents of this project are licensed under AGPL-3.0 or later, except:
|
|
|
|
* Contents in the `docs` directory are licensed under CC BY-SA 4.0.
|
|
|
|
* Files under `cozorocks/` are licensed under MIT, or Apache-2.0, or BSD-3-Clause;
|
|
|
|
|
|
|
|
* Files under `docs/` are licensed under CC BY-SA 4.0.
|