Datasets

Every fact set the site's examples run on, relation by relation.

Each example on this site names the facts it runs on, and its caption links here. These tables are read from the fixture files the examples use, when the site is built, so they’re exactly the facts behind every answer you see.

graph

A small directed graph: a path a -> b -> c -> d, x on its own, and a weight on every node.

edge(from, to)

fromto
ab
bc
cd

node(name)

name
a
b
c
d
x

weight(node, w)

nodew
a1
b2
c3
d4
x5
The facts as written
# A small directed graph: a path a -> b -> c -> d, x on its own, and a
# weight on every node.
#: edge(from, to)
#: node(name)
#: weight(node, w)
edge("a", "b")
edge("b", "c")
edge("c", "d")
node("a")
node("b")
node("c")
node("d")
node("x")
weight("a", 1)
weight("b", 2)
weight("c", 3)
weight("d", 4)
weight("x", 5)

The overview uses this one.

deps

A small Go-style service: its packages, what each imports, its tests, who owns each package, and how many lines each has. cache and config import each other.

package(name)

name
app
api
auth
db
cache
config
log
metrics
util
legacy

imports(from, to)

fromto
appapi
appconfig
applog
apiauth
apidb
apicache
apilog
authdb
authconfig
authlog
dbconfig
dblog
cacheconfig
cachelog
configcache
logutil
metricsutil
legacyutil

test(name, pkg)

namepkg
api_testapi
auth_testauth
auth_fuzzauth
db_testdb
util_testutil

owner(pkg, team)

pkgteam
appweb
apiweb
legacyweb
authsecurity
dbdata
cachedata
configplatform
logplatform
metricsplatform
utilplatform

loc(pkg, lines)

pkglines
app300
api1200
auth800
db1500
cache400
config250
log150
metrics200
util100
legacy900
The facts as written
# A small Go-style service: its packages, what each imports, its
# tests, who owns each package, and how many lines each has.
# cache and config import each other.
#: package(name)
#: imports(from, to)
#: test(name, pkg)
#: owner(pkg, team)
#: loc(pkg, lines)
package("app"); package("api"); package("auth"); package("db")
package("cache"); package("config"); package("log")
package("metrics"); package("util"); package("legacy")

imports("app", "api"); imports("app", "config")
imports("app", "log")
imports("api", "auth"); imports("api", "db")
imports("api", "cache"); imports("api", "log")
imports("auth", "db"); imports("auth", "config")
imports("auth", "log")
imports("db", "config"); imports("db", "log")
imports("cache", "config"); imports("cache", "log")
imports("config", "cache")
imports("log", "util")
imports("metrics", "util")
imports("legacy", "util")

test("api_test", "api")
test("auth_test", "auth"); test("auth_fuzz", "auth")
test("db_test", "db")
test("util_test", "util")

owner("app", "web"); owner("api", "web"); owner("legacy", "web")
owner("auth", "security")
owner("db", "data"); owner("cache", "data")
owner("config", "platform"); owner("log", "platform")
owner("metrics", "platform"); owner("util", "platform")

loc("app", 300); loc("api", 1200); loc("auth", 800)
loc("db", 1500); loc("cache", 400); loc("config", 250)
loc("log", 150); loc("metrics", 200); loc("util", 100)
loc("legacy", 900)

The tutorials, the guide and the rest of the reference use this one. cache and config import each other on purpose, so the recursion examples have a cycle to get through.