This package demonstrates a series of abstract interfaces for tabular data structures in Julia. Its objective is to support modularity and extensibility in the development of data management facilities. In particular, we demonstrate support for querying facilities that are generic over the class of so-called column-indexable tabular data structures. The latter are in-memory Julia objects that satisfy the column-indexable interface. The querying interface itself is provided by (code-name) StructuredQueries and extended by the present package.
We take an interface that may be satisfied by a Julia data type T
to include:
T
;T
be defined as a subtype of some abstract type specific to the interface.We say that an interface I includes an interface J if all of the requisite methods (and subtypings) for J are also requisite for I.
The present package defines three interfaces:
AbstractTable
interfaceAbstractTable
s.AbstractTable
interfaceThe basic AbstractTable
interface for a tabular data type T <: AbstractTable
consists of minimalist funtionality concerning only the "schema" of tables of type T <: AbstractTable
; it neither requires nor exposes any methods that depend on specific storage layouts of the data contained in the table.
Requisite methods:
AbstractTables.fields(tbl::T)
AbstractTables.eltypes(tbl::T)
AbstractTables.nrow(tbl::T)
AbstractTables.index(tbl::T)
Provided methods:
AbstractTables.eltypes(tbl::T, fields...)
Base.ndims(tbl::T)
AbstractTables.ncol(tbl::T)
Base.show(tbl::T)
The column-indexable interface is designed to suit tabular data types T <: AbstractTable
for which entire columns can be retrieved as or set from in-memory iterable Julia vector-like objects (If you have suggestions as to how the foregoing chain of adjectives ought to be arranged, please file a PR).
Requisite methods:
AbstractTables.columns(tbl::T)
Base.getindex(tbl::T, field)
Base.setindex!(tbl::T, col, field)
Provided methods:
AbstractTables.eachcol(tbl::T)
AbstractTables.eachrow(tbl::T)
AbstractTables.eachrow(tbl::T, fields...)
The query interface for column-indexable types T <: AbstractTable
leverages the ability to retrieve and set columns represented as in-memory Julia vectors in its extension of the StructuredQueries
Query
framework.
Required methods:
default(tbl::T)
empty(tbl::T)
Provided methods:
collect(Query{T})
09/01/2016
3 months ago
12 commits