{"id":26950856,"url":"https://github.com/dan-f/twinql","last_synced_at":"2026-03-09T06:31:13.832Z","repository":{"id":150923325,"uuid":"86939606","full_name":"dan-f/twinql","owner":"dan-f","description":"A graph query language for the semantic web","archived":false,"fork":false,"pushed_at":"2017-07-21T14:24:38.000Z","size":364,"stargazers_count":15,"open_issues_count":11,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-10-06T01:22:40.766Z","etag":null,"topics":["json-ld","linked-data","query-language","rdf","semantic-web"],"latest_commit_sha":null,"homepage":"http://dan-f.me/twinql","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dan-f.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":"2017-04-01T20:07:39.000Z","updated_at":"2024-09-05T01:39:30.000Z","dependencies_parsed_at":"2023-05-03T15:47:17.941Z","dependency_job_id":null,"html_url":"https://github.com/dan-f/twinql","commit_stats":null,"previous_names":[],"tags_count":18,"template":false,"template_full_name":null,"purl":"pkg:github/dan-f/twinql","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dan-f%2Ftwinql","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dan-f%2Ftwinql/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dan-f%2Ftwinql/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dan-f%2Ftwinql/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dan-f","download_url":"https://codeload.github.com/dan-f/twinql/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dan-f%2Ftwinql/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30284774,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-09T02:57:19.223Z","status":"ssl_error","status_checked_at":"2026-03-09T02:56:26.373Z","response_time":61,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["json-ld","linked-data","query-language","rdf","semantic-web"],"created_at":"2025-04-02T23:34:58.004Z","updated_at":"2026-03-09T06:31:13.812Z","avatar_url":"https://github.com/dan-f.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# twinql\n\n[![Build Status](https://travis-ci.org/dan-f/twinql.svg?branch=master)](https://travis-ci.org/dan-f/twinql)\n[![Coverage Status](https://coveralls.io/repos/github/dan-f/twinql/badge.svg)](https://coveralls.io/github/dan-f/twinql)\n\nA graph query language for the semantic web.  Not [SPARQL](https://www.w3.org/TR/sparql11-query/).\n\n\n## Use Cases\n\ntwinql was designed with the goal of scratching a particular itch: fetching\nlinked data over [LDP](https://www.w3.org/TR/2015/REC-ldp-20150226/) without\nhaving to imperatively follow every link and handle every error in an ad-hoc\nmanner in [Solid](https://solid.mit.edu) applications.\n\nThe main idea behind twinql is that queries select subgraphs by starting at a\nparticular node and traversing outwards.  The query and the response have a\nsimilar recursive tree structure so that the shape of the response can be\ninferred from the shape of the request.\n\nIt is currently a hobby project and quite limited in scope.  It cannot do many\nof the things that SPARQL can.  However, it attempts to be more ergonomic than\nSPARQL for common use cases.\n\n### Examples\nHere's how you would query a WebID for profile data and data of that person's\nfriends:\n\n```\n@prefix foaf http://xmlns.com/foaf/0.1/\n\nhttps://dan-f.databox.me/profile/card#me {\n  foaf:name\n  foaf:img\n  [ foaf:knows ] {\n    foaf:name\n    foaf:img\n  }\n}\n```\nResponse:\n```js\n{\n  \"@context\": {\n    \"foaf\": \"http://xmlns.com/foaf/0.1/\"\n  },\n  \"@id\": \"https://dan-f.databox.me/profile/card#me\",\n  \"foaf:name\": { \"@value\": \"Daniel Friedman\" },\n  \"foaf:img\": { \"@value\": \"https://dan-f.databox.me/profile/me.jpg\"},\n  \"foaf:knows\": [\n    {\n      \"@id\": \"https://deiu.me/profile#me\",\n      \"foaf:name\": {\"@value\": \"Andrei Vlad Sambra\" },\n      \"foaf:img\": {\"@value\": \"https://deiu.me/avatar.jpg\" }\n    },\n    {\n      /* ... */\n    }\n  ]\n}\n```\n\n\n## Goals\n\n- Be declarative\n- Work well with existing standards and tools\n- Make app-building easier\n- Support multiple persistence layers (in-memory, link following, SPARQL, etc)\n- Be implemented eventually on the server to improve performance when querying\n  within a single domain and to reduce data being sent over the network\n\n\n## Known Challenges\n\n- Link-following is slow\n- Not all linked data actually links as well as it should\n- LDP doesn't care how much data you want from a particular graph; it gives you\n  the whole thing\n- Just about no operation on the semantic web is atomic\n\n\n## Roadmap\n\n- ordering and pagination\n- response streaming\n- Mutation API\n\n### Other cool things\n\n- Create higher level tooling for offline-first querying and realtime updates\n- Create bindings for common UI libraries\n  - e.g. connected React component\n\n## Development\n\nThis reference implementation of twinql happens to be built in JS for quick\nprototyping, but a safer language is recommended when implementing for a\nproduction use case.\n\n## Contributing\n\nIf you want to contribute to this reference implementation, first reach out by\ncreating a Github Issue to make sure we're on the same page :smile:\n\nAssuming you want to mess with the code, just do the following:\n\n0) Make sure you have node \u003e=7.x and npm installed.\n\n1) Clone the repo\n\n```bash\n$ git clone https://github.com/dan-f/twinql.git # (or your fork)\n```\n\n2) Install the dependencies\n\n```bash\n$ cd twinql \u0026\u0026 npm install\n```\n\n3) Run the demo site\n\n```bash\n$ npm start\n```\n\n4) Build the lib\n\n```bash\n# You can run webpack in watch mode to rebuild the UMD bundle on file changes.\n# This is useful when prototyping with the demo site.\n$ npm run build:dev\n\n# To test the minified UMD build:\n$ npm run build:umd\n\n# To transpile the library to CommonJS ES5\n$ npm run build:lib\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdan-f%2Ftwinql","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdan-f%2Ftwinql","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdan-f%2Ftwinql/lists"}