Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
10-18-2019 12:38 PM
I'm trying to run " Link Prediction Toy Problem - Neo4J & SciKit-Learn". I have this query for the author/coauthor data:
query='''
MATCH (a1)<-[:AUTHOR]-(paper)-[:AUTHOR]->(a2:Author)
WITH a1, a2, paper
ORDER BY a1, paper.year
WITH a1, a2, collect(paper)[0].year as year, count(*) as collaborations
MERGE (a1)-[coauthor:CO_AUTHOR {year: year}]-(a2)
SET coauthor.collaborations=collaborations;
'''
When I try to run:
#run the query on the graph
coauthorGraph.run(query);
I get this error:
'NoneType' object has no attribute 'split'
If I run the query in the Neo4j browser, it works fine. So I think the data is set up OK. It's just when I run it in Jupyter Notebook that I get this error. Help!
Solved! Go to Solution.
10-18-2019 12:43 PM
Problem solved! in the line:
coauthorGraph=Graph(uri, auth=("neo4j","password"))
I had the graph name instead of the neo4j user name. When I changed it, it worked right away.
10-18-2019 12:43 PM
Problem solved! in the line:
coauthorGraph=Graph(uri, auth=("neo4j","password"))
I had the graph name instead of the neo4j user name. When I changed it, it worked right away.
01-18-2021 11:17 AM
It seems like there should be better error handling...
The code where this error occurred should check for Python None
and act accordingly.
01-18-2021 01:20 AM
The AttributeError is an exception thrown when an object does not have the attribute you tried to access. 'NoneType' object has no attribute 'split' often indicates that the attribute you are trying to split is Null, meaning there is no value in it to split. So, you need to check the attribute is not Null before splitting. Something like..
if val is not None:
# ...
All the sessions of the conference are now available online