{"id":20858946,"url":"https://github.com/secretshardul/dgraph-shakespeare-data","last_synced_at":"2026-03-19T17:52:13.154Z","repository":{"id":101006147,"uuid":"308922343","full_name":"secretshardul/dgraph-shakespeare-data","owner":"secretshardul","description":null,"archived":false,"fork":false,"pushed_at":"2020-11-02T05:04:59.000Z","size":34113,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-09-10T06:02:04.182Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/secretshardul.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2020-10-31T16:19:59.000Z","updated_at":"2024-02-23T19:58:29.000Z","dependencies_parsed_at":null,"dependency_job_id":"c0e06aa7-6281-40b2-bf77-7ff5e5df9e3b","html_url":"https://github.com/secretshardul/dgraph-shakespeare-data","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/secretshardul/dgraph-shakespeare-data","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/secretshardul%2Fdgraph-shakespeare-data","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/secretshardul%2Fdgraph-shakespeare-data/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/secretshardul%2Fdgraph-shakespeare-data/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/secretshardul%2Fdgraph-shakespeare-data/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/secretshardul","download_url":"https://codeload.github.com/secretshardul/dgraph-shakespeare-data/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/secretshardul%2Fdgraph-shakespeare-data/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29392853,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-13T00:53:09.511Z","status":"online","status_checked_at":"2026-02-13T02:00:10.076Z","response_time":78,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":"2024-11-18T04:48:11.851Z","updated_at":"2026-02-13T02:03:15.868Z","avatar_url":"https://github.com/secretshardul.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# Complete works of Shakespeare: GraphQL schema and DGraph RDF dump\n![](https://media-fastly.hackerearth.com/media/hackathon/slash-sprint/images/7af8fd52f7-cover_image_1.png)\n\nThis repository holds the GraphQL schema and RDF file needed to setup a Shakespeare database on Slash.\n\nThis project is split across 2 repositories:\n1. [**dgraph-shakespeare-data**](https://github.com/secretshardul/dgraph-shakespeare-data) (current repository): Contains the RDF file and GraphQL schema needed to setup DGraph.\n2. [**complete-shakespeare**](https://github.com/secretshardul/complete-shakespeare): Contains code for Alexa skill for Shakespeare which consumes data from DGraph.\n\n## Demo video\n[![Complete shakespeare demo](https://github.com/secretshardul/complete-shakespeare/raw/master/images/thumbnail-yt.png)](https://youtu.be/CpnAH6ymal8)\n\n## Architecture\n![Architecture](https://lucid.app/publicSegments/view/22f57178-d91d-42ed-9755-eb46218710c5/image.png)\n\n## Visualized schema\n![Schema visualized](https://lucid.app/publicSegments/view/e6bbf02e-864b-4ce4-85f2-5dc13a843c5a/image.png)\n\n## Steps to push data on Slash\n1. [Create a new instance on Slash](https://slash.dgraph.io/).\n2. Set the backend mode to flexible and generate an admin API key.\n3. Copy schema from [`schema.graphql`](/schema.graphql) and save it in the Slash console.\n4. Upload `sql.rdf` to Slash using **live loader**. The command should have the absolute path to this folder.\n\n    ```sh\n    docker run -it --rm -v /path/to/dgraph-shakespeare-data/sql.rdf:/tmp/sql.rdf dgraph/dgraph:v20.07-slash \\\n        dgraph live --slash_grpc_endpoint=\u003cgrpc-endpoint\u003e:443 -f /tmp/sql.rdf -t \u003capi-token\u003e\n    ```\n\n## How was the data obtained?\nThese steps are for documentatary purposes. The final `schema.graphql` and `sql.rdf` files have already been prepared.\n\n1. Run a MySQL instance on localhost using XAMPP and PHPMyAdmin.\n2. Create new database and import data from `shakespeare.sql`. This is an improved version of the dump provided by Open Source Shakespeare. Unnecessary tables were removed, fields were renamed and foreign keys were added.\n3. Run the **SQL to Dgraph migration tool** to obtain `schema.txt` and `sql.rdf` files. Add necessary credentials in `config.properties` file.\n\n    ```sh\n    dgraph migrate --config config.properties --output_schema schema.txt --output_data sql.rdf --host 192.168.64.2\n    ```\n\n4. By looking at the database, design a `schema.graphql` file as per needs. Add types, authorization, inverse relations and search as necessary.\n5. Some regular expression transformations were performed on the generated `sql.rdf` file to support all access patterns- adding `\u003cdgraph.type\u003e`, reverse relations etc. For complete steps, look at my [blog post](https://discuss.dgraph.io/t/sql-migration-tool-shenanigans-and-solutions/11229).\n\n## Future work\n1. In the SQL data, Paragraph table does not have a foreign key for Chapter table. `Paragraph` and `Chapter` graphQL types are yet to be linked.\n2. `Quotes` table was separate and not linked to `Works`, `Character` or any other table. The graphQL types are not linked yet.\n\n## Credits\n1. [Open source Shakespeare by George Mason University](https://www.opensourceshakespeare.org/downloads/): For making their SQL database open source.\n2. [Terence Eden](https://github.com/edent/Open-Source-Shakespeare) and [Richard Morrison](): For improvements in the original SQL dump.\n3. [DGraph Labs and DGraph developer community](https://dgraph.io/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsecretshardul%2Fdgraph-shakespeare-data","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsecretshardul%2Fdgraph-shakespeare-data","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsecretshardul%2Fdgraph-shakespeare-data/lists"}