kikocis/GraphRAG-SDK public
Changesets · Branches · Tags · Compare
| Changeset | 3e2e7f5f23d2614e4c67046edefd5c2481159ff34605a44a36b7e263f14d6091 |
|---|---|
| Author | Roi Lipman <roilipman@gmail.com> · 2024-06-08 00:29 +03:00 |
| Committer | Roi Lipman <roilipman@gmail.com> · 2024-06-08 00:29 +03:00 |
| Parents | 3034d86cfbbe |
1 file changed
modified examples/github.py +9 −11
| @@ -8,7 +8,7 @@ | ||
| 8 | 8 | handler = logging.StreamHandler() |
| 9 | 9 | handler.setFormatter(logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s')) |
| 10 | 10 | logger.addHandler(handler) |
| 11 | -logger.setLevel(logging.INFO) | |
| 11 | +logger.setLevel(logging.DEBUG) | |
| 12 | 12 | |
| 13 | 13 | def main(): |
| 14 | 14 | # Manually define schema |
| @@ -55,19 +55,15 @@ | ||
| 55 | 55 | # 2. (Repository)-[CONTAINS]->(Directory) |
| 56 | 56 | # 3. (Repository)-[CONTAINS]->(Commit) |
| 57 | 57 | # 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) | |
| 63 | 61 | |
| 64 | 62 | s.add_relation("CONTAINS", repo, file) |
| 65 | 63 | s.add_relation("CONTAINS", repo, dir) |
| 66 | 64 | s.add_relation("CONTAINS", repo, commit) |
| 67 | 65 | s.add_relation("CONTAINS", repo, branch) |
| 68 | - s.add_relation("CONTAINS", dir, file) | |
| 69 | 66 | s.add_relation("OWNS", organization, repo) |
| 70 | - s.add_relation("MODIFIES", commit, file) | |
| 71 | 67 | s.add_relation("STAR", user, repo) |
| 72 | 68 | s.add_relation("PART_OF", user, organization) |
| 73 | 69 | |
| @@ -84,17 +80,19 @@ | ||
| 84 | 80 | instruction="Extract organization, repository, users, files and directories. make sure to form connections"), |
| 85 | 81 | Source("https://github.com/FalkorDB/FalkorDB/stargazers", |
| 86 | 82 | 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")] | |
| 88 | 85 | |
| 89 | 86 | g.process_sources(sources) |
| 90 | 87 | |
| 91 | 88 | # Query the repo |
| 92 | 89 | msgs = [] |
| 93 | - questions = ["List a few Stargazers", | |
| 90 | + questions = ["List a few stargazers", | |
| 91 | + "List a few commits", | |
| 94 | 92 | "How many Markdown files are there in the FalkorDB repository?", |
| 95 | 93 | "Which organization owns the FalkorDB repository?", |
| 96 | 94 | "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?"] | |
| 98 | 96 | |
| 99 | 97 | for q in questions: |
| 100 | 98 | print(f"Question: {q}") |