Failed to invoke procedure `gds.graph.project`: Caused by: java.lang.UnsupportedOperationException: Loading of values of type String is currently not supported

  • which OS do you use? Win 11
  • neo4j version, desktop version, browser version: Latest Freely available
  • what kind of API / driver do you use: Direct in Neo4J Browser
  • Plugins: Graph Data Science Library.

My data available in a csv:

scene_id,obj_type,lane
1,1,1
1,2,3
2,3,2
3,4,1
3,1,3
4,1,2
4,3,1
5,2,2
6,4,3
6,3,1
6,1,2

Query in Cypher for loading and creating nodes:

LOAD CSV WITH HEADERS FROM 'file:///modified_data.csv' AS row

MERGE (image:Image {scene_id: toFloat(row['scene_id'])})

MERGE (object:Object {obj_type: toFloat(row['obj_type'])})

MERGE (lane:Lane {direction: toFloat(row['lane'])})

MERGE (image)-[:CONTAINS]->(object)

MERGE (object)-[:IN_LANE]->(lane)

Query for graph projection which is causing the error:

CALL gds.graph.project(
'imgraph1',
{
Image: {properties: 'scene_id},
Object: {properties: 'obj_type'},
Lane: {properties: 'direction'}
},
['CONTAINS', 'IN_LANE']
)

Error:
Failed to invoke procedure gds.graph.project: Caused by: java.lang.UnsupportedOperationException: Loading of values of type String is currently not supported

Your import doesn’t create an age property for
Image nodes, nor does it set a lane property for Lane nodes. Are you setting these in another query or through daily operations?

If they are and exist, are they either an integer or float value, or lists of either.

The documentation states the projected properties must exist in the database.

thank you, there were typos in putting up the question, and now the corrected question. the problem persists

Is it possible you have other nodes created outside the import with string values for those properties. From what I read in the manual, the property types are determined from the first node loaded in the projection.

Try running this query to see if you get any results.

MATCH (n:Image|Object|Lane)
WHERE n.scene_id IS :: STRING or n.obj_type IS :: STRING or n.direction IS :: STRING 
return n
1 Like

Many thanks, that actually gives results as the following (couldn't upload the graph image:
╒═════════════════════════╕
β”‚n β”‚
β•žβ•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•‘
β”‚(:Image {scene_id: 1.0}) β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚(:Image {scene_id: 2.0}) β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚(:Image {scene_id: 3.0}) β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚(:Image {scene_id: 4.0}) β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚(:Image {scene_id: 5.0}) β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚(:Image {scene_id: 6.0}) β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚(:Object {obj_type: 1.0})β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚(:Object {obj_type: 2.0})β”‚
------- so on

Now I am working on next steps and the node properties are unable to be fetched for embeddings. I show below the code and the outputs:

CALL gds.graph.project(
'imgraph1', // Name of the in-memory graph
{
Image: {properties:'scene_id'},
Object: {properties:'obj_type'},
Lane: {properties:'direction'}
},
{
CONTAINS: { type: 'CONTAINS', orientation: 'NATURAL' },
IN_LANE: { type: 'IN_LANE', orientation: 'NATURAL' }
}
)
YIELD
graphName AS graph,
nodeCount AS nodes,
relationshipCount AS rels,
nodeProjection AS nod

The output of the query given above seems fine:
Graph Name: imgraph1
Node Count: 13
Relationship Count: 20
nodeProjection: {'Lane': {'label': 'Lane', 'properties': {'direction': {'property': 'direction', 'defaultValue': None}}}, 'Image': {'label': 'Image', 'properties': {'scene_id': {'property': 'scene_id', 'defaultValue': None}}}, 'Object': {'label': 'Object', 'properties': {'obj_type': {'property': 'obj_type', 'defaultValue': None}}}}

Now, comes the embeddings query:

CALL gds.fastRP.mutate('imgraph1', {
embeddingDimension: 64,
featureProperties : ['scene_id', 'obj_type','direction'],
iterationWeights: [0.1, 0.1, 0.1, 0.1, 0.1, 0.5],
mutateProperty: 'embedding'

})
YIELD nodePropertiesWritten

And for this query, I am getting the following error:

Failed to invoke procedure gds.fastRP.mutate: Caused by: java.lang.IllegalArgumentException: The feature properties ['direction', 'obj_type', 'scene_id'] are not present for all requested labels. Requested labels: ['Image', 'Lane', 'Object']. Properties available on all requested labels:

You have entities that do not have string values. I reread the documentation more closely. I did not realize until then that a null value will return true the type predicates. You should run this query:

MATCH (n:Image|Object|Lane)
WHERE 
    n.scene_id IS :: STRING NOT NULL
    or n.obj_type IS :: STRING NOT NULL 
    or n.direction IS :: STRING NOT NULL
return n
1 Like

I sounds like you can't have null values for these properties used in the embedding. If true, you can modify your project to include default values for each of the properties. It also looks like you need the properties for all the labels. You can try projecting like this:

CALL gds.graph.project(
'imgraph3', // Name of the in-memory graph
{
Image: {properties:{scene_id:{defaultValue:0.0},obj_type:{defaultValue:0.0},direction:{defaultValue:0.0}}},
Object: {properties:{scene_id:{defaultValue:0.0},obj_type:{defaultValue:0.0},direction:{defaultValue:0.0}}},
Lane: {properties:{scene_id:{defaultValue:0.0},obj_type:{defaultValue:0.0},direction:{defaultValue:0.0}}}
},
{
CONTAINS: { type: 'CONTAINS', orientation: 'NATURAL' },
IN_LANE: { type: 'IN_LANE', orientation: 'NATURAL' }
}
)
YIELD
graphName AS graph,
nodeCount AS nodes,
relationshipCount AS rels,
nodeProjection AS nod

I am not a user of GDS. Maybe a community member that is can provide more insight.

1 Like

Many thanks for your time @glilienfield, I don't have any issue of null values, the data is small and easy to inspect as I shared in the beginning of my question.
The issue I am facing as you can see form my previous post is that the "properties" are taken in alright in the "projection" step but they seem to be unavailable when called for the embedding step.
Is there anyway to contact Neo4j for help on this?

It’s not that you have null values for the data provided, such as scene_id for Image nodes, and object_type for Object nodes, and direction for Lane nodes. These you have provided.

The message you get when trying for invoke the fastRP procedure states β€œthe feature properties are not present for all requested labels.” This means you don’t have direction values for Image and Object nodes, you don’t have obj_type values for Image and Lane nodes, and you don’t have values for scene_id values for Lane and Object nodes. In short, it seems like each label type needs values for all the properties, not just the one associated with its label.

I confirmed this by creating some data like yours, projecting it, and calling the fastRP procedure. I got a similar message. I then changed my projection to set a default value for each of the properties for each of the labels. This guaranteed each label had values for all the properties. The fastRP procedure then executed without an error.

I provided in my last post a modified projection of your data that sets default values for each of your three properties for each of the labels being projected. Maybe try it to see if the error does not result when you execute fastRP.

Do you have a paid licenses that comes with support? Sometimes Neo4j staff respond to messages. Let me see if I can get someone to provide more insight to your issue.

2 Likes

@mshahidch ,

FastRP expects all nodes to have the specified featureProperties. The algorithm does not consider different types of labels, i.e., it ignores any label information.
As each label has one property, the error message states, that the common properties across all labels is [].
For the future, you can also verify the graph schema through, CALL gds.graph.list('imgraph1').

The best solution for this limitation is as Gary suggested to specify default-values during projection.
Looking at your labels, I would also suggest to load the graph undirected (following Fast Random Projection - Neo4j Graph Data Science).

Hope I could

As a side-note, the node label limitation is also indicated by the trait at the top of the FastRP docs. ( Heterogeneous nodes allowed. The algorithm treats all selected nodes similarly regardless of their label.).

2 Likes

This suggestion actually removed the error. So kind of you @glilienfield for your time and effort.

1 Like

Many thanks @florentin_dorre , great suggestions!

1 Like

The out put of "MATCH (n) return n" looks like the following:
{
"identity": 4140,
"labels": [
"Image"
],
"properties": {
"scene_id": 1.0
},
"elementId": "4:2322d89d-7f6e-4423-ab05-f31a9538d86d:4140"
}

I tried the following to get the "identity " values out but it returns null.

  1. MATCH (n) RETURN n.elementId
  2. MATCH (n) RETURN n.identity

The graph was made using the following query:
LOAD CSV WITH HEADERS FROM 'file:///modified_data.csv' AS row

MERGE (image:Image {scene_id: toFloat(row['scene_id'])})

MERGE (object:Object {obj_type: toFloat(row['obj_type'])})

MERGE (lane:Lane {direction: toFloat(row['lane'])})

MERGE (image)-[:CONTAINS]->(object)

MERGE (object)-[:IN_LANE]->(lane)

Try these instead:

MATCH (n) RETURN elementId(n)
MATCH (n) RETURN id(n)
1 Like