Monday, May 10, 2010

My database

Searching reams of spreadsheet files, plotting them. Not ready for prime time, but becoming So I am,just now creating id approximations, namely taking chunks of the first few columns and letting the user sort through and search through known list of final data. From SQLite, every thing arriving is a data frame, generally extracted for many databases. and all of it in csv like constructions.

Why approximate searches? Because it relieves the load of managing meta data, all the stuff about exact formats. So, a researcher can throw something from a spread sheet into the search bin, irregularly, not bothering with formal definitions. The mild rule of maximizing entropy a bit, keep the habit of using the left hand columns for data id type information, of generally fewer bytes.

So, in R these become lists of text, best guesses at data, and text look up when the series id is known. But I need tighter SQLite, R integration.

Like this little query just does one of a few query types on a spreadsheet of text describing data, for example.
CREATE VIEW colQuery AS
select f1,f2,f3,f4 from U,words

Where (
(U.w1 = 'OR2' or U.w1 = 'AnY')
and
(words.f2 like U.w2 or words.f2 like U.w3)
or (
(U.w1 = 'AND2'or U.w1 = 'EQU')
and
words.f2 like U.w2 and words.f2 like U.w3
)or(
(U.w1 = 'OR1' or U.w1 = 'EQU')
and words.f1 like U.w2
)or(
(U.w1 = 'OR3' or U.w1 = 'ANY')
and words.f3 like U.w2 )
)
union select * from U
where U.w2 = 'ECHO' ;


No comments: