Skip to main content
QUICK REVIEW

[Paper Review] Enabling Cognitive Intelligence Queries in Relational Databases using Low-dimensional Word Embeddings

Rajesh Bordawekar, Oded Shmueli|arXiv (Cornell University)|Mar 23, 2016
Topic ModelingComputer Science28 references11 citations
TL;DR

This paper introduces Cognitive Intelligence (CI) queries that enhance relational databases by embedding database tokens (e.g., column names, row values) into low-dimensional vector spaces using word2vec, enabling semantic similarity and analogy-based queries. The method enables SQL-based querying over semantic relationships via user-defined functions, significantly extending query expressiveness beyond syntactic matching.

ABSTRACT

We apply distributed language embedding methods from Natural Language Processing to assign a vector to each database entity associated token (for example, a token may be a word occurring in a table row, or the name of a column). These vectors, of typical dimension 200, capture the meaning of tokens based on the contexts in which the tokens appear together. To form vectors, we apply a learning method to a token sequence derived from the database. We describe various techniques for extracting token sequences from a database. The techniques differ in complexity, in the token sequences they output and in the database information used (e.g., foreign keys). The vectors can be used to algebraically quantify semantic relationships between the tokens such as similarities and analogies. Vectors enable a dual view of the data: relational and (meaningful rather than purely syntactical) text. We introduce and explore a new class of queries called cognitive intelligence (CI) queries that extract information from the database based, in part, on the relationships encoded by vectors. We have implemented a prototype system on top of Spark to exhibit the power of CI queries. Here, CI queries are realized via SQL UDFs. This power goes far beyond text extensions to relational systems due to the information encoded in vectors. We also consider various extensions to the basic scheme, including using a collection of views derived from the database to focus on a domain of interest, utilizing vectors and/or text from external sources, maintaining vectors as the database evolves and exploring a database without utilizing its schema. For the latter, we consider minimal extensions to SQL to vastly improve query expressiveness.

Motivation & Objective

  • To enable semantic querying in relational databases by capturing meaning of database entities through distributed word embeddings.
  • To address the limitation of traditional SQL in expressing semantic relationships between database entities.
  • To extend database query capabilities beyond syntactic matching to include semantic similarity and analogical reasoning.
  • To design a scalable, extensible framework for integrating learned vector representations into existing relational systems.
  • To demonstrate the feasibility and expressiveness of CI queries using a Spark-based prototype.

Proposed method

  • Extract token sequences from database tables via textification, using views or schema-aware methods to generate context-rich text for training.
  • Apply distributed word2vec to learn low-dimensional (e.g., 200D) vector representations of database tokens from internal or external text.
  • Store learned vectors in system tables for efficient lookup during query execution.
  • Implement semantic similarity and analogy queries using SQL User-Defined Functions (UDFs), such as proximityMAX(), proximityAVG(), and proximityTop2Avg().
  • Support vector reuse and incremental updates to maintain semantic consistency as the database evolves.
  • Extend the framework with external text sources (e.g., Wikipedia) and domain-specific views to improve embedding precision.

Experimental results

Research questions

  • RQ1Can low-dimensional word embeddings effectively capture semantic relationships between database entities such as column names and row values?
  • RQ2How can vector-based semantic similarity be integrated into standard SQL to enable cognitive querying?
  • RQ3What are the performance implications of vector-based querying, particularly in terms of training, storage, and runtime distance computation?
  • RQ4To what extent can CI queries reduce the need for schema knowledge in complex database exploration?
  • RQ5How can vector embeddings be maintained and updated efficiently as the underlying database evolves?

Key findings

  • The use of word2vec on database-derived text sequences successfully generates meaningful low-dimensional vectors that encode semantic relationships between database tokens.
  • CI queries using UDFs like proximityMAX() and proximityAVG() enable effective semantic similarity search, with results sensitive to the choice of distance threshold (e.g., 0.3 or 0.2) and proximity function.
  • Prototype implementation on Apache Spark demonstrates the feasibility of integrating vector-based semantic querying into existing relational systems.
  • Vector-based querying significantly enhances query expressiveness, allowing navigation of large databases with minimal schema knowledge.
  • Performance bottlenecks exist in vector training and distance computation, but can be mitigated via batch processing, indexing, and GPU acceleration.
  • The framework supports extensibility through external text sources and domain-specific views, improving embedding quality and relevance.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.