{"id":37054460,"url":"https://github.com/angshuman/hexadb","last_synced_at":"2026-01-14T06:09:03.441Z","repository":{"id":40909274,"uuid":"207719526","full_name":"angshuman/hexadb","owner":"angshuman","description":"A schemaless graph database based on RocksDb","archived":false,"fork":false,"pushed_at":"2022-12-08T09:07:25.000Z","size":257,"stargazers_count":46,"open_issues_count":5,"forks_count":4,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-11-27T13:48:08.529Z","etag":null,"topics":["graph","graphdb","jsonld","linked-data","nested-objects","rocksdb","triple-store","triples","triplestore"],"latest_commit_sha":null,"homepage":"","language":"C#","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/angshuman.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}},"created_at":"2019-09-11T03:58:56.000Z","updated_at":"2025-01-03T02:50:46.000Z","dependencies_parsed_at":"2023-01-25T09:45:10.883Z","dependency_job_id":null,"html_url":"https://github.com/angshuman/hexadb","commit_stats":null,"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"purl":"pkg:github/angshuman/hexadb","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/angshuman%2Fhexadb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/angshuman%2Fhexadb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/angshuman%2Fhexadb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/angshuman%2Fhexadb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/angshuman","download_url":"https://codeload.github.com/angshuman/hexadb/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/angshuman%2Fhexadb/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28412189,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T05:26:33.345Z","status":"ssl_error","status_checked_at":"2026-01-14T05:21:57.251Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: 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":["graph","graphdb","jsonld","linked-data","nested-objects","rocksdb","triple-store","triples","triplestore"],"created_at":"2026-01-14T06:09:02.763Z","updated_at":"2026-01-14T06:09:03.437Z","avatar_url":"https://github.com/angshuman.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# HexaDb\n## A schemaless graph database based on RocksDb\n\nHexaDb is a triple based graph data store created on RocksDb storage. It can be used to store, retrieve and query JSON documents.\nHexaDb does not require a schema. It also supports relational query through providing nested path or nesting level\nin any arbitrary JSON document.\n\n## Naming\n\nHexaDb breaks JSON documents to RDF triples in the format of `(S,P,O)` and creates six indices. All triples are queryable by those six indices\n`S,\nP,\nO,\nSP,\nPO,\nOS`\n\nThus **HexaDb**.\n\n## Building and running locally\n\n`$ docker-compose up`\n\nFor more detailed documentation take a look at the [wiki](https://github.com/angshuman/hexadb/wiki/Simple-Relationships \"Simple Relationships\")\n\nYou can also find example scenarios at [hexadb-examples](https://github.com/angshuman/hexadb-examples \"Hexadb Examples\")\n\n## Getting started with the API's\n\nLet's create a graph. First we will create two object's with nested JSON objects. Later, we will create another object that references these objects by id.\n\n### Creating your first objects\n\n`POST /api/store/app01`\n\n```json\n[\n    {\n        \"id\": \"sensor:0\",\n        \"type\": \"sensor\",\n        \"name\": \"Entity sensor 0\",\n        \"temperature\": 64.44,\n        \"humidity\": 14.65,\n        \"pressure\": 957.1,\n        \"marker\": {\n            \"status\": \"running\",\n            \"red\": 9.12,\n            \"blue\": 4.53,\n            \"green\": 9.85\n        }\n    },\n    {\n        \"id\": \"sensor:1\",\n        \"type\": \"sensor\",\n        \"name\": \"Entity sensor 1\",\n        \"temperature\": 65.86,\n        \"humidity\": 12.29,\n        \"pressure\": 945.19,\n        \"marker\": {\n            \"status\": \"stopped\",\n            \"red\": 9.95,\n            \"blue\": 7.16,\n            \"green\": 2.02\n        }\n    }\n]\n```\nThe top level objects in the POST call need to have an id field. The nested objects will be assigned id's based on the top level id. This POST call creates four different objectswith links. Nested objects are considered top level and can be queried indepently. \n\n### Get an object by id\n\n`GET /api/store/app01/sensor:1`\n\n### Find an object by a top level property comparison\n\n`POST /api/store/app01/query`\n\nThis query finds all object with `type` of `sensor` and with a `temperature` property \u003e `65`.\n\n```json\n{\n    \"filter\": {\n        \"type\": {\n            \"op\": \"eq\",\n            \"value\": \"sensor\"\n        },\n        \"temperature\" : {\n            \"op\" : \"gt\",\n            \"value\" : 65,\n        }\n    }\n}\n```\n\n### Create a relationship\n\nPosting a nested object automatically creates relationships. In HexaDb all objects are considered to be a top-level object. New objects and relationships can be created with just another POST with id references to existing objects. This is similar to POST with inline objects. But the object does not need to be inline. An id reference to an existing object is good enough.\n\n`POST /api/store/app01`\n\n```json\n{\n    \"id\" : \"room:0\",\n    \"name\" : \"Room Zero\",\n    \"type\" : \"room\",\n    \"description\" : \"Has two sensors\",\n    \"sensors\" : [\n        {\n            \"id\" : \"sensor:0\"\n        },\n        {\n            \"id\" : \"sensor:1\"\n        }\n    ]\n}\n```\n\nThis creates the following structure\n\n![Graph](hexadb-readme.svg)\n\n\n### Find an object by relationship query\n\nWe are trying to find rooms that have a sensor with a `marker` object that has a property of `green \u003e 9`. This can be thought of as the following pattern search in the graph. To query multiple nesting levels with named paths, a `#` separated list of path names are used. In this case it is `sensors#marker`\n\n![Outgoing Path](hexadb-readme-outgoing-path.svg)\n\n`POST /api/store/app01/query`\n\n```json\n{\n    \"filter\": {\n        \"type\": {\n            \"op\": \"eq\",\n            \"value\": \"room\"\n        }\n    },\n    \"outgoing\": [\n        {\n            \"path\": \"sensors#marker\",\n            \"target\": {\n                \"filter\": {\n                    \"green\": {\n                        \"op\": \"gt\",\n                        \"value\": 9\n                    }\n                }\n            }\n        }\n    ]\n}\n```\n\n### Find an object by nesting level\n\nHere is the same query without specifying the explicit relationships. This is querying all outgoing objects in the nesting level of `3`. Notice that the `path` is `*` so it will match any objects in that vicinity.\n\n`POST /api/store/app01/query`\n\n```json\n{\n    \"filter\": {\n        \"type\": {\n            \"op\": \"eq\",\n            \"value\": \"room\"\n        }\n    },\n    \"outgoing\": [\n        {\n            \"path\": \"*\",\n            \"level\": 3,\n            \"target\": {\n                \"filter\": {\n                    \"green\": {\n                        \"op\": \"gt\",\n                        \"value\": 9\n                    }\n                }\n            }\n        }\n    ]\n}\n```\n\nNote that without specifying the path all the objects in the nesting level will be considered for a pattern match. For example this query may look like below\n\n![Outgoing Level](hexadb-readme-outgoing-level.svg)\n\n### Find an object with incoming relationship\n\nSimilar to the outgoing queries it is also possible to query objects that are pointed to by other objects. E.q. in a `parent-\u003echild` relatioship children can be found by `incoming` query from the parent.\n\nIncoming queries can also be done with nesting level with `*` as path.\n\n```json\n{\n    \"filter\": {\n        \"type\": {\n            \"op\": \"eq\",\n            \"value\": \"sensor\"\n        }\n    },\n    \"incoming\": [\n        {\n            \"path\": \"sensors\",\n            \"target\": {\n                \"filter\": {\n                    \"name\": {\n                        \"op\": \"contains\",\n                        \"value\": \"Room\"\n                    }\n                }\n            }\n        }\n    ]\n}\n```\n\nThis is querying for the following pattern in the graph\n\n![Incomng Path](hexadb-readme-incoming-path.svg)\n\n\n### Update an object\n\n`PATCH /api/store/app01/json`\n\nA json-merge-patch style endpoint is available. Below is an example that changes the name of the object pointed to by `sensor:0` and modifies the `marker` relationship to contain a single object with no `status` (deleted) and value of `red` with `1.0`.\n\n```json\n{\n    \"id\": \"sensor:0\",\n    \"name\": \"Another name\",\n    \"marker\": {\n        \"status\": null,\n        \"red\": 1.0\n    }\n}\n```\n\n`PATCH /api/store/app01/triple`\n\nHexadb also supports patching at the triple level. The patches are performed with two separate `add` and `remove` sections. The `remove` is performed before `add`.\n\n```json\n{\n    \"remove\": {\n        \"id\": \"room:0\",\n        \"sensors\": [\n            {\n                \"id\": \"sensor:0\"\n            }\n        ]\n    },\n    \"add\": {\n        \"id\": \"room:1\",\n        \"sensors\": [\n            {\n                \"id\": \"sensor:2\",\n                \"temperature\" : 50,\n                \"description\" : \"some other sensor\"\n            }\n        ]\n    }\n}\n```\n\n### Replication\n\nThe data store can be replicated to multiple instances using event hubs. The store supports the following environment variables to use for replication.\n\n```\nHEXASTORE_EVENTHUB_KEY\nHEXASTORE_EVENTHUB_PARTITION_COUNT\nHEXASTORE_EVENTHUB_NAME\n```\n\nThe `HEXASTORE_EVENTHUB_KEY` must contain `EntityPath`. `HEXASTORE_EVENTHUB_PARTITION_COUNT` denotes the number of partitions to send replication data to.\n`HEXASTORE_EVENTHUB_NAME` identifies the event hub as a name. If this is changed the event hub configuration will be treated as a new configuration with \nno checkpoints. The checkpoints are used to remember the offset to which the database contains information. On restart the writes are read from the already \nsaved offset in the database.\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fangshuman%2Fhexadb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fangshuman%2Fhexadb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fangshuman%2Fhexadb/lists"}