#!pip install py2neo==4.1.3 pandas matplotlib sklearn
from py2neo import Graph
import pandas as pd
# Change the line of code below to use the IP Address, Bolt Port, and Password of your Sandbox.
# graph = Graph("bolt://<IP Address>:<Bolt Port>", auth=("neo4j", "<Password>"))
graph = Graph("bolt://18.207.236.58:35753", auth=("neo4j", "<password>"))
# finding popular authors
popular_authors_query = """
MATCH (author:Author)<-[rel:AUTHOR]-()
RETURN author.name AS authorName, count(rel) AS articlesPublished
ORDER BY articlesPublished DESC
LIMIT 10
"""
for k_v in graph.run(popular_authors_query).data():
print(k_v)
print("=="*30)
{'authorName': 'Peter G. Neumann', 'articlesPublished': 89}
{'authorName': 'Peter J. Denning', 'articlesPublished': 80}
{'authorName': 'Moshe Y. Vardi', 'articlesPublished': 72}
{'authorName': 'Pamela Samuelson', 'articlesPublished': 71}
{'authorName': 'Bart Preneel', 'articlesPublished': 65}
{'authorName': 'Vinton G. Cerf', 'articlesPublished': 56}
{'authorName': 'Barry W. Boehm', 'articlesPublished': 53}
{'authorName': 'Mark Guzdial', 'articlesPublished': 49}
{'authorName': 'Edwin R. Hancock', 'articlesPublished': 47}
{'authorName': 'Josef Kittler', 'articlesPublished': 46}
댓글남기기