Valentina DB 4.1 Introduces Groundbreaking SQL Feature

David Bovill david.bovill at gmail.com
Thu Apr 23 12:50:15 EDT 2009


2009/4/22 Ruslan Zasukhin <sunshine at public.kherson.ua>

> On 4/22/09 5:33 PM, "David Bovill" <david.bovill at gmail.com> wrote:
>
> > At the moment we can only search for attributes in XML and loop through
> > other hierarchical data structures (ie arrays or XML with  our own
> recursive
> > algorithms) - having a robust SQL like query language to search and
> retrieve
> > data in arbitrary XML documents sounds too good to be true - even if we
> > can't do cyclical graphs yet :)
>
> I afraid I do not see deeply your idea yet.
>
> What other searches except attributes, you may want to do on such data?


Take a recent example that we can't do in Rev yet - search and arbritary
xHTML document and pull out all the <table> elements. We can search for XML
attributes, but not named tags such as table elements.

I could see wanting to take this further, to search a whole bunch of xHTML
pages for tables with certain values in them, which would mean again not
searching for XML attributes bu seaching first for <table> tags and then the
content of say a <td> element with a given value, perhaps in a column with a
<th> element "Amount".


> Well, I can guess just analyze data.
> And XML here was only container to bring data to DB.
> Right?


Yes - often it would be to be to import data into db, then be able to
analyze and export back out as XML for various "views" pf data (although in
the more general case I am looking for a data structure which can be
dynamically created and then analyzed in the language and not necessarliy
stored).

---------
> about cyclical graphs
>
> Here important just to be able recognize a circle and stop move by it,
> instead keep move down/up?
>
> If yes, then I think this is very easy.
>
> But will be good to hear examples from you on this. And more detailed
> explains.


A lot of what I work on now is related to social networks. The relationships
are clearly not hierarchical. Nodes of the graph can represent individuals
or groups that are connected to each other by typed links. Individuals and
groups have properties, and can be modeled as nodes in a network. I often
use graph layout algorithms to visualise these networks, and add tools that
allow data to flow from a given point across the interconnections in the
network.

An example therefore would be to search this network from a given node for
lets say 10 iterations, to retrieve the value of a particular field, so that
an average can be calculated for the individuals that the given node is
connected to. You'd want to avoid recounting nodes in cases where cyclic
loops of relationships occurred. In this case I think - yes - all you would
want to do is "recognize a circle and stop move by it".

I'd often also want to retrieve the number of steps / recursions away from
the starting node, along side the data retrieved from that node (the
equivalent of retrieving the level down the hierarchical tree searched).
This info may be used to weight the average so that nodes closer are
weighted more highly for instance.

Hope the example is clear :)



More information about the use-livecode mailing list