BIRDS

Putback-based BIdirectional transformation for Relational view update Datalog-based Strategies

View On GitHub Download for Macos Download for Ubuntu

BIRDS

Overview

BIRDS (Putback-based BIdirectional transformation for Relational view update Datalog-based Strategies) is a bidirectional transformation (BX) framework for Relational Database Management Systems (RDBMS). The objective of this framework is to allow programmers to define a relational view in RDBMS by writing an update strategy for it.

View Update Language: Datalog

BIRDS employs and extends the power of Datalog, which is a well known query language in RDBMS, in writing arbitrary update strategies for any relational views to source relations. Based on putback-based BX foundations, BIRDS automatically verifies the validity of a Datalog-written update strategy for a view (Putback direction) and then derive the definition of that view (Get direction) as a query over source relations. Finally, both Datalog-written update strategy and derived view definition are translated to a set of SQL statements with PL/pgSQL procedures, which can run directly in a PostgreSQL ORDBMS to create a new view along with its trigger.

Datalog Syntax for Relational View Update

<program> ::= {<statement>}
<statement> ::= <rule> | <query> | <base_relation>
<rule> ::= <predicate> ":-" <literal> { ("and"| ",") <literal> } "."
<base_relation> ::= "%s:" <predicate> "."
<query> ::= ("%v:" | "?-") <predicate> "."
<literal> ::= | <predicate> | "not" <predicate> | <builtin> | "not" <builtin>
<predicate> ::= [ ("+" | "-") ] <relname> "(" <variable> {"," <variable>} ")"
<builtin> ::= <varname> ("=" | "<>" | "<" | ">" | "<=" | ">=") <const>
<variable> ::= <varname> | <anonvar> | <const>
<varname> ::= 'A'|..|'Z' { ('A'|..|'Z'| '0'|..|'9'|'_') }
<relname> ::= 'a'|..|'z' { ('a'|..|'z'| '0'|..|'9'|'_') }
<anonvar> ::= '_'
<const> ::= <integer> | <float> | <string>

Installation and Usage

Installation

Usage

Tutorials: defining updatable views with Datalog in BIRDS