Tuesday, December 13, 2011

A SPARQL query

$query = "
SELECT ?person WHERE {
:Alice :knows ?person .
}";
$res = do_query($query);
foreach ($res as $r) {
$person = $r->person->value;
$query = "SELECT ?name WHERE {
?person foaf:name ?name .
} LIMIT 1";
}

How does this translate into Typeface Explosion? I hate to commit, since TE is not yet defined, except that TE is graph traversal. Let me see:

Alice$knows(*,person$name)


The asterisk, in this case means all elements of the set persons. But, is this correct? Doeas that use of asterisk conflict? Dunno, I dunno the specifics of TE, is is mostly an imaginary idea to be filled in by 'the industry'.But, this TE assumes a nearness between schema and data that SPQRQL does not. The subquery is thus implied naturally in the script, in fact, all the machine does is spot subqueries and launch them. There is an implication, if the query takes too long, too often, then query optimizers are constantly on the move, counting click thrus and reorganizing data so next time the click is much more rapid.

But, I guess the industry is splitting, the XML direction and the SQLITE3 direction. Either put everything in browser form and translate each time a machine needs the data, or use the native form of fast data and adapt it on output. It has to be the later, the web is not going to remain a model of independent www servers, it is moving toward a cohesive distributed, autonomous distributed processing environment.

Anyway, I am still waiting a week or so before I dump any code,mainly because I had debugging code, and it makes no sense to do so until Apple, Google, IBM or Microsoft steps up to the plate and gets the problem. I think IBM gets it, I suspect Watson is graph convolution.

No comments: