Querying Neo4j from Microsoft Excel for macOS — via ODBC using Cypher

Daniel Heward-Mills
Neo4j Developer Blog
4 min readNov 25, 2020

This post describes how to interact with a Neo4j Database Instance, using its Cypher Query Language, from Microsoft Excel running on macOS.

The Open Source JDBC driver for Neo4j enables Java applications to interact with Neo4j instances using the Cypher query language. This driver is different from the Neo4j BI Connector, which uses the SQL-92 query language.

OpenLink Software’s ODBC-JDBC Bridge Driver extends interactivity from JDBC Drivers such as Neo4j’s, to ODBC-compliant applications such as Excel; without needing to create additional scripts or add-ins.

Prerequisites

Basic Cypher Test Query

I used the movies sample database for this demonstration. The query that will be used in Excel is:

MATCH (n:Person)-[p:ACTED_IN]->(f:Movie)
RETURN n.name as name,
n.born as born,
f.name as movie,
f.released as released

A quick test of the query was run from Neo4j Desktop to ensure that the correct data will be returned in Excel.

Success. We’re now ready to configure OpenLink’s ODBC-JDBC Bridge Driver to work with the Neo4j JDBC Driver.

ODBC Setup and Configuration

Open the iODBC Administrator application included with your ODBC-JDBC Bridge application, click Add, and type in a Data Source Name (DSN).

Click Continue and add the org.neo4j.jdbc.Driver Class Name for the Neo4j JDBC Driver, and the Connection URL for accessing your Neo4j instance.

My JDBC connection URL uses the HTTP protocol. HTTPS should work if enabled server-side and supported by the Open Source JDBC driver:

{jdbc:neo4j:http://localhost:7474?username=demo&password=demo}

The ODBC-JDBC Bridge doesn’t currently support Bolt connections from the Open Source JDBC driver, but can do so with Neo4j’s JDBC BI Connector (Guide) .

Click on the Test tab, and then click on Finish.

Confirm that your data source has been added. Once confirmed, it’s time to open Excel .

Querying Data from Excel

Open or create a new workbook and click on New Database Query -> From Database

Select your ODBC DSN and click OK

Enter the username and password used in your JDBC connection URL, and click Connect.

Click Connect, add your Cypher query, and click Run. Query results will be populated in tabular form, and can be returned to your Excel workbook.

Click Return Data, and select a location for your data to be added into.

Data from your Neo4j instance has been successfully queried from and returned to Excel 🎉 .

Related Content

--

--