Import using cypher- what's wrong here?

julia_choi
Node

Hi, I wonder why The result is wrong.
I did redo all challenges for this mission(Import using cypher) But The error message repeatedly. T^T

27 REPLIES 27

The verification of this Challenge has a problem that we are in the process of fixing. If your import is correct, this code should return true which we will correct in the course:

call apoc.meta.stats() yield labelCount, relTypeCount, propertyKeyCount, nodeCount, relCount
with labelCount, relTypeCount, propertyKeyCount, nodeCount, relCount
return labelCount + relTypeCount + propertyKeyCount + nodeCount + relCount = 195158 as outcome

Elaine

When I run your code, it returns False. Which one is right? 195160 or 195158? Please help me, I cannot complete the course. Thank you.

venkat1
Node Link

when I run the above query, I get 195160, and not 195158. I did it twice, is this right?

Hello @venkat1 and @yoga.yustiawan and Welcome to the Neo4j Community!

Did you delete all nodes and relationships at the beginning of the Challenge?

Do you have exactly 4 constraints defined?

Elaine

Hi Elaine,

I had same trouble as others. Resolved by using a new Blank Sandbox, adding these four constraints:

CREATE CONSTRAINT User_userId ON (x:User) ASSERT x.userId IS UNIQUE;
CREATE CONSTRAINT Person_tmdbId ON (x:Person) ASSERT x.tmdbId IS UNIQUE;
CREATE CONSTRAINT Movie_movieId ON (x:Movie) ASSERT x.movieId IS UNIQUE;
CREATE CONSTRAINT Genre_name ON (x:Genre) ASSERT x.name IS UNIQUE ;

And then pushed through "Run in Sandbox" (and with a second test, own copy-pasted Cypher).

PASSED

After adding the first batch (Movie) nodes, outcome cypher script should produce 29508.

Regards,
Cliff

PS. Thank you so much for GraphAcademy. Looking very much to getting Certified.

Congratulations!

We are updating the course to show the constraints you should have in the graph before the import.

Thank you all for your feedback so we can improve the course.

Elaine

Hello,

It seems there is still a problem in the course exercise.

Does the "'https://data.neo4j.com/importing/2-movieData.csv'" file have been updated to include more properties ?

Because the first step that asks to create the Movie and Genre nodes has not the expected result as you can see on the screenshot below. Consequently, it is not possible to end the challenge and the course with a successfull check.

venkat1
Node Link

Thanks for the follow-up, Elaine.

This is what I get, for a total of 195160.
{'labelCount': 6, 'relTypeCount': 4, 'propertyKeyCount': 26, 'nodeCount': 28863, 'relCount': 166261}

I did it twice, for the same result. (BTW, I cheated, dropped a couple of relations to pass the test, in case you notice, I have successfully completed it.)

venkat1
Node Link

Thanks, Cliff. Did you have to drop the prev constraints? or just creating them was sufficient?

Hello @aymeric.lebrun,

Thank you for pointing out this error in the content. Your number is correct. We will update the course.

Elaine

Hello @elaine.rosenberg ,

There is the same problem with the query that insert the person nodes but for the others it is ok.

Hey @elaine.rosenberg

I'm having the same issue with Movie property count. It's as @aymeric.lebrun mentioned

Is there a temporary workaround that would allow us to pass until it's permanently fixed? I tried dropping some properties and it didn't work

Thank you

Hello,
The training documentation has not yet been updated but I tried it again yesterday and it seems the check at the end is ok now because I was able to end the training successfully.

If you follow all of the steps of the challenge, you should get these results when you execute this code:

CALL apoc.meta.stats() Yield labelCount, relTypeCount, propertyKeyCount, nodeCount, relCount
WITH labelCount, relTypeCount, propertyKeyCount, nodeCount, relCount
RETURN labelCount, relTypeCount ,propertyKeyCount ,nodeCount ,relCount, labelCount + relTypeCount + propertyKeyCount + nodeCount + relCount AS total

Result:

labelCount,relTypeCount,propertyKeyCount,nodeCount,relCount,total
6,4,24,28863,166261,195158

Elaine

Thanks for your reply

I believe I did follow all the steps. I also made sure to delete everything before retrying. Here are my results:

labelCount, relTypeCount, propertyKeyCount, nodeCount, relCount, total
6, 4, 26, 28863, 166261, 195160

Not sure where it's getting the extra. I think @venkat1 had the exact same numbers

For some reason, you have 2 extra property keys in your graph.

If you execute:

CALL db.propertyKeys() YIELD propertyKey
WITH collect(propertyKey) as Keys
RETURN apoc.coll.sort(Keys) AS Sorted Keys

It should return:
["born", "bornIn", "budget", "countries", "died", "imdbId", "imdbRating", "imdbVotes", "languages", "movieId", "name", "plot", "poster", "rating", "released", "revenue", "role", "runtime", "timestamp", "title", "tmdbId", "url", "userId", "year"]

Elaine

Thanks, Elaine

The 2 extra property keys on my end are "bio" and "genres". Genres should have been split and then removed (the code provided doesn't remove it). I tried setting them to null and it still returns them when I get the property keys using the code you provided

We've discovered the problem. We use a propertyKey count to total objects in the graph to verify this Challenge in the course. Unfortunately, we discovered that even though the propertyKey no longer exists for any nodes, it still remains in the graph.

We will be correcting this validation of this Challenge in the course that caused problems for some folks who did not start with a fresh sandbox.

We do apologize for this inconvenience.

Elaine

Yes, I can confirm that

Thanks, Elaine. Much appreciated

Hi @elaine.rosenberg!

I need some help. I ran the 7 steps, but the validation won't work.

When I show the constraints, I can see that there are 5 instead of 4. There is a "Movies" label, which seems redundant. Is it possible that that is the problem? How can I get rid of that extra constraint?

Thanks in advance!

DROP CONSTRAINT constraint_5cc7b9fa

will delete the constraint.

Elaine

Still having the same troubles as those above--even after running the solution code, I am told that I've failed.

I also tried the beta, and was blocked from proceeding by a database-related window.

I have now spent 3 days on this single problem. I'd love a little help.

suvi
Node Link

@vang37 

just delete the existing database. Create a new blank database on sandbox then start with setting the constraints and other loading the csv steps.
Worked for me. 👍👍👍

Ladislav
Node

Hello. I'm at a loss at the last step of the CSV Importing course. I've read the previous comments and managed to get the following results:

6 4 24 28863 166261 195158

For 

CALL apoc.meta.stats() Yield labelCount, relTypeCount, propertyKeyCount, nodeCount, relCount
WITH labelCount, relTypeCount, propertyKeyCount, nodeCount, relCount
RETURN labelCount, relTypeCount ,propertyKeyCount ,nodeCount ,relCount, labelCount + relTypeCount + propertyKeyCount + nodeCount + relCount AS total

The check at the end of the course still says it's invalid. I tried to create a new sandbox and run everything again and still failure. As a last try, I ran the code provided in the Solution by the GraphAcademy and the check still fails... So I'm really not sure what's the problem anymore and how I could finish my course.

The course has been fixed so that the imports should verify. 

We apologize for the inconvenience.
There is one piece of remaining code that will not compile. We will fix this in the next deploy tomorrow, but if you run this code to load the User ratings in the last Challenge of the course, the correct code is:

:auto USING PERIODIC COMMIT
LOAD CSV WITH HEADERS
FROM 'https://data.neo4j.com/importing/2-ratingData.csv'
AS row
MATCH (m:Movie {movieId: toInteger(row.movieId)})
MERGE (u:User {userId: toInteger(row.userId)})
ON CREATE SET u.name = row.name
MERGE (u)-[r:RATED]->(m)
ON CREATE SET r.rating = toInteger(row.rating),
r.timestamp = toInteger(row.timestamp)

 

@elaine_rosenber  you guys are awesome. I did not expect a reply this soon but with this I could finish my course. Very much appreciated!

What I would suggest is to separate the DETACH DELETE commands by node types. If the MATCH (n) DETACH DELETE n is run after someone imported most of the data but messed up somewhere then after some runtime it will throw a memory error.

What I did in my many attempts of the last challenge:

MATCH (g:Genre) DETACH DELETE g;
MATCH (u:User) DETACH DELETE u;
MATCH (p:Person) DETACH DELETE p;
MATCH (m:Movie) DETACH DELETE m;
 
Maybe it's an overkill but I could clean up my DB without problems with this.
 
Anyway, thank you for your swiftness and I'm onto my Intermediate Cypher Queries course! 🙂
 

Good suggestion @Ladislav !