TypeDB

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
Original author(s)Haikal Pribadi
Developer(s)Vaticle
Initial release9 September 2016 (2016-09-09)
Stable release
2.17.0 / 27 April 2023 (2023-04-27)[1]
Repositorygithub.com/vaticle/typedb
Written inJava[2]
Operating systemCross-platform
LicenseAGPL 3.0
Websitevaticle.com

TypeDB provides a way to describe the logical structures of data, which allows the tool to validate that code inserts and queries data correctly. Query validation goes beyond static type-checking, and includes logical validation of meaningless queries. TypeDB also encodes data for logical interpretation by a reasoning engine and enables type-inference and rule-inference, which create logical abstractions of data. This can allow for the discovery of facts and patterns that may otherwise be hard to find.

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 allows users to leverage the full expressivity of the ER model, and describe schemas 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 behaviours and properties of their supertypes. 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

Read queries executed on TypeDB go through a type resolution process. This process not only can optimise a query's execution, but also acts as a static type checker to reject meaningless and unsatisfiable queries, which are likely to be user errors.

Logical inference

Rules[5]

TypeDB allows users to define rules in their schemas. This extends the expressivity of a model as it enables a system to derive new conclusions when a certain logical form in a dataset is satisfied. Like functions in programming, rules can chain onto one another, creating abstractions of behaviour at the data level.

Inference

TypeDB's inference facility translates one query into all of its possible interpretations. This happens through two mechanisms: type-based inference and rule-based inference. This derives new conclusions and uncovers hidden relationships, and also enables the abstraction of complex patterns into simple 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 generalises 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

  1. "Releases · vaticle/typedb". github.com. Retrieved 2022-05-26.
  2. "TypeDB System Properties".
  3. 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)
  4. 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.
  5. "Inference in TypeDB". blog.typedb.com. 3 October 2022.
  6. "Hyper-relation - UNL Wiki". www.unlweb.net.
  7. "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
This article is issued from Wikipedia. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.