From edc2db353e74431c09ebc7a112df91a79fb1621d Mon Sep 17 00:00:00 2001 From: swilly22 Date: Fri, 1 Dec 2023 12:33:52 +0200 Subject: [PATCH 1/5] docs index page --- index.md | 138 +++++++++++++++---------------------------------------- 1 file changed, 37 insertions(+), 101 deletions(-) diff --git a/index.md b/index.md index cf49653..136eb85 100644 --- a/index.md +++ b/index.md @@ -6,141 +6,77 @@ description: "The fastest way to your knowledge" permalink: / --- -# FalkorDB Docs +# FalkorDB [![Docker Hub](https://img.shields.io/docker/pulls/falkordb/falkordb?label=Docker)](https://hub.docker.com/r/falkordb/falkordb/) [![Discord](https://img.shields.io/discord/1146782921294884966?style=flat-square)](https://discord.gg/ErBEqN9E) -FalkorDB is a graph database built on Redis. This graph database uses [GraphBLAS](http://faculty.cse.tamu.edu/davis/GraphBLAS.html) under the hood for its [sparse adjacency matrix](https://en.wikipedia.org/wiki/Adjacency_matrix) graph representation. +FalkorDB is a blazingly fast graph database used for low latency & high throughput scenarios, under the hood it runs [GraphBLAS](http://faculty.cse.tamu.edu/davis/GraphBLAS.html) to perform graph operations using sparse algebraic constructs. ## Primary features * Adopting the [Property Graph Model](https://github.com/opencypher/openCypher/blob/master/docs/property-graph-model.adoc) - * Nodes (vertices) and Relationships (edges) that may have attributes - * Nodes can have multiple labels - * Relationships have a relationship type +* Supports [OpenCypher](http://www.opencypher.org/) query language with proprietary extensions +* Offers Full-Text Search, Vector Similarly & Numeric indexing. +* Interacts via either [RESP](https://redis.io/docs/reference/protocol-spec/) and [Bolt](https://en.wikipedia.org/wiki/Bolt_(network_protocol)) protocols * Graphs represented as sparse adjacency matrices - * Queries are translated into linear algebra expressions -* [OpenCypher](http://www.opencypher.org/) with proprietary extensions as a query language -* Support of both [RESP](https://redis.io/docs/reference/protocol-spec/) and [Bolt](https://en.wikipedia.org/wiki/Bolt_(network_protocol)) -* Indexing - Full-Text Search, Vector Similarly & Numeric -To see FalkorDB in action, visit [Demos](https://github.com/FalkorDB/FalkorDB/tree/master/demo). -You can also pick getting started [demos for the leading programming languages](https://github.com/FalkorDB/demos), such as Java, Python & NodeJS. +## Give it a try -## Docker - -To quickly try out FalkorDB, launch an instance using docker: +Launch an instance using docker, or use our [sandbox](https://cloud.falkordb.com/sandbox) ```sh docker run -p 6379:6379 -it --rm falkordb/falkordb:latest ``` -### Give it a try - -After you load FalkorDB, you can interact with it using `redis-cli`. - -Here we'll quickly create a small graph representing a subset of motorcycle riders and teams taking part in the MotoGP championship. Once created, we'll start querying our data. - -### With `redis-cli` - -```sh -$ redis-cli -127.0.0.1:6379> GRAPH.QUERY MotoGP "CREATE (:Rider {name:'Valentino Rossi'})-[:rides]->(:Team {name:'Yamaha'}), (:Rider {name:'Dani Pedrosa'})-[:rides]->(:Team {name:'Honda'}), (:Rider {name:'Andrea Dovizioso'})-[:rides]->(:Team {name:'Ducati'})" -1) 1) "Labels added: 2" - 2) "Nodes created: 6" - 3) "Properties set: 6" - 4) "Relationships created: 3" - 5) "Cached execution: 0" - 6) "Query internal execution time: 0.399000 milliseconds" -``` - -Now that our MotoGP graph is created, we can start asking questions. For example: -Who's riding for team Yamaha? - -```sh -127.0.0.1:6379> GRAPH.QUERY MotoGP "MATCH (r:Rider)-[:rides]->(t:Team) WHERE t.name = 'Yamaha' RETURN r.name, t.name" -1) 1) "r.name" - 2) "t.name" -2) 1) 1) "Valentino Rossi" - 2) "Yamaha" -3) 1) "Cached execution: 0" - 2) "Query internal execution time: 0.625399 milliseconds" -``` - -How many riders represent team Ducati? - -```sh -127.0.0.1:6379> GRAPH.QUERY MotoGP "MATCH (r:Rider)-[:rides]->(t:Team {name:'Ducati'}) RETURN count(r)" -1) 1) "count(r)" -2) 1) 1) (integer) 1 -3) 1) "Cached execution: 0" - 2) "Query internal execution time: 0.624435 milliseconds" -``` - -## Building +Once loaded you can interact with FalkorDB using any of the supported [client libraries](https://github.com/falkorDB/falkordb#Client-libraries) -Requirements: +Here we'll use [FalkorDB Python client](https://pypi.org/project/FalkorDB/) to create a small graph representing a subset of motorcycle riders and teams taking part in the MotoGP league, once created we'll start querying our data. -* Clone the FalkorDB repository: `git clone --recurse-submodules -j8 https://github.com/FalkorDB/FalkorDB.git` - -* On Ubuntu Linux, run: `apt-get install build-essential cmake m4 automake peg libtool autoconf python3` - -* On OS X, verify that `homebrew` is installed and run: `brew install cmake m4 automake peg libtool autoconf`. - * The version of Clang that ships with the OS X toolchain does not support OpenMP, which is a requirement for FalkorDB. One way to resolve this is to run `brew install gcc g++` and follow the on-screen instructions to update the symbolic links. Note that this is a system-wide change - setting the environment variables for `CC` and `CXX` will work if that is not an option. - -To build, run `make` in the project's directory. - -Congratulations! You can find the compiled binary at: `src/falkordb.so` - -## Using FalkorDB - -Before using FalkorDB, you should familiarize yourself with its commands and syntax as detailed in the -[command reference](/commands). - -You can call FalkorDB's commands from any Redis client. - -### With `redis-cli` +```python +from falkordb import FalkorDB -```sh -$ redis-cli -127.0.0.1:6379> GRAPH.QUERY social "CREATE (:person {name: 'roi', age: 33, gender: 'male', status: 'married'})" -``` +# Connect to FalkorDB +db = FalkorDB(host='localhost', port=6379) -### With any other client +# Create the 'MotoGP' graph +g = db.select_graph('MotoGP') +g.query("""CREATE (:Rider {name:'Valentino Rossi'})-[:rides]->(:Team {name:'Yamaha'}), + (:Rider {name:'Dani Pedrosa'})-[:rides]->(:Team {name:'Honda'}), + (:Rider {name:'Andrea Dovizioso'})-[:rides]->(:Team {name:'Ducati'})""") -You can interact with FalkorDB using your client's ability to send raw Redis commands. -The exact method for doing that depends on your client of choice. +# Query which riders represents Yamaha? +res = g.query("""MATCH (r:Rider)-[:rides]->(t:Team) + WHERE t.name = 'Yamaha' + RETURN r.name""") -#### Python example +for row in res.result_set: +print(row[0]) -This code snippet shows how to use FalkorDB with raw Redis commands from Python using -[redis-py](https://github.com/redis/redis-py): +# Prints: "Valentino Rossi" -```python -import redis +# Query how many riders represent team Ducati ? + res = g.query("""MATCH (r:Rider)-[:rides]->(t:Team {name:'Ducati'}) + RETURN count(r)""") -r = redis.Redis() -reply = r.graph("social").query("MATCH (r:Rider)-[:rides]->(t:Team {name:'Ducati'}) RETURN count(r)") -``` +print(row[0]) +# Prints: + ``` + For additional demos please see visit [Demos](https://github.com/FalkorDB/demos). ## Client libraries -Language-specific clients have been written by the community and the FalkorDB team for 6 languages. - -The full list and links can be found on the [Clients](/clients) page. + Language-specific clients have been written by the community and the FalkorDB team. + The full list and links can be found on the [Clients](/clients) page. ## Data import - -The falkordb team maintains the [falkordb-bulk-loader](https://github.com/falkordb/falkordb-bulk-loader) for importing new graphs from CSV files. - -The data format used by this tool is described in the [GRAPH.BULK implementation details](/design/bulk_spec). + When loading large graphs from CSV files, we recommend using [falkordb-bulk-loader](https://github.com/falkordb/falkordb-bulk-loader) ## Mailing List / Forum -Got questions? Feel free to ask at the [FalkorDB forum](https://github.com/FalkorDB/FalkorDB/discussions). + Got questions? Please contact us at the [FalkorDB forum](https://github.com/FalkorDB/FalkorDB/discussions). ## License -FalkorDB is licensed under the [the Server Side Public License v1 (SSPLv1)](https://github.com/FalkorDB/FalkorDB/blob/master/LICENSE.txt). + FalkorDB is licensed under the [the Server Side Public License v1 (SSPLv1)](https://github.com/FalkorDB/FalkorDB/blob/master/LICENSE.txt). From 41aafab1cacf1d6a838357f9f211649083cd5313 Mon Sep 17 00:00:00 2001 From: Roi Lipman Date: Fri, 1 Dec 2023 12:35:20 +0200 Subject: [PATCH 2/5] Update index.md --- index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.md b/index.md index 136eb85..00d4c8f 100644 --- a/index.md +++ b/index.md @@ -11,7 +11,7 @@ permalink: / [![Docker Hub](https://img.shields.io/docker/pulls/falkordb/falkordb?label=Docker)](https://hub.docker.com/r/falkordb/falkordb/) [![Discord](https://img.shields.io/discord/1146782921294884966?style=flat-square)](https://discord.gg/ErBEqN9E) -FalkorDB is a blazingly fast graph database used for low latency & high throughput scenarios, under the hood it runs [GraphBLAS](http://faculty.cse.tamu.edu/davis/GraphBLAS.html) to perform graph operations using sparse algebraic constructs. +FalkorDB is a blazingly fast graph database used for low latency & high throughput scenarios, under the hood it runs [GraphBLAS](http://faculty.cse.tamu.edu/davis/GraphBLAS.html) to perform graph operations using sparse linear algebra. ## Primary features From 66c0939b024e3b5d6b7e3b749bc7d5b2f6e3d3bf Mon Sep 17 00:00:00 2001 From: Roi Lipman Date: Fri, 1 Dec 2023 12:37:29 +0200 Subject: [PATCH 3/5] Update index.md --- index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.md b/index.md index 00d4c8f..fd7854c 100644 --- a/index.md +++ b/index.md @@ -11,7 +11,7 @@ permalink: / [![Docker Hub](https://img.shields.io/docker/pulls/falkordb/falkordb?label=Docker)](https://hub.docker.com/r/falkordb/falkordb/) [![Discord](https://img.shields.io/discord/1146782921294884966?style=flat-square)](https://discord.gg/ErBEqN9E) -FalkorDB is a blazingly fast graph database used for low latency & high throughput scenarios, under the hood it runs [GraphBLAS](http://faculty.cse.tamu.edu/davis/GraphBLAS.html) to perform graph operations using sparse linear algebra. +FalkorDB is a blazing fast graph database used for low latency & high throughput scenarios, under the hood it runs [GraphBLAS](http://faculty.cse.tamu.edu/davis/GraphBLAS.html) to perform graph operations using sparse linear algebra. ## Primary features From b3767ce937853d73ac206acc92b1e958a9853896 Mon Sep 17 00:00:00 2001 From: swilly22 Date: Fri, 1 Dec 2023 12:39:35 +0200 Subject: [PATCH 4/5] update spellcheck wordlist --- .wordlist.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.wordlist.txt b/.wordlist.txt index c69502d..944be4f 100644 --- a/.wordlist.txt +++ b/.wordlist.txt @@ -240,3 +240,7 @@ whitespace xyxel yaml uri +Dani +Dovizioso +Pedrosa +Rossi From a790996344e407f1e65c4e2355bf03e1d0da869e Mon Sep 17 00:00:00 2001 From: Roi Lipman Date: Fri, 1 Dec 2023 12:41:19 +0200 Subject: [PATCH 5/5] Update .wordlist.txt --- .wordlist.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/.wordlist.txt b/.wordlist.txt index 944be4f..56d9d9d 100644 --- a/.wordlist.txt +++ b/.wordlist.txt @@ -244,3 +244,4 @@ Dani Dovizioso Pedrosa Rossi +localhost