{"id":26941549,"url":"https://github.com/justin2004/git_to_rdf","last_synced_at":"2025-04-02T16:20:01.375Z","repository":{"id":60186107,"uuid":"539761540","full_name":"justin2004/git_to_rdf","owner":"justin2004","description":"Transform git repos into RDF","archived":false,"fork":false,"pushed_at":"2022-11-05T19:35:56.000Z","size":30,"stargazers_count":10,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2023-05-01T15:38:44.004Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Clojure","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/justin2004.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":"2022-09-22T02:15:15.000Z","updated_at":"2023-01-08T13:34:17.000Z","dependencies_parsed_at":"2022-09-26T13:00:20.192Z","dependency_job_id":null,"html_url":"https://github.com/justin2004/git_to_rdf","commit_stats":null,"previous_names":[],"tags_count":null,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/justin2004%2Fgit_to_rdf","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/justin2004%2Fgit_to_rdf/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/justin2004%2Fgit_to_rdf/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/justin2004%2Fgit_to_rdf/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/justin2004","download_url":"https://codeload.github.com/justin2004/git_to_rdf/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246847137,"owners_count":20843444,"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":[],"created_at":"2025-04-02T16:19:57.962Z","updated_at":"2025-04-02T16:20:01.346Z","avatar_url":"https://github.com/justin2004.png","language":"Clojure","funding_links":[],"categories":["Tools"],"sub_categories":[],"readme":"# git_to_rdf\n\n## what\nA utility (that runs in a Docker container) that transforms a git repository on disk into RDF.\nIt uses [SPARQL Anything](https://github.com/SPARQL-Anything/sparql.anything) to transform the intermediate csv and json git repository representations into RDF using SPARQL construct queries.\n\n## why\nI've [blogged](https://github.com/justin2004/weblog/tree/master/git_repo_as_rdf#readme) about using this tool to view a git repository as RDF.\n\n## how\n\nSay you cloned this git repo to `/home/alice/repo/git_to_rdf`, your git repository of interest is at `/home/alice/repo/projX`, and you want to put the RDF this tool produces at `/home/alice/RDF`\n\nFirst build the Docker image.\n\n0) have [Docker](https://docs.docker.com/engine/install/) installed\n0) have `make` and `wget` installed\n0) cd to `/home/alice/repo/git_to_rdf`\n0) in a `bash` shell run: `make build`\n\nNow use the Docker image .\n\n0) cd to `/home/alice/`\n0) in a `bash` shell run: `/home/alice/repo/git_to_rdf/git_to_rdf.sh --repository /mnt/repo/projX --output /mnt/RDF`\n0) find your 2 output files `summaries.nq` and `hunks.nq` at `/home/alice/RDF` and the log file `git_to_rdf.log` in your current directory.\n\n\n## speed\n\nIt took 6 minutes to transform [this](https://github.com/SPARQL-Anything/sparql.anything) git repository (consisting of 1,122 commits) into 2,207,235 triples.\n\n\n\n## notes\n\nI don't have instructions on using the jar file directly because this utility uses the /tmp directory and it doesn't clean up after itself. Running it in a disposable Docker container means that /tmp directory goes away after it is done running. Also the utility needs `splitpatch` installed and that comes in the Docker image. \n\nNote the use of `/mnt` in the instructions. When you run `git_to_rdf.sh` your current directory gets mapped into the Docker container at `/mnt`. A drawback of this is that if you want to put the produced RDF at `/tmp/` and the git repo of interest lives at `/home/alice/repos/projX` you'd have to cd to `/` then run `/home/alice/repo/git_to_rdf/git_to_rdf.sh --repository /mnt/home/alice/repo/projX --output /mnt/tmp`.\n\nI might address those shortcomings of the utility but my immediate goal is to use the RDF not polish a utility for tidy deployments.\n\nAlso, you'll find many TODOs in the source. I may get to those one day.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjustin2004%2Fgit_to_rdf","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjustin2004%2Fgit_to_rdf","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjustin2004%2Fgit_to_rdf/lists"}