Elffuss BraidHub

kikocis/GraphRAG-SDK public

update github example
Changeset3e2e7f5f23d2614e4c67046edefd5c2481159ff34605a44a36b7e263f14d6091
AuthorRoi Lipman <roilipman@gmail.com> · 2024-06-08 00:29 +03:00
CommitterRoi Lipman <roilipman@gmail.com> · 2024-06-08 00:29 +03:00
Parents3034d86cfbbe

Browse the files at this changeset

1 file changed

modified examples/github.py +9 −11
@@ -8,7 +8,7 @@
88 handler = logging.StreamHandler()
99 handler.setFormatter(logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s'))
1010 logger.addHandler(handler)
11-logger.setLevel(logging.INFO)
11+logger.setLevel(logging.DEBUG)
1212
1313 def main():
1414 # Manually define schema
@@ -55,19 +55,15 @@
5555 # 2. (Repository)-[CONTAINS]->(Directory)
5656 # 3. (Repository)-[CONTAINS]->(Commit)
5757 # 4. (Repository)-[CONTAINS]->(bracnh)
58- # 5. (Directory)-[CONTAINS]->(File)
59- # 6. (Organization)-[OWNS]->(Repository)
60- # 7. (Commit)-[MODIFIES]->(File)
61- # 8. (User)-[STAR]->(Repository)
62- # 0. (User)-[PART_OF]->(Organization)
58+ # 5. (Organization)-[OWNS]->(Repository)
59+ # 6. (User)-[STAR]->(Repository)
60+ # 7. (User)-[PART_OF]->(Organization)
6361
6462 s.add_relation("CONTAINS", repo, file)
6563 s.add_relation("CONTAINS", repo, dir)
6664 s.add_relation("CONTAINS", repo, commit)
6765 s.add_relation("CONTAINS", repo, branch)
68- s.add_relation("CONTAINS", dir, file)
6966 s.add_relation("OWNS", organization, repo)
70- s.add_relation("MODIFIES", commit, file)
7167 s.add_relation("STAR", user, repo)
7268 s.add_relation("PART_OF", user, organization)
7369
@@ -84,17 +80,19 @@
8480 instruction="Extract organization, repository, users, files and directories. make sure to form connections"),
8581 Source("https://github.com/FalkorDB/FalkorDB/stargazers",
8682 instruction="Extract users who've stared this repo, make sure to create each user and connect it via an edge to the repo node."),
87- Source("https://github.com/FalkorDB/FalkorDB/branches", instruction="Extract branches and connect them to the repository")]
83+ Source("https://github.com/FalkorDB/FalkorDB/branches", instruction="Extract branches and connect them to the repository"),
84+ Source("https://github.com/FalkorDB/FalkorDB/commits", instruction="Extract commits and connect them to the repository")]
8885
8986 g.process_sources(sources)
9087
9188 # Query the repo
9289 msgs = []
93- questions = ["List a few Stargazers",
90+ questions = ["List a few stargazers",
91+ "List a few commits",
9492 "How many Markdown files are there in the FalkorDB repository?",
9593 "Which organization owns the FalkorDB repository?",
9694 "Any of the Stargazers are also associated with the repo's organization?",
97- "Does the FalkorDB repository has a 'main' or a 'master' branch?"]
95+ "Does the FalkorDB repository has a 'main' branch?"]
9896
9997 for q in questions:
10098 print(f"Question: {q}")