From e15c6a9862963c6318547412eb61a50913b7fd27 Mon Sep 17 00:00:00 2001 From: Guodong Jin Date: Sat, 3 Dec 2022 02:20:54 -0500 Subject: [PATCH] update README --- README.md | 69 +++++++++++++++++++++++++----- scripts/pip-package/README.md | 2 +- scripts/pip-package/package_tar.sh | 2 +- 3 files changed, 60 insertions(+), 13 deletions(-) mode change 100644 => 100755 scripts/pip-package/package_tar.sh diff --git a/README.md b/README.md index d11b1c8a1d..644911648a 100644 --- a/README.md +++ b/README.md @@ -16,25 +16,72 @@ Kùzu is an in-process property graph database management system (GDBMS) built f Kùzu is being actively developed at University of Waterloo as a feature-rich and usable GDBMS. Kùzu is available under a permissible license. So try it out and help us make it better! We welcome your feedback and feature requests. +## Build +To build from source code, Kùzu requires Cmake(>=3.11), Python 3, and a compiler that supports `C++20`. +- Perform a full clean build + - `make clean && make` +- Run tests (optional) + - `make test` + +After build, our CLI binary `kuzu_shell` is available under the directory `build/release/tools/shell/`. + ## Installation -Please refer to [our website](https://kuzudb.com/) for installation and usage instructions. +### Precompiled binary +Precompiled binary of our latest release can be downloaded [here](https://github.com/kuzudb/kuzu/releases/tag/0.0.1). +### Python package +Our Python package can be directly install through pip. +``` +pip install kuzu +``` + + +For more installation and usage instructions, please refer to [our website](https://kuzudb.com/). + +## Example +We take `tinysnb` as an example graph, which is under `dataset/tinysnb` in our source code, and can be downloaded [here](https://github.com/kuzudb/kuzu/tree/master/dataset/tinysnb). +### CLI +#### Start CLI +``` +./build/release/tools/shell/kuzu_shell -i "./test.db" +``` +#### Schema Definition +```cypher +kuzu> CREATE NODE TABLE person (ID INt64, fName STRING, gender INT64, isStudent BOOLEAN, isWorker BOOLEAN, age INT64, eyeSight DOUBLE, birthdate DATE, registerTime TIMESTAMP, lastJobDuration interval, workedHours INT64[], usedNames STRING[], courseScoresPerTerm INT64[][], PRIMARY KEY (ID)); +kuzu> CREATE REL TABLE knows (FROM person TO person, date DATE, meetTime TIMESTAMP, validInterval INTERVAL, comments STRING[], MANY_MANY); +``` -## Development -For development, Kùzu requires Cmake(>=3.11), Python 3, and a compiler that supports `C++20`. +#### Data Import +```cypher +kuzu> COPY person FROM "dataset/tinysnb/vPerson.csv" (HEADER=true); +kuzu> COPY knows FROM "dataset/tinysnb/eKnows.csv"; +``` -### Build +After creating node/rel tables, and importing csv files, you can now run queries! +```cypher +kuzu> MATCH (b:person)<-[e1:knows]-(a:person)-[e2:knows]->(c:person) RETURN COUNT(*); +``` + +### Python +```python +import kuzu -- To do a full clean build - - `make clean` - - `make NUM_THREADS=x` -- To test (after running the build) - - `make test` +db = kuzu.database('./testpy') +conn = kuzu.connection(db) +conn.execute("CREATE NODE TABLE person (ID INt64, fName STRING, gender INT64, isStudent BOOLEAN, isWorker BOOLEAN, age INT64, eyeSight DOUBLE, birthdate DATE, registerTime TIMESTAMP, lastJobDuration interval, workedHours INT64[], usedNames STRING[], courseScoresPerTerm INT64[][], PRIMARY KEY (ID));") +conn.execute("CREATE REL TABLE knows (FROM person TO person, date DATE, meetTime TIMESTAMP, validInterval INTERVAL, comments STRING[], MANY_MANY);") +conn.execute("COPY person FROM 'dataset/tinysnb/vPerson.csv' (HEADER=true);") +conn.execute("COPY knows FROM 'dataset/tinysnb/eKnows.csv';") +result = conn.execute("MATCH (b:person)<-[e1:knows]-(a:person)-[e2:knows]->(c:person) RETURN COUNT(*)") +while result.hasNext(): + print(result.getNext()) +``` +Refer to our [Data Import](https://kuzudb.com/docs/data-import) and [Cypher](https://kuzudb.com/docs/cypher) section for more information. ## Code of Conduct -We are developing Kùzu in a publicly open github repo and encourage everyone -to comment and discuss topics related to Kùzu. However we ask everyone to be +We are developing Kùzu in a publicly open GitHub repo and encourage everyone +to comment and discuss topics related to Kùzu. However, we ask everyone to be very respectful and polite in discussions and avoid any hurtful language in any form. Kùzu is being developed in Canada, a land that is proud in their high standards for politeness and where a person you bumped into on the road will likely diff --git a/scripts/pip-package/README.md b/scripts/pip-package/README.md index a074c058c2..11355af1e3 100644 --- a/scripts/pip-package/README.md +++ b/scripts/pip-package/README.md @@ -5,7 +5,7 @@ chmod +x package_tar.sh pip install kuzu.tar.gz ``` -Note: installing from source requires the full toolchain for building the project, including bazel, OpenJDK, and a compiler compatible with C++20. The package works for both Linux and macOS. +Note: installing from source requires the full toolchain for building the project, including Cmake(>=3.11), Python 3, and a compiler compatible with C++20. The package works for both Linux and macOS. # Container for self-hosted manylinux builder ## Introduction diff --git a/scripts/pip-package/package_tar.sh b/scripts/pip-package/package_tar.sh old mode 100644 new mode 100755 index da5b4491e2..e59fb0c048 --- a/scripts/pip-package/package_tar.sh +++ b/scripts/pip-package/package_tar.sh @@ -3,7 +3,7 @@ # Collect source files cp ../../LICENSE ./LICENSE.txt tar --exclude="$(pwd)" \ - --exclude="./bazel-*" \ + --exclude="./build" \ --exclude="./scripts" \ --exclude="./.?*" \ -cf\