{"id":21355834,"url":"https://github.com/typedb/typeql","last_synced_at":"2026-02-13T20:01:44.445Z","repository":{"id":39572866,"uuid":"171061002","full_name":"typedb/typeql","owner":"typedb","description":"TypeQL: Built for systems, not records","archived":false,"fork":false,"pushed_at":"2026-02-09T20:58:09.000Z","size":6628,"stargazers_count":242,"open_issues_count":43,"forks_count":53,"subscribers_count":12,"default_branch":"master","last_synced_at":"2026-02-10T00:21:05.478Z","etag":null,"topics":["database","inference","logic","polymorphic","polymorphism","query","query-language","reasoning","strongly-typed","type-system","typedb","typeql"],"latest_commit_sha":null,"homepage":"https://typedb.com","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/typedb.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","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-02-16T23:01:20.000Z","updated_at":"2026-02-09T20:58:14.000Z","dependencies_parsed_at":"2026-01-07T08:00:20.551Z","dependency_job_id":null,"html_url":"https://github.com/typedb/typeql","commit_stats":{"total_commits":825,"total_committers":29,"mean_commits":"28.448275862068964","dds":0.6957575757575758,"last_synced_commit":"9d2d00834ba5ff93f921d8bd560265946ff079ff"},"previous_names":["typedb/typeql","vaticle/typeql"],"tags_count":57,"template":false,"template_full_name":null,"purl":"pkg:github/typedb/typeql","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/typedb%2Ftypeql","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/typedb%2Ftypeql/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/typedb%2Ftypeql/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/typedb%2Ftypeql/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/typedb","download_url":"https://codeload.github.com/typedb/typeql/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/typedb%2Ftypeql/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29416038,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-13T06:24:03.484Z","status":"ssl_error","status_checked_at":"2026-02-13T06:23:12.830Z","response_time":78,"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":["database","inference","logic","polymorphic","polymorphism","query","query-language","reasoning","strongly-typed","type-system","typedb","typeql"],"created_at":"2024-11-22T04:20:21.366Z","updated_at":"2026-02-13T20:01:44.414Z","avatar_url":"https://github.com/typedb.png","language":"Rust","readme":"[![TypeQL](https://github.com/typedb/.github/raw/master/profile/banner.png)](https://typedb.com/docs/typeql/2.x/overview)\n\n[![Factory](https://factory.vaticle.com/api/status/typedb/typeql/badge.svg)](https://factory.vaticle.com/typedb/typeql)\n[![GitHub release](https://img.shields.io/github/release/typedb/typeql.svg)](https://github.com/typedb/typeql/releases/latest)\n[![Discord](https://img.shields.io/discord/665254494820368395?color=7389D8\u0026label=chat\u0026logo=discord\u0026logoColor=ffffff)](https://typedb.com/discord)\n[![Hosted By: Cloudsmith](https://img.shields.io/badge/OSS%20hosting%20by-cloudsmith-blue?logo=cloudsmith\u0026style=flat)](https://cloudsmith.com)\n\n# Introducing TypeQL\n\nTypeQL is the query language of **[TypeDB](https://github.com/typedb/typedb)**.\n\n- **Conceptual and intuitive**. TypeQL is based directly on the [conceptual data model](https://typedb.com/philosophy) of TypeDB. Its queries comprise sequences of statements that assemble into [patterns](https://typedb.com/features#modern-language). This mirrors natural language and makes it easy and intuitive to express even highly complex queries.\n- **Fully declarative and composable**. TypeQL is fully declarative, allowing us to define query patterns without considering execution strategy. The user only composes sets of requirements, and TypeDB finds all matching data to process. \n- **A fully variablizable language**. Any concept in TypeQL has a type, and so any concept in TypeQL can be variablized in a query – even types! This enables TypeQL to express powerful [parametric](https://typedb.com/features#polymorphic-queries) database operations.\n- **Built for consistency**. TypeQL patterns are underpinned by a powerful type system that ensure safety and consistency of database applications.\n\n[//]: # (TODO: Substitute by a \"TypeQL in 20 queries\" or something more newbie-friendly)\nExplore the full range of TypeQL in the [official language reference](https://typedb.com/docs/reference/typeql/).\n\n## A polymorphic query language\n\n### Define types, inheritance, and interfaces\n\nTypeQL features the type system of the [Polymorphic Entity-Relation-Attribute](https://typedb.com/philosophy) (PERA) model: entities are independent concepts, relations depend on role interfaces played by either entities or relations, and attributes are properties with a value that can interface with (namely, be owned by) entities or relations. Entities, relations, and attributes are all considered first-class citizens and can be subtyped, allowing for expressive modeling without the need for normalization or reification.\n\n```typeql\ndefine\n  attribute id value string;\n  attribute email sub id;\n  attribute path sub id;\n  attribute name sub id;\n  \n  entity user,\n    owns email @unique,\n    plays permission:subject,\n    plays request:requestee;\n  entity file,\n    owns path,\n    plays permission:object;\n  entity action,\n    owns name,\n    plays permission:action;\n  \n  relation permission,\n    relates subject,\n    relates object,\n    relates action,\n    plays request:target;\n  relation request,\n    relates target,\n    relates requestee;\n```\n\n\n### Write polymorphic database queries \n\nUse subtyping to query a common supertype and automatically retrieve matching data. Variablize queries to return types, roles, and data. New types added to the schema are automatically included in the results of pre-existing queries against their supertype, so no refactoring is necessary.\n\n```typeql\n# This returns all users of any type\nmatch \n  $user isa user,\n    has full-name $name,\n    has email $email;\n\n# This returns only users who are employees\nmatch \n  $user isa employee,\n    has full-name $name,\n    has email $email,\n    has employee-id $id;\n\n# This returns all users and their type\nmatch \n  $user-type sub user;\n  $user isa $user-type,\n    has full-name $name,\n    has email $email;\n```\n\n## Building queries with ease\n\n### Gain clarity through natural and fully declarative syntax\n\nTypeQL's near-natural syntax and fully declarative properties make queries easily understandable, reducing the learning curve and easing maintenance. This allows you to define query patterns without considering execution strategy. TypeDB's query planner always optimizes queries, so you don't have to worry about the logical implementation.\n\n```typeql\nmatch\n  $kevin isa user, has email \"kevin@typedb.com\";\ninsert\n  $chloe isa full-time-employee,\n    has full-name \"Chloé Dupond\",\n    has email \"chloe@typedb.com\",\n    has employee-id 185,\n    has weekly-hours 35;\n  (employee: $chloe, ceo: $kevin) isa hiring,\n    has date 2023-09-27;\n```\n\n### Develop modularly with fully composable query patterns\n\nTypeDB's TypeQL query language uses pattern matching to find data. Patterns in TypeQL are fully composable. Every complex pattern can be broken down into a conjunction of atomic constraints, which can be concatenated in any order. Any pattern composed of valid constraints is guaranteed to be valid itself, no matter how complex.\n\n```typeql\nmatch \n  $user isa user;\nmatch\n  $user isa user;\n  $user has email \"john@typedb.com\";\nmatch\n  $user isa user;\n  $user has email \"john@typedb.com\";\n  (team: $team, member: $user) isa team-membership;\nmatch\n  $user isa user;\n  $user has email \"john@typedb.com\";\n  (team: $team, member: $user) isa team-membership;\n  $team has name \"Engineering\";\n```\n\n## TypeQL grammar\n\n\u003e Note: All TypeDB Drivers and Tools, including TypeDB Console, accept TypeQL syntax natively through strings without any requirements to install additional TypeQL libraries.\n\u003e TypeQL query builders and TypeQL schema-based ORM code generators are in development.\n\nTo access the most recent TypeQL grammar, see [typeql.pest](rust/parser/typeql.pest).\n\n## Resources\n\n### Developer resources\n\n- Documentation: https://typedb.com/docs\n- Discussion Forum: https://forum.typedb.com/\n- Discord Server: https://typedb.com/discord\n- Community Projects: https://github.com/typedb-osi\n\n### Useful links\n\nIf you want to begin your journey with TypeDB, you can explore the following resources:\n\n* [TypeDB Get Started Guide](https://typedb.com/docs/home/get-started/overview)\n* [TypeDB Academy](https://typedb.com/docs/academy)\n* More on TypeDB's [features](https://typedb.com/features)\n* In-depth dive into TypeDB's [philosophy](https://typedb.com/philosophy)\n* [TypeDB CE repo](https://github.com/typedb/typedb-core)\n* [TypeDB Studio repo](https://github.com/typedb/typedb-studio)\n\n## Contributions\n\nTypeDB and TypeQL are built using various open-source frameworks and technologies throughout its evolution. \nToday TypeDB and TypeQL use\n[RocksDB](https://rocksdb.org),\n[Rust](https://www.rust-lang.org/),\n[pest](https://pest.rs/),\n[Bazel](https://bazel.build),\n[gRPC](https://grpc.io),\nand [ZeroMQ](https://zeromq.org).\n\nThank you!\n\nIn the past, TypeDB was enabled by various open-source products and communities that we are hugely thankful to:\n[Speedb](https://www.speedb.io/),\n[ANTLR](https://www.antlr.org),\n[Apache Cassandra](http://cassandra.apache.org), \n[Apache Hadoop](https://hadoop.apache.org), \n[Apache Spark](http://spark.apache.org), \n[Apache TinkerPop](http://tinkerpop.apache.org),\n[Caffeine](https://github.com/ben-manes/caffeine),\n[JanusGraph](http://janusgraph.org),\nand [SCIP](https://www.scipopt.org).\n\n### Package hosting\nPackage repository hosting is graciously provided by [Cloudsmith](https://cloudsmith.com).\nCloudsmith is the only fully hosted, cloud-native, universal package management solution, that\nenables your organization to create, store and share packages in any format, to any place, with total\nconfidence.\n\n## Licensing\n\nTypeQL grammar and language libraries are provided under the Mozilla Public License 2.0 (MPL 2.0),\nand therefore freely usable without restriction when unmodified.\n\nThe full license can be founder at: [LICENSE](https://github.com/typedb/typeql/blob/master/LICENSE).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftypedb%2Ftypeql","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftypedb%2Ftypeql","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftypedb%2Ftypeql/lists"}