Saturday, November 19, 2011

Link properties in the land of G

Consider the case that some group agrees on a schema property, say e mail. Anything having the e mail schema can be digested by an e mail applications. So they create the schema operator ':'. That becomes an operator, an ontologies in G world can tag thir data as in:
G1 = (email:(mail1,mail2,mail3)
Then any other G colvolving aroung look for mails can search:
G2 = (email:*)

Hey no problem for G, except will we ever try o avoid e mail? Do we want to drop all paths that lead to e mail: Using the not property we have:
G = (!email:.*)

Well, no, we ight say, so then what, how does G deal with the higher binding property of :? The answer is organizing link function by property weights. They have to be ordered according to how heavily they descend relative to other ops.

How's the pointer arithmetic coming?
void gfunction(sqlite3_context* p,int n,sqlite3_value** v) {

int op = sqlite3_value_int(v[0]);
int x = sqlite3_value_int(v[1]);
//printf("gfun: %d %d\n",x,m.self_row);
switch(op) {
case RANK_SELF:
sqlite3_result_int(p, selfrow()+1);
break;
case FILE_VALUE:
sqlite3_result_int(p, prevvalue());
break;
case FILE_POINTER:
sqlite3_result_int(p, prevfile());
break;
}
}

This gfun goes with this t5rigger:
#define TRIGGER_SQL \
"create trigger mytrigger after insert on result "\
"begin "\
"update result set pointer = gfun(PVAL,0) "\
"where rowid = gfun(PROW,0); "\
"end;"

So, you see, anytime we get a new row in the result, the gfuns are called in the proper order to update previous open sets. There are simple math functions, prevfile, get the previous set file pointer (file as in rank and file), then prevvalue gets that prior set updates. Thus g machine keeps all pointers u to date and carries no state information except the last link.

From the point of view of the web, that means boom times. The web now spews key words in nested order, so the structure of data is always and everywhere available to all applications.

For SQL programmers it means that output should be organized by set and descent. Anytime, start a new set, and fill it with arbitrary length descents. Just adding those two properties to output gives applications most of the structure they need.

No comments: