Showing results for 
Search instead for 
Did you mean: 

Head's Up! Site migration is underway. Pause, resolving how to handle anonymous content

Project graph from Neo4j with GraphDataScience Python library

So I have a graph of nodes -- "Papers" and relationships -- "Citations".
Nodes have properties: "x", a list with 0/1 entries corresponding to whether a word is present in the paper or not, and "y" an integer label (one of the classes from 0-6).

I want to project the graph from Neo4j using GraphDataScience.
I've been using this documentation and I indeed managed to project the nodes and vertices of the graph:


from graphdatascience import GraphDataScience

AURA_CONNECTION_URI = "neo4j+s://"
AURA_PASSWORD = "my_code:)"

### Client instantiation
gds = GraphDataScience(

### Shorthand projection --works
shorthand_graph, result = gds.graph.project(

When I do print(result) it shows

nodeProjection {'Paper': {'label': 'Paper', 'properties': {}}}
relationshipProjection {'Citation': {'orientation': 'NATURAL', 'aggre...
graphName short-example-graph
nodeCount 2708
relationshipCount 10556
projectMillis 34
Name: 0, dtype: object

However, no properties of the nodes are projected. I then use the extended syntax as described in the documentation:

### Project a graph using the extended syntax
extended_form_graph, result = gds.graph.project(
    {'Paper': {"properties": "x"}},


I get the error:
ClientError: {code: Neo.ClientError.Procedure.ProcedureCallFailed} {message: Failed to invoke procedure gds.graph.project: Caused by: java.lang.UnsupportedOperationException: Loading of values of type String is currently not supported}

Also, note that all my properties are integers in the Neo4j db (in AuraDS), so that the error that String properties are not supported does not make sense to me.

Some clarification on the correct way of projecting node features (aka properties) would be very useful.

thank you,


Hello @doris.voina ,
Your graph looks a lot like the Cora dataset

The error message is likely correct, that at least one of your nodes has the property x of type string instead of a number.
You can check this by using

MATCH (t:Paper)
WHERE t.x = toString(t.x)
RETURN count(t);

If the count is >0, you can convert the properties using

MATCH (t:Paper)
Set t.x = toFloat(t.x)
RETURN count(t);