Skip to content

Commit

Permalink
update README
Browse files Browse the repository at this point in the history
  • Loading branch information
ray6080 committed Dec 8, 2022
1 parent 9918685 commit e15c6a9
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 13 deletions.
69 changes: 58 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion scripts/pip-package/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion scripts/pip-package/package_tar.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Collect source files
cp ../../LICENSE ./LICENSE.txt
tar --exclude="$(pwd)" \
--exclude="./bazel-*" \
--exclude="./build" \
--exclude="./scripts" \
--exclude="./.?*" \
-cf\
Expand Down

0 comments on commit e15c6a9

Please sign in to comment.