0

I have a simple graph that looks like this (a couple of persons that gave reviews to movies)

(p: Person)-[r: review {rating}]->(m: Movie)

I want to create a graph accordantly the exemple from GDS Node Similarity and I use this:

 CALL gds.graph.create(
    'myGraph',
    ['Person', 'Movie'],
    {
        review: {
            type: 'review',
            properties: {
                rating: {
                    property: 'rating',
                    defaultValue: 1.0
                }
            }
        }
    }
);

When I try this I get the next exception:

Failed to invoke procedure `gds.graph.create`: Caused by: java.lang.IllegalArgumentException: Unsupported type [TEXT] of value String("4"). Please use a numeric property.

I can't find any useful information in the logs why I'm getting this exception. Any ideas about what I'm doing wrong?

1 Answer 1

1

The problem is that the "rating" property is stored as a string. What you can do is cast it first as a float and then run the exact same GDS query.

So, first casting the rating property to a float:

MATCH ()-[r:review]->()
SET r.rating = toFloat(r.rating)

Now rerun the same GDS query and it should work.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.