{"id":13723493,"url":"https://github.com/thundergolfer/simplegraphdb","last_synced_at":"2025-07-28T14:41:57.915Z","repository":{"id":73463570,"uuid":"111295550","full_name":"thundergolfer/simplegraphdb","owner":"thundergolfer","description":"Basic Golang implementation of a Triple Store. Built to learn the Golang language before an internship. ","archived":false,"fork":false,"pushed_at":"2019-03-13T02:43:17.000Z","size":1243,"stargazers_count":19,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-04T12:55:25.618Z","etag":null,"topics":["beginner-code","golang","graph-database","rdf-graph-store","triplestore"],"latest_commit_sha":null,"homepage":null,"language":"Go","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/thundergolfer.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-11-19T13:01:21.000Z","updated_at":"2024-07-28T07:10:01.000Z","dependencies_parsed_at":null,"dependency_job_id":"f5cb25ee-b86a-42cd-b4a8-44260b7f7068","html_url":"https://github.com/thundergolfer/simplegraphdb","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thundergolfer%2Fsimplegraphdb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thundergolfer%2Fsimplegraphdb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thundergolfer%2Fsimplegraphdb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thundergolfer%2Fsimplegraphdb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thundergolfer","download_url":"https://codeload.github.com/thundergolfer/simplegraphdb/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248586241,"owners_count":21128995,"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":["beginner-code","golang","graph-database","rdf-graph-store","triplestore"],"created_at":"2024-08-03T01:01:42.223Z","updated_at":"2025-04-12T14:52:19.527Z","avatar_url":"https://github.com/thundergolfer.png","language":"Go","readme":"# Simple Graph Database - A Hexastore based Triple Store  [![Build Status](https://travis-ci.org/thundergolfer/simplegraphdb.svg?branch=master)](https://travis-ci.org/thundergolfer/simplegraphdb)\n------\n\nDeveloped to help learn the Golang language, this project explores a\nsimple form of graph database, the *Triple Store*, by implementing the\n*Hexastore* architecture from the paper [*\"Hexastore: Sextuple Indexing\nfor Semantic Web Data\nManagement\"*](http://www.vldb.org/pvldb/1/1453965.pdf). The project also\nexplores the [SPARQL](https://en.wikipedia.org/wiki/SPARQL) graph query language, by implementing a simplified\nversion of it which I dubbed `simplesparql`.\n\n## Introduction - Usage\n\nAs a simple demo, we can scrape your Twitter network and query it with\nthis library. To do so:\n\n1. `git clone` this library to your designated Go workspace\n2. Go into the `scripts/` directory\n3. Install script dependencies with `pip install -r requirements.txt` (consider using `virtualenv`).\n4. Run `./create_twitter_followers_graph_example_db.sh`. **Note:** If you don't have a Twitter account, skip this step and a default Twitter network (mine) will be used.\n5. Go into the `/examples/your_twitter_graph/` folder and run `go build`\n6. A binary is created, which you can run with `./your_twitter_graph`\n7. Query the n etwork with `simplesparql` syntax (See the `README.md`\n   section on it below).\n\n##### Example starting query\n\nGet all the people that you follow with:\n\n`SELECT ?x WHERE { '\u003cYOUR SCREEN NAME\u003e' 'follows' ?x }`\n\n## Usage - Golang Package\n\n1 .Add to project:\n\n`go get github.com/thundergolfer/simplegraphdb` or `glide get github.com/thundergolfer/simplegraphdb`\n\n2. Add to imports:\n\n```golang\nimport (\n  \"github.com/thundergolfer/simplegraphdb\"\n)\n```\n\n#### Package Interface\n\n##### `InitHexastoreFromJSONRows(filename string) (*HexastoreDB, error)`\n\nYou can setup a Hexastore by passing a filepath to a `.json` file with the following format:\n\n```\n{\"subject\": \u003cSTRING\u003e, \"prop\": \u003cSTRING\u003e, \"object\": \u003cSTRING\u003e}\n{\"subject\": \u003cSTRING\u003e, \"prop\": \u003cSTRING\u003e, \"object\": \u003cSTRING\u003e}\n{\"subject\": \u003cSTRING\u003e, \"prop\": \u003cSTRING\u003e, \"object\": \u003cSTRING\u003e}\n...\n...\n```\n\n##### `InitHexastoreFromTurtle(dbFilePath string) (Hexastore, error)`\n\n\u003e BETA: Turtle files are currently parsed with [d4l3k/turtle](https://github.com/d4l3k/turtle), which is quite limited.\n\n[*Turtle* (Terse RDF Triple Language)](https://www.w3.org/TeamSubmission/turtle/) is a syntax for describing RDF semantic web graphs. You can load an RDF graph specified in turtle syntax with this function.\n\n##### `RunQuery(query string, store Hexastore) (string, error)`\n\nRun a well-formed `simplesparql` query (see more below) against a Hexastore instance. Just returns a printable table of results like:\n\n```\n?target                | ?prop                  |\n------------------------------------------------\nCow                    | follows                |\nApple                  | follows                |\n```\n\n##### `SaveToJSONRows(filename string, store Hexastore) error`\n\n\u003e Not yet implemented, but coming soon\n\n\n----------\n\n## simplesparql\n\n`simplesparql` is an implementation of a subset of the SPARQL query\nlanguage. It supports the asking of basic questions about a graph,\nquestions like \"Who likes 'Manchester United'?\", but not anything\ninvolving aggregations, grouping, conditionals. With time, these things\nmay be implemented.\n\nThe basics of it are that you preface variables with `?`, with a variable\nin the `WHERE` clause acting like a wildcard (`*`). For example:\n\n`SELECT ?screen_name WHERE { 'jonobelotti_IO' 'follows' ?screen_name }`\n\nwill return all people that `jonobelotti_IO` follows (ie. all vertices\non the graph connected by a 'follows' edge from the vertice\n`'jonobelotti_IO'`.\n\nYou can use up to a maximum of 3 variables in a `WHERE` clause. All\n`WHERE` clauses must have exactly three components. For example:\n\n`SELECT ?screen_name, ?property WHERE { 'jonobelotti_IO' ?property\n?screen_name }`\n\nwill essentially return all triples in the graph involving the\n`'jonobelotti_IO'` vertice.\n","funding_links":[],"categories":["Go"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthundergolfer%2Fsimplegraphdb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthundergolfer%2Fsimplegraphdb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthundergolfer%2Fsimplegraphdb/lists"}