Skip to content

Commit

Permalink
Merge pull request #1 from smokhov/Movies
Browse files Browse the repository at this point in the history
sync Movies and master from Carlos
  • Loading branch information
smokhov authored Aug 18, 2024
2 parents 01d42a7 + b31394e commit 317b931
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/OpenISS_RS/InfoExtractor/IMDBExtractor.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ def imdb_extractor(dict_tmp,path):
for star in IMDB_e.stars:
result += str(movie_name) + "\t" + "stars" + "\t" + str(star) + "\n"
# print(result)
f = open("../../../data/movie/kg_additional2.txt", "a")
f = open("../../../data/movie/kg_additional.txt", "a")
f.write(result)
f.close()

Expand Down
8 changes: 5 additions & 3 deletions src/OpenISS_RS/knowledge_graph/Neo4jManager.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
import pandas as pd
import datetime

graph = Graph('http://localhost:7474', username='neo4j', password='0905')
username = 'neo4j'
password = 'neo4neo'
graph = Graph('http://localhost:7474', auth=(username, password))

class storage_mode():

Expand Down Expand Up @@ -231,8 +233,8 @@ def Storage_neo4j(parameter):

elif i == "movie_info":
print("movie_info")
# kg_sideinforamtion_path = "../../data/movie/kg_additional.txt"
# storage_m.movie_director(kg_sideinforamtion_path)
kg_sideinforamtion_path = "../../../data/movie/kg_additional.txt"
storage_m.movie_director('a',kg_sideinforamtion_path)

#
# from RDFManager import Storage_rdf
Expand Down
8 changes: 5 additions & 3 deletions src/OpenISS_RS/knowledge_graph/add_triples_neo4j.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ def find_node_name(name,username,password):
return True
"""
# graph = Graph('http://localhost:7474', username= username, password=password)
graph = Graph(host="localhost", auth=(username, password))
# graph = Graph(host="localhost", auth=(username, password))
graph = Graph("bolt://localhost:7687", auth=(username, password))
matcher = NodeMatcher(graph)
result = matcher.match(name=name).first()
# print(result)
Expand All @@ -23,7 +24,8 @@ def add_triples(triples,username,password):
password: Neo4j password
"""
# graph = Graph('http://localhost:7474', username=username, password=password)
graph = Graph(host="localhost", auth=(username, password))
# graph = Graph(host="localhost", auth=(username, password))
graph = Graph("bolt://localhost:7687", auth=(username, password))
for i in triples:
head = i[0]
relation = i[1]
Expand Down Expand Up @@ -55,6 +57,6 @@ def add_triples(triples,username,password):
# ['Jon_Favreau', 'director', 'Iron_Man_(2008)']
# ['star_A', 'star', 'Ahí_va_el_diablo']

add_triples(triples,"neo4j","0905")
add_triples(triples,"neo4j","neo4neo")


0 comments on commit 317b931

Please sign in to comment.