2

I’m starting a new project that will provide geographic data through a read-only GraphQL api. The proposed technology stack currently consists of:

  • Neo4J
  • Python 3.6
  • Flask
  • Graphene

Where I’m having trouble is deciding on which driver to use: The Neo4J Bolt driver, or Py2neo.

To flesh out my requirements:

  • I don’t really need to do any geographic queries per se as most of the relationships are based on keywords. However, spatial queries would be a nice to have in the future.
  • I do need to recognize spatial data types (points, polygons, line strings) so I can convert them to geojson.
  • The driver needs to integrate well with Graphene to handle my GraphQL queries and content.
  • Working with SQLAlchemy would be a bonus.

The confusing thing is sorting out what the spatial support is for these drivers. Py2neo mentions spatial in the v2 docs, but not in the v4 docs. The Neo4J Bolt Driver, mentions point types but no polygon or line types. And various other posts about Py2neo say that it has a more extensive api. Which one to choose?

And just to through one in from left field, I’d be open to a Golang solution, but that driver seems to be dead at this stage.

geoAndrew
  • 347
  • 1
  • 12

1 Answers1

0

In terms of which Python driver to use, I think the best option is to stick with the officially supported Neo4j Python driver to be sure you can leverage the latest updates and compatibility: https://github.com/neo4j/neo4j-python-driver

You may also want to consider the Neo4j GraphQL Library, which is a JavaScript/Node.js library for building GraphQL APIs backed by Neo4j. The Neo4j GraphQL Library supports spatial functionality, based on Neo4j's native Point data type. See docs here: https://neo4j.com/docs/graphql-manual/current/type-definitions/types/#type-definitions-types-spatial

William Lyon
  • 8,371
  • 1
  • 17
  • 22