Original author(s) | Haikal Pribadi |
---|---|
Developer(s) | Vaticle |
Initial release | 9 September 2016 |
Stable release | 2.26.3
/ 9 January 2024[1] |
Repository | github |
Written in | Java[2] |
Operating system | Cross-platform |
License | AGPL 3.0 |
Website | vaticle |
TypeDB is an open-source, distributed, strongly-typed database with a logical type system.[3] TypeQL is its query language. TypeDB models domains based on logical and object-oriented programming principles, composed of entity, relationship, and attribute types, as well as type hierarchies, roles, and rules.
TypeDB provides means to describe the logical structures of data. This capability enables the tool to validate both code insertions and data queries for correctness. Query validation extends beyond static type-checking and encompasses the logical validation of queries to eliminate meaningless ones. TypeDB also encodes data for logical interpretation by a reasoning engine, facilitating type-inference and rule-inference processes that generate logical abstractions of data. These functionalities aid in the discovery of facts and patterns that might be challenging to uncover through other means.
TypeDB is developed by Vaticle Ltd. and is published under the GNU Affero General Public License. Vaticle was previously known as Grakn Labs; TypeDB as Grakn; and TypeQL as Graql.
Main features
Expressivity
- Entity-Relationship Model
TypeDB allows users to model their domains using the entity-relationship (ER) model. It is composed of entity types, relation types, and attribute types, with the introduction of role types. TypeDB empowers users to harness the complete expressiveness of the Entity-Relationship (ER) model, enabling them to describe schemas with precision through first normal form.[4]
- Type Hierarchies
TypeDB allows users to model type inheritance into their domain model. Following logical and object-oriented principles, TypeDB allows data types to inherit the behaviors and properties of their super types. Complex data structures become reusable, and data interpretation becomes richer through polymorphism.
- N-ary Relations
Relations often aren't just binary connections between two things. In complicated systems, three or more things can be related with each other at once. Representing them as separate binary relationships would cause a user to lose information. TypeDB can represent an arbitrary number of things as one relation.
- Nested Relations
Relations are concepts used to describe the association between two or more things. Sometimes, things can be relations themselves. TypeDB can represent such a structure, as it enables relations to be nested in another relation, allowing a user to express their system's model in a natural form.
Safety
- Logical Data Validation
Inserted data gets validated beyond static type-checking of attribute value types. Entities are validated to only have the correct attributes, and relations are validated to only relate things that are logically allowed. TypeDB performs validation of inserted entities and relations by evaluating the polymorphic types of the things involved.
- Logical Query Validation
Queries executed on TypeDB undergo a type resolution process. This process not only optimizes query execution but also serves as a static type checker. Its role is to identify and reject queries that are meaningless or unsatisfiable, often indicating user errors.
Logical inference
- Rules[5]
TypeDB allows users to define rules within their schemas. This feature enhances the expressiveness of the model by enabling the system to derive new conclusions when specific logical conditions within a dataset are satisfied. Similar to functions in programming, rules can be chained together, allowing the creation of abstractions related to data-level behaviors.
- Inference
TypeDB's inference capabilities encompass the translation of a single query into all its potential interpretations. This occurs through two key mechanisms: type-based inference and rule-based inference. These processes yield fresh insights, reveal concealed relationships, and facilitate the simplification of intricate patterns into straightforward queries.
Architecture
TypeDB is composed of two parts: TypeDB the storage, and TypeQL the language.
TypeDB
TypeDB is a database with a rich and logical type system. Under the hood, TypeDB has built an expressive type system with a transactional query interface. TypeDB’s type system is based on hypergraph theory, a subfield in mathematics that generalizes an edge to be a set of vertices.[6] The hypergraph data structure itself is represented in the form of key-value pairs and persisted on a distributed NoSQL database, RocksDB. Using the Raft algorithm, TypeDB provides a distributed system designed to be shared and replicated over a network of computers.
TypeQL
TypeQL is TypeDB’s declarative reasoning (through OLTP) query language that creates a higher level abstraction over complex relationships. TypeQL allows users to derive implicit information that is hidden in a dataset, as well as reduce the complexity of that information.
Licensing
TypeDB is available in two versions: an open source version and a commercial version (TypeDB Cluster). The open source version is available for free under the GNU Affero General Public License, version 3. It is limited to running on one node only due to the lack of clustering and comes without security.
The commercial product, TypeDB Cluster, allows for high-availability, horizontal scalability and security.[7] TypeDB Cluster is available under a closed-source Commercial license.
References
- ↑ "Releases · vaticle/typedb". GitHub.
- ↑ "TypeDB System Properties".
- ↑ Barolli, Leonard; Terzo, Olivier (2017-07-04). Complex, intelligent, and software intensive systems : proceedings of the 11th International Conference on Complex, Intelligent, and Software Intensive Systems (CISIS-2017). Cham. ISBN 9783319615660. OCLC 992988924.
{{cite book}}
: CS1 maint: location missing publisher (link) - ↑ Messina, Antonio; Pribadi, Haikal; Stichbury, Jo; Bucci, Michelangelo; Klarman, Szymon; Urso, Alfonso (2017-07-10). "BioGrakn: A Knowledge Graph-Based Semantic Database for Biomedical Sciences". Complex, Intelligent, and Software Intensive Systems. Advances in Intelligent Systems and Computing. Vol. 611. Springer, Cham. pp. 299–309. doi:10.1007/978-3-319-61566-0_28. ISBN 978-3-319-61565-3.
- ↑ "Inference in TypeDB". blog.typedb.com. 3 October 2022.
- ↑ "Hyper-relation - UNL Wiki". www.unlweb.net.
- ↑ "Introduction to TypeDB Cluster". blog.vaticle.com. 21 March 2022.
Bibliography
- Malewicz, Grzegorz; Austern, Matthew H.; Bik, Aart J.C; Dehnert, James C.; Horn, Ilan; Leiser, Naty; Czajkowski, Grzegorz (2010), "Pregel", Proceedings of the 2010 ACM SIGMOD International Conference on Management of data, SIGMOD '10, New York, NY, USA: ACM, pp. 135–146, doi:10.1145/1807167.1807184, ISBN 9781450300322, S2CID 53034533