Fix file extensions in USAGE, update IMDB experiment/example.
This commit is contained in:
parent
76718fa49f
commit
363ba15be4
3 changed files with 14 additions and 14 deletions
8
USAGE.md
8
USAGE.md
|
|
@ -82,13 +82,13 @@ var db = newLbugDatabase()
|
||||||
```
|
```
|
||||||
|
|
||||||
```nim
|
```nim
|
||||||
# "db" is persistent, stored in the file "data.kz".
|
# "db" is persistent, stored in the file "data.db".
|
||||||
var db = newLbugDatabase("data.kz")
|
var db = newLbugDatabase("data.db")
|
||||||
```
|
```
|
||||||
The database path is retained, and can be recalled via `db.path`.
|
The database path is retained, and can be recalled via `db.path`.
|
||||||
|
|
||||||
```nim
|
```nim
|
||||||
db.path #=> "data.kz"
|
db.path #=> "data.db"
|
||||||
```
|
```
|
||||||
|
|
||||||
### Database Configuration
|
### Database Configuration
|
||||||
|
|
@ -110,7 +110,7 @@ object as the second argument to `newLbugDatabase()`:
|
||||||
|
|
||||||
```nim
|
```nim
|
||||||
# Open a readonly handle.
|
# Open a readonly handle.
|
||||||
var db = newLbugDatabase( "data.kz", lbugConfig( read_only=true ) )
|
var db = newLbugDatabase( "data.db", lbugConfig( read_only=true ) )
|
||||||
```
|
```
|
||||||
|
|
||||||
### The Connection
|
### The Connection
|
||||||
|
|
|
||||||
|
|
@ -17,9 +17,9 @@ import
|
||||||
std/os,
|
std/os,
|
||||||
std/sequtils,
|
std/sequtils,
|
||||||
std/strformat
|
std/strformat
|
||||||
import kuzu
|
import lbug
|
||||||
|
|
||||||
const DB = "imdb.kz"
|
const DB = "imdb.db"
|
||||||
const DOT = "imdb-results.dot"
|
const DOT = "imdb-results.dot"
|
||||||
|
|
||||||
if not DB.fileExists:
|
if not DB.fileExists:
|
||||||
|
|
@ -31,13 +31,13 @@ if paramCount() < 2:
|
||||||
echo "I require 2 actor names, in quotes."
|
echo "I require 2 actor names, in quotes."
|
||||||
quit 1
|
quit 1
|
||||||
|
|
||||||
var stmt: KuzuPreparedStatement
|
var stmt: LbugPreparedStatement
|
||||||
var res: KuzuQueryResult
|
var res: LbugQueryResult
|
||||||
|
|
||||||
var fromActor = paramStr(1)
|
var fromActor = paramStr(1)
|
||||||
var toActor = paramStr(2)
|
var toActor = paramStr(2)
|
||||||
|
|
||||||
var db = newKuzuDatabase( DB, kuzuConfig(read_only=true) )
|
var db = newLbugDatabase( DB, lbugConfig(read_only=true) )
|
||||||
var conn = db.connect
|
var conn = db.connect
|
||||||
|
|
||||||
echo "Database opened: ", db.path
|
echo "Database opened: ", db.path
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
# vim: set et sta sw=4 ts=4 :
|
# vim: set et sta sw=4 ts=4 :
|
||||||
#
|
#
|
||||||
# Fetches movie and actor data from IMDB and converts it
|
# Fetches movie and actor data from IMDB and converts it
|
||||||
# to CSV, then imports into a Kuzu graph database.
|
# to CSV, then imports into a Ladybug graph database.
|
||||||
#
|
#
|
||||||
# Only cares about actors in movies! Things like writers,
|
# Only cares about actors in movies! Things like writers,
|
||||||
# directors, and TV shows are intentionally omitted.
|
# directors, and TV shows are intentionally omitted.
|
||||||
|
|
@ -18,9 +18,9 @@ import
|
||||||
std/strformat,
|
std/strformat,
|
||||||
std/strutils,
|
std/strutils,
|
||||||
zip/gzipfiles,
|
zip/gzipfiles,
|
||||||
kuzu
|
lbug
|
||||||
|
|
||||||
const DB = "imdb.kz"
|
const DB = "imdb.db"
|
||||||
const SOURCE = "https://datasets.imdbws.com"
|
const SOURCE = "https://datasets.imdbws.com"
|
||||||
const FILES = @[ "name.basics", "title.basics", "title.principals" ]
|
const FILES = @[ "name.basics", "title.basics", "title.principals" ]
|
||||||
|
|
||||||
|
|
@ -126,11 +126,11 @@ known_file.close()
|
||||||
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# Ok, now import into a fresh kuzu database.
|
# Ok, now import into a fresh ladybug database.
|
||||||
#
|
#
|
||||||
|
|
||||||
if not DB.dirExists:
|
if not DB.dirExists:
|
||||||
var db = newKuzuDatabase( DB )
|
var db = newLbugDatabase( DB )
|
||||||
var conn = db.connect()
|
var conn = db.connect()
|
||||||
var duration = 0
|
var duration = 0
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue