{"id":15658348,"url":"https://github.com/johnymontana/flat-graph","last_synced_at":"2025-09-02T15:37:15.231Z","repository":{"id":65160348,"uuid":"373588052","full_name":"johnymontana/flat-graph","owner":"johnymontana","description":"GitHub Action for scraping data and importing into Neo4j using Cypher","archived":false,"fork":false,"pushed_at":"2021-07-12T17:11:47.000Z","size":415,"stargazers_count":22,"open_issues_count":2,"forks_count":3,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-10T09:06:02.133Z","etag":null,"topics":["data","github-actions","neo4j"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/johnymontana.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-06-03T17:21:17.000Z","updated_at":"2024-02-19T16:27:07.000Z","dependencies_parsed_at":"2023-01-13T15:43:52.312Z","dependency_job_id":null,"html_url":"https://github.com/johnymontana/flat-graph","commit_stats":{"total_commits":9,"total_committers":1,"mean_commits":9.0,"dds":0.0,"last_synced_commit":"678e508f182dccc9f67fa63c588e4b3d476609b1"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johnymontana%2Fflat-graph","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johnymontana%2Fflat-graph/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johnymontana%2Fflat-graph/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johnymontana%2Fflat-graph/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/johnymontana","download_url":"https://codeload.github.com/johnymontana/flat-graph/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252535227,"owners_count":21763918,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["data","github-actions","neo4j"],"created_at":"2024-10-03T13:12:01.930Z","updated_at":"2025-05-05T16:42:50.208Z","avatar_url":"https://github.com/johnymontana.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003cimg src=\"img/flat-graph.png\" width=400\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://img.shields.io/github/v/release/johnymontana/flat-graph.svg\"\u003e  \n\u003c/p\u003e\n\n# Flat Graph GitHub Action\n\nFlat Graph is a GitHub action designed to be a companion to the [Flat Data GitHub action](https://octo.github.com/projects/flat-data) for regularly scraping data from a URL and enables import into a Neo4j graph database using on Cypher.\n\n## Why would I want to use this?\n\nTo periodically import data into Neo4j from a JSON file.\n\n## Examples\n\nComing soon\n\n## Usage\n\nCreate a GitHub Actions workflow yml file, `.github/workflows/flat.yml`. This example will use the Flat Data GitHub action to fetch the latest submissions to the Lobste.rs site every 60 minutes, then using the Flat Graph GitHub action import this data into Neo4j. Be sure to use GitHub secrets to avoid exposing credentials.\n\n```yaml\nname: Flat Graph for Neo4j\n\non:\n  push:\n    paths:\n      - .github/workflows/flat.yml\n  workflow_dispatch:\n  schedule:\n    - cron: '*/60 * * * *'\n\njobs:\n  scheduled:\n    runs-on: ubuntu-latest\n    steps:\n      - name: Check out repo\n        uses: actions/checkout@v2\n      - name: Setup deno\n        uses: denoland/setup-deno@main\n        with:\n          deno-version: v1.x\n      - name: Fetch newest \n        uses: githubocto/flat@v2\n        with:\n          http_url: https://lobste.rs/newest.json\n          downloaded_filename: newest.json\n      - name: Neo4j import\n        uses: johnymontana/flat-graph@v1.1\n        with:\n          neo4j-user: ${{secrets.NEO4J_USER}}\n          neo4j-password: ${{secrets.NEO4J_PASSWORD}}\n          neo4j-uri: ${{secrets.NEO4J_URI}}\n          filename: 'newest.json'\n          cypher-query: \u003e\n              UNWIND $value AS article\n              MERGE (u:User {username: article.submitter_user.username})\n              MERGE (a:Article {id: article.short_id})\n              SET a.url           = article.url,\n                  a.id_url        = article.short_id_url,\n                  a.created_at    = article.created_at,\n                  a.title         = article.title,\n                  a.score         = article.score,\n                  a.flags         = article.flags,\n                  a.comment_count = article.comment_count,\n                  a.description   = article.description,\n                  a.comments_url  = article.comments_url\n              MERGE (u)-[:SUBMITTED]-\u003e(a)\n              WITH article, a\n              UNWIND article.tags AS tag\n              MERGE (t:Tag {name: tag})\n              MERGE (a)-[:HAS_TAG]-\u003e(t)        \n```\n\n## Inputs\n\n\n### `neo4j-user`\n\nThe username for your Neo4j instance\n\n### `neo4j-password`\n\nThe password for your Neo4j user\n\n### `neo4j-uri`\n\nThe connection string for your Neo4j instance\n\n### `filename`\n\nThe name of the file to be loaded. Currently only JSON is supported. This file will be passed as a parameter to the specified Cypher query.\n\n### `cypher-query`\n\nThe Cypher query to run. Your JSON file will be passed in a variable `$value`\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjohnymontana%2Fflat-graph","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjohnymontana%2Fflat-graph","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjohnymontana%2Fflat-graph/lists"}