grafeo-datasets
The Silicon Valley demo dataset for Grafeo: people, companies, products, places and events as nodes and edges, a timeline of dated facts, ready-to-run GQL and Cypher scripts, Turtle, and MiniLM embeddings of every description.
An homage to the HBO series Silicon Valley; not affiliated with or endorsed by HBO. All descriptions are original.
Install
pip install grafeo-datasets
Python 3.12 or later. The data ships inside the package, so nothing is fetched at run time, and the package itself has no dependencies. To load the dataset into a database, install Grafeo with the grafeo extra:
pip install "grafeo-datasets[grafeo]"
API
Everything lives in grafeo_datasets.silicon_valley.
| Function | Returns |
|---|---|
nodes() |
list of node dicts |
edges() |
list of edge dicts |
timeline() |
list of dated facts |
gql() |
GQL script as text, one statement per line |
cypher() |
Cypher script as text, one statement per line |
turtle() |
Turtle text |
vectors() |
VectorSet with model, dimension and by_key |
load(db, *, vectors=False) |
number of statements run on db |
Data
from grafeo_datasets import silicon_valley
nodes = silicon_valley.nodes()
edges = silicon_valley.edges()
timeline = silicon_valley.timeline()
print(len(nodes), len(edges), len(timeline))
A node has key, label, name, description and props. An edge has type, source and target (node keys) and props. A timeline fact has subject, relation and object (node keys), plus from and to. Both dates are optional: from is absent when only the end is known, to is absent while the fact still holds. Dates are YYYY-MM-DD, or YYYY-MM when only the month is known. Each call returns fresh lists.
GQL, Cypher and Turtle
gql() and cypher() return the whole script as text, one statement per line. Month-only dates load as the first of the month, with a <field>_precision property set to 'month'.
turtle() uses the namespace https://grafeo.dev/datasets/silicon-valley/ and carries no vectors. Dates are xsd:date, so SPARQL range filters work on them; a month-only date is the first of the month, with sv:<field>Precision "month" on the same subject (for example sv:fromPrecision).
Vectors
from grafeo_datasets import silicon_valley
vs = silicon_valley.vectors()
print(vs.model, vs.dimension, len(vs.by_key))
embedding = vs.by_key["middle-out"] # list of 384 floats
by_key holds one unit-length list of dimension floats per node key. The model is Xenova/all-MiniLM-L6-v2 (quantized), with mean pooling and normalised output. The vectors are read with the standard library only.
Load into Grafeo
from grafeo import GrafeoDB
from grafeo_datasets import silicon_valley
db = GrafeoDB()
count = silicon_valley.load(db)
print(count, "statements run")
load runs each statement of the GQL script with db.execute. It raises ValueError when the database already holds the dataset, fully or in part, so a second load never duplicates the nodes. After a load that failed partway, load into an empty database.
Vector search
load(db, vectors=True) runs the script that stores each description's embedding in an embedding property and creates one cosine vector index per label. Then search with db.vector_search(label, property, query, k), which returns (node_id, distance) pairs, nearest first:
from grafeo import GrafeoDB
from grafeo_datasets import silicon_valley
db = GrafeoDB()
silicon_valley.load(db, vectors=True)
query = silicon_valley.vectors().by_key["middle-out"]
for node_id, distance in db.vector_search("Technology", "embedding", query, 2):
print(node_id, distance)
A query must be embedded with the same quantized model. A query embedded with a different precision does not line up with the stored vectors.
Licence
Apache-2.0.
Metadata
Release files for grafeo-datasets 0.6.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| grafeo_datasets-0.6.3.tar.gz | 258.4 kB | With provenance | Details for grafeo_datasets-0.6.3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| grafeo_datasets-0.6.3-py3-none-any.whl | Python 3 | none | any | Details for grafeo_datasets-0.6.3-py3-none-any.whl |
Total release size: 527.0 kB
Release files / grafeo_datasets-0.6.3.tar.gz
| Download URL | grafeo_datasets-0.6.3.tar.gz |
|---|---|
| Size | 258.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b58d0950905755181a9e496e973137c247980ffe361dcb91e171d47cff2b69de
|
|
BLAKE2b-256 checksum How to use checksums |
05a31824000ef9d9f55acc580d6aaee92acffdff341326dbb2f7716f4cc5cedd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 15, 2026.
Transparency logRelease files / grafeo_datasets-0.6.3-py3-none-any.whl
| Download URL | grafeo_datasets-0.6.3-py3-none-any.whl |
|---|---|
| Size | 268.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a6ad4c07b0180bd9ec0925b5e3828dd5e38c869f7cb50056f7d5f6bb11482413
|
|
BLAKE2b-256 checksum How to use checksums |
9fe78e127cd346dbcdc15aa26ed2897147e15e82de9076dd1a37c144b84f2bbe
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 15, 2026.
Transparency logSecurity for grafeo-datasets 0.6.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for grafeo_datasets-0.6.3.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 15, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.