{"id":36265899,"url":"https://github.com/linkorb/sage","last_synced_at":"2026-01-11T08:03:21.876Z","repository":{"id":62517397,"uuid":"204695784","full_name":"linkorb/sage","owner":"linkorb","description":"Sage: active record interface to a set distributed data repositories supporting virtual fields","archived":false,"fork":false,"pushed_at":"2025-09-24T13:11:08.000Z","size":26,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-09-24T15:16:37.191Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","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/linkorb.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2019-08-27T12:13:52.000Z","updated_at":"2025-09-24T13:08:58.000Z","dependencies_parsed_at":"2025-09-25T23:46:54.096Z","dependency_job_id":null,"html_url":"https://github.com/linkorb/sage","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/linkorb/sage","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linkorb%2Fsage","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linkorb%2Fsage/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linkorb%2Fsage/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linkorb%2Fsage/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/linkorb","download_url":"https://codeload.github.com/linkorb/sage/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linkorb%2Fsage/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28297983,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-11T04:44:51.577Z","status":"ssl_error","status_checked_at":"2026-01-11T04:44:44.232Z","response_time":60,"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":[],"created_at":"2026-01-11T08:03:21.246Z","updated_at":"2026-01-11T08:03:21.870Z","avatar_url":"https://github.com/linkorb.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"Sage\n====\n\nA Sage instance allows you to\n\n1. Transparently access data stored in Repositories of different types (PDO, Array, Cache, NdJson files, etc) as in-memory arrays\n2. Traverse relations (one-to-many, many-to-one) between them\n3. Access virtual fields (akin to GraphQL field resolvers) for modifications, calculations and other advanced use-cases\n\nSage can be thought of as a supersedence of [linkorb/context](https://github.com/linkorb/context).\n\n## Usage\n\n1. Instantiate a new Sage\\Sage instance\n2. Instantiate a Repository for each table/collection you'd like to access\n3. Attach the Repositories to the Sage instance\n4. Add \"Virtual Fields\" to specify relations between tables or add data modifiers\n5. Query tables using common `findAll()` with conditions\n6. Access the resulting rows as an array, allowing you to traverse the array as if it is all in-memory (Sage lazy-loads accessed rows behind the scenes).\n\n## Definitions\n\n* **Sage**: A collection of repositories and virtual fields\n\n* **Repository**: Analogue to a database table/collection. May be backed by different storage methods (see src/Repository/ for current implementations)\n\n* **Record**: An in-memory Record can be accessed as an array (`$user['name']`) and supports many-to-one and one-to-many relations to other tables though virtual fields\n\n## Use-cases\n\n* Rapid application development: You don't need to model objects (with getters/setters/etc) in order to work with them. Just load raw data (from json, yaml, arrays, pdo, etc for example) and you're ready to traverse the repositories and records within it.\n* Complex medical record mapping/conversion: Use a \"context\" (subset of records pertaining to a single medical record or patient) then easily traverse it through it's relations.\n* Structured Documentation: Model information according to it's domain, then load it into a Context and use (twig/mustache/handlebars) templates to traverse the information.\n* GraphQL datastore: A Sage instance is in essence a Graph. A context can therefor be used to generate a GraphQL server which can be used by other applications to easily query the context in a format of their choosing.\n* Natural user interface/email/view generation: Simply define a context into a view, and loop over it with any template language such as twig, handlebars, mustache, etc. No further controller logic required.\n\n## License\n\nMIT (see [LICENSE.md](LICENSE.md))\n\n## Brought to you by the LinkORB Engineering team\n\n\u003cimg src=\"http://www.linkorb.com/d/meta/tier1/images/linkorbengineering-logo.png\" width=\"200px\" /\u003e\u003cbr /\u003e\nCheck out our other projects at [linkorb.com/engineering](http://www.linkorb.com/engineering).\n\nBtw, we're hiring!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flinkorb%2Fsage","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flinkorb%2Fsage","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flinkorb%2Fsage/lists"}