Prism is the binary query interface used by Polypheny’s drivers. It carries Protocol Buffer messages over TCP or a Unix domain socket. Each statement specifies its query language, such as SQL, MongoQL, or Cypher. Results can contain relational rows, documents, graph elements, or an update count.
Connect a driver
Choose a driver that supports the Prism API version and features of your server. Drivers expose the query languages and result types they support. JDBC graph results guide
In the Polypheny web UI, open Interfaces and check that Prism Interface (Plain transport) is running. For a local connection, use 127.0.0.1:20590 unless the interface was configured with a different TCP port. Use the credentials of a Polypheny user. A fresh local installation has a pa user with an empty password.
The plain TCP transport sends credentials and query data without encryption. Keep it on a trusted network or tunnel remote traffic through an encrypted connection. Clients that support Unix sockets can connect to Prism Interface (Unix transport) using the configured .sock path.
Protocol compatibility
The server checks the API major version when a client connects and reports its major and minor version. A connection can succeed while a feature still requires a newer minor version. Prism API releases
| Server or protocol version | Compatibility |
|---|---|
| Polypheny-DB 0.10.1 | Uses Prism 1.9 and requires a Prism 1.x client. |
| Prism 2.2 | Carries document collection metadata in the entity listing response. |
| Prism 2.3 | Encodes graph values in tabular result cells. A compatible client can request tabular Cypher graph results. |
| Prism 2.4 | Allows servers to add a SQLSTATE and numeric error code to an error response. Older clients can still read the original error text. Error responses |
Cypher over Prism
Check your running server’s version before using Cypher through Prism. You can execute a query directly or prepare it with named parameters for value expressions. A graph-only projection streams a flat graph result by default. With Prism 2.3 support on both peers, choose tabular graph results to keep rows, columns and typed paths. Graph result formats
Fetch result pages from the same statement handle. When a Cypher cursor is open in auto-commit mode, finish or close it before executing another statement on the session. Prepared Cypher example · Result lifetime
Querying and metadata
Metadata requests list namespaces and their entities. For document collections, entity metadata includes observed field paths and types, an optional sample document, and available index information. The Python and JDBC examples show how to request metadata from a running server. Python · JDBC
For the message definitions, see the Prism protocol reference. For transport framing and a runnable client example, see Developing with the Prism API.
Troubleshoot a connection
- If the connection is refused, check the configured Prism listener, TCP port, and any container port mapping.
- If authentication fails, check the Polypheny username and password or the local socket user.
- If the server reports an incompatible API version, use a driver that supports the server’s Prism major version.
Acknowledgments
Tobias Hafner developed the initial Prism interface as part of his bachelor’s thesis at the University of Basel.