ProGraph
ProGraph is a virtual knowledge graph that answers SPARQL and Cypher queries over the tables you already have. You describe how your tables map to a graph. ProGraph translates each query into one SQL statement, and your database runs it. Nothing is copied or loaded, and ProGraph doesn't write to your tables (unless you mark a mapping mutable and call set_properties).
Why consider it
- No copy, no pipeline. The graph is a view over live tables: a query sees the data as it is now. There's no export to a graph database, no extract-transform-load job, and nothing to keep in sync.
- SPARQL and Cypher over one mapping. One mapping serves both the RDF view (SPARQL 1.1) and the property-graph view (openCypher). Teams that think in triples and teams that think in nodes and relationships query the same data.
- Reasoning without materialising everything. Give ProGraph an OWL ontology, and queries answer with what the ontology implies, not only what the tables state. OWL 2 QL is answered by rewriting the query, so nothing is stored and answers are always current. OWL 2 RL is materialised into ProGraph's own tables, never yours, and by default read only while your tables are provably unchanged. Cypher reads the RL facts too: derived labels, relationships and properties, and one node per
owl:sameAsentity. - Built for Databricks. It runs on serverless SQL warehouses and Lakehouse RT over Unity Catalog tables, in place. It recognises which kind of warehouse it is on, and plans with the rewrites measured on that kind.
- Checked against the standards. SPARQL is checked on the W3C test suites, and its own test corpus against Apache Jena and Oxigraph. Cypher is checked with the openCypher TCK: on 1.3.0 it gave no wrong answers across 2,880 scenarios on DuckDB and Spark.
- Runs where your data is. Databricks (serverless SQL warehouses and Lakehouse RT), Apache Spark with Delta Lake, DuckDB (databases, Parquet and CSV files, pandas DataFrames), PostgreSQL and Lakebase, Oracle, SQL Server and MySQL.
- Python first. Answers come back as Apache Arrow tables (or lists, or pandas DataFrames). A SPARQL endpoint and an MCP server, with a natural-language
asktool, are included.
Install
pip install "prograph[duckdb]" # DuckDB, over files or pandas DataFrames
pip install "prograph[databricks]" # Databricks SQL warehouses
pip install "prograph[databricks-rt]" # Lakehouse RT (the connector's kernel path)
Python 3.11 or later. The extras, from pyproject.toml; install the ones you use:
| Extra | Adds |
|---|---|
duckdb |
DuckDB and pandas: the default engine over DataFrames, and DuckDB databases |
pandas |
pandas 2 |
postgresql |
the ADBC PostgreSQL driver |
oracle |
oracledb |
spark |
PySpark 4.1 or later |
databricks |
the Databricks SQL connector and SDK |
databricks-rt |
the connector's kernel path, for Lakehouse RT warehouses |
shacl |
pyshacl, for engine.validate_shapes() |
endpoint |
the SPARQL Protocol server, prograph serve |
mcp |
the MCP server and the model client its ask tool uses |
cli |
prograph load-ttl and prograph infer-schema |
nlp, nlp-databricks, nlp-langchain |
the natural-language interface |
genie |
the Databricks Genie integration |
logging, ui, graphql |
structlog; the web UI; GraphQL (experimental) |
Quickstart
One table, one mapping, the same question in SPARQL and in Cypher:
import duckdb
from prograph import ProGraph
con = duckdb.connect()
con.execute("CREATE TABLE people (id INTEGER, name VARCHAR, age INTEGER)")
con.execute("INSERT INTO people VALUES (1, 'Alice', 30), (2, 'Bob', 25)")
engine = ProGraph.from_yaml("""
version: "1.0"
graph: {name: people}
sources: {people: {table: people}}
nodes:
- label: Person
source: people
id_column: id
iri_template: "http://example.org/person/{id}"
class_iri: "http://example.org/Person"
properties: {name: name, age: age}
rdf: {vocab_iri: "http://example.org/", auto_generate: true}
""", connection=con)
engine.execute("""
PREFIX ex: <http://example.org/>
SELECT ?name WHERE { ?p a ex:Person ; ex:name ?name ; ex:age ?age . FILTER(?age > 26) }
""", return_type="list")
# [{'name': 'Alice'}]
engine.execute("MATCH (p:Person) WHERE p.age > 26 RETURN p.name AS name",
language="cypher", return_type="list")
# [{'name': 'Alice'}]
ProGraph.from_r2rml(path, connection=con) reads a W3C R2RML mapping instead. An R2RML mapping serves SPARQL, with OWL 2 QL or RL reasoning and SHACL; Cypher needs the YAML mapping, which names the labels and relationship types it uses. More: your first knowledge graph, map your tables, R2RML tutorial.
On Databricks
from databricks import sql
from prograph import ProGraph
con = sql.connect(server_hostname=..., http_path=..., credentials_provider=...)
engine = ProGraph.from_config("graph.yaml", connection=con, backend="databricks_sql")
- Warehouses. Serverless SQL warehouses and Lakehouse RT. ProGraph reads which kind it is connected to when the engine starts, and the rewrites whose gain depends on the engine run only on the kinds where they were timed faster. On Lakehouse RT, install the
databricks-rtextra. - Tables. Unity Catalog names (
catalog.schema.table) in the mapping. ProGraph reads the tables in place. - Runs as the user. In a notebook or your own code, ProGraph uses whatever connection you give it, so it runs as you. As a shared server on a Databricks App,
prograph serve(and--mcp) runs every request as the signed-in user (on-behalf-of-user authorization): each user gets their own engine and connection, and Unity Catalog applies their grants, row filters and column masks, with the person in the audit log. Off an App,prograph serve --per-userdoes the same with each request's bearer token. - Keys. ProGraph reads primary keys declared
RELYand uses them to drop joins and duplicate checks that can't change the answer. Lakehouse RT doesn't reportRELY: there, declare keys in the mapping (keys: trusted). Declaring your keys is the single biggest performance step. - Reasoning. OWL 2 QL works on every warehouse. OWL 2 RL writes its facts to ProGraph's own Delta tables; that is checked on a serverless SQL warehouse, not yet on Lakehouse RT.
- Every statement accounted for.
engine.startup_statementslists what building the engine sent to the warehouse, andengine.last_statementswhat the last query sent, each with its purpose and time (the query by a fingerprint, never its text). - Agents and Genie. The MCP server's
asktool turns a question into SPARQL or Cypher, runs it, and retries on an error. A Genie integration is included (genieextra).
Reasoning
Pass an ontology, and reasoning is on:
from prograph.ontology import OntologyLayer
from prograph.store import Store
model = OntologyLayer.from_owl("model.ttl")
engine = ProGraph.from_config("graph.yaml", connection=con, ontology=model) # OWL 2 QL
engine = ProGraph.from_config("graph.yaml", connection=con, ontology=model,
profile="rl", store=Store(con)) # OWL 2 RL
| SPARQL | Cypher | |
|---|---|---|
| RDFS core (subclass, sub-property, domain, range) | yes, always on with an ontology | yes: inferred labels, relationship types and property keys |
OWL 2 QL (profile="ql", the default), by rewriting |
every QL axiom: inverses, symmetric and reflexive properties, existentials, owl:Thing, … |
hierarchies, domain and range, inverse and symmetric properties, owl:Thing |
OWL 2 RL (profile="rl"), materialised into ProGraph's store |
yes, with owl:sameAs |
yes: derived labels, relationships and properties; one node per owl:sameAs entity |
| Consistency checks | yes: contradictions raise InconsistentOntologyError, or are reported |
the same engine checks |
On the W3C tests: the OWL 2 QL positive entailment tests all pass (19 of 19), the OWL 2 RL inconsistency tests all raise (14 of 14), and the SPARQL entailment tests of the RDF and RDFS regimes all pass (58 of 58).
owl:imports is read from local files only. See Use an ontology and OWL 2 RL.
Backends
| Backend | Extra | Checked |
|---|---|---|
| Databricks SQL warehouse, Lakehouse RT | databricks, databricks-rt |
every release |
| DuckDB, over a database or pandas DataFrames | duckdb |
every release |
| Spark (a SparkSession, with Delta Lake) | spark |
every release |
| PostgreSQL (and Lakebase) | postgresql |
every release |
| Oracle, SQL Server, MySQL 8.0+ | oracle; none (install pyodbc and ODBC Driver 18, or mysql-connector-python) |
at milestones; Cypher unchecked |
"Every release": a release is tagged only on a commit whose nightly run (the SPARQL corpus and the Cypher TCK on these backends, Lakehouse RT included) is clean. "At milestones": checked at each milestone, and a fault found only there is fixed after the others. See what differs by backend.
Know before you start
- Keys. Cypher trusts a node mapping's key by default (one row per key value);
check_keys=Truechecks keys in every query, andkeys: checkchecks a mapping's key once per version of a versioned source (Delta, DataFrames). SPARQL removes duplicates unless keys are declared, as the standard's set semantics require. Declaring keys is the main performance advice for both. - Read-only. ProGraph answers queries; it doesn't update your tables (unless a mapping is marked
mutable). CypherCREATE,MERGEandSETwrite only to ProGraph's own store (store=). - Cypher needs a YAML mapping. An R2RML mapping serves SPARQL, with OWL 2 QL or RL and SHACL; Cypher needs YAML.
- No table statistics in planning. ProGraph applies only rewrites proven safe, and leaves join order to your database. A few query shapes stay costly on large tables by nature; Make queries fast lists them.
- Young. 1.0 shipped in November 2026.
More
- Documentation and How ProGraph works
- llms.txt, a reference for LLMs and agents
- Changelog
- Licence: Apache-2.0
Metadata
Release files for prograph 1.4.2
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 |
|---|---|---|---|---|
| prograph-1.4.2.tar.gz | 1.6 MB | Without provenance | Details for prograph-1.4.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| prograph-1.4.2-py3-none-any.whl | Python 3 | none | any | Details for prograph-1.4.2-py3-none-any.whl |
Total release size: 3.2 MB
Release files / prograph-1.4.2.tar.gz
| Download URL | prograph-1.4.2.tar.gz |
|---|---|
| Size | 1.6 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ec6dd985bba20f57b5d510aa5af924ed65aca36c54538204026bd4362ab2bd74
|
|
BLAKE2b-256 checksum How to use checksums |
26ca05437ccffb578769998c63f60b0a86674059d99fdee6fa0d2dd873deb035
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.12.16
|
Release files / prograph-1.4.2-py3-none-any.whl
| Download URL | prograph-1.4.2-py3-none-any.whl |
|---|---|
| Size | 1.6 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a2caacf300a054fa71581a6d128813d1f06355c9b43550b07bc901bf21a8f3e8
|
|
BLAKE2b-256 checksum How to use checksums |
eb0bfb1825cefb59261b5003853914a66b39b2dbea973fbce2503b798d1dd5a2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.12.16
|
Security for prograph 1.4.2
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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A 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.