On Mon, 10 Nov 2014 21:34:27 +0100
Fidel N <fidelpe...@gmail.com> wrote:

> >
> > Leo scripts are attractive because they have such easy access to
> > both outline data *and* its structure.  This suggest "driving" the
> > script from the outline data, which is really what the rst3 command
> > does.  Perhaps you can devise a simpler way to drive the script
> > from outline data..
> 
> I am currently studying Database and XML standards history among other
> things, (which never did before) and I realized that Leo database
> structure is not the most modern one.
> 
> Codd's relational databases are the most widely used ones, and that

Had to Google that :-) I think for "Codd's relational databases" you
could write "relational databases" - it seems like Codd was responsible
for codifying the ideas we call "relational databases" now.

There's been work with Leo and databases before, Leo's data can be
expressed in a couple of tables:

The Nodes table:
  NodeID ID,
  Header Text, 
  Body Text

and the Links table:
  ParentNodeID ID,
  ChildNodeID ID,
  ChildPosition Int

(ignoring "unknownAttributes" for simplicity, and the fluff in the XML
for expanded nodes and last selected node.)

ParentNodeId and ChildNodeID would both have to reference NodeID.

Clones occur when the same NodeID occurs as the ChildNodeID in
more than one Link record.

This DB structure can represent loops which Leo can't handle, but
specifying that they can't exist is probably beyond the scope of an
RDBMS.

It's pretty trivial to translate Leo's data structure to these tables,
and it's been investigated for various applications (lazy loading,
collaboration) in the past.

I'm not sure if you've looked at Tree structures in RDBMSs yet, but
they are somewhat more cumbersome to handle than other data types,
because of the recursion needed to process them.  So even with a RDMS
as a back end, you probably end up with an iterator layer similar to
Leo's iterators.

Leo's XML doesn't have an XML-Schema definition, but it's fairly
simple, and if you use Leo's Python API (which is its only API :-) you
don't need to deal with it.

Leo's data structure is basically the Nodes and Links tables I
mentioned above, so there's no simple way to map arbitrary data into it
other than what works best for a particular application.  The
unknownAttributes v.u dict can be used for storing record like info. on
Leo nodes if that helps.

It's interesting to think about Leo from a RDMS point of view, but an
strong example of improvement to Leo by using one has never really
been put forward.  Do you have a particular example in mind?

Cheers -Terry

> is for a reason (which I didnt imagine before having to study them
> hehe) Also, I have been reading a lot about XML, and how businesses
> use it as standard for sharing businesses information and processes.
> 
> So if you think about two of the most  successful ways to share
> information and business processes, they have both:
> - Extreme standardization for data structures and types definition
> (XML, with the XML Schemas)
> - Easiness to spread the data away from the information structure
> (Relational databases)
> 
> Until Leo cant take the best of those two worlds, I think we will be
> tied to have the same problems that our ancestors had when they used
> earlier databases to the relational model suggested by Codd. There is
> simply no way to separate the information away from the outlined data
> structure.
> 
> It was very enlightening to watch how normal forms are defined for
> data structures <https://www.youtube.com/watch?v=x9BuWCUQawY>, and
> then again that made me think my life-long strugle to be able to
> embed my data into Leo with complete flexibility will fail, same as
> previous-to-Codd database structures did.
> 
> Nevertheless, after the exams I intend to do, I will go on with the
> research for this. Sorry if I said something out of ignorance, this is
> still a very new ground for me.
> 
> 
> On Mon, Nov 10, 2014 at 8:30 PM, Kent Tenney <kten...@gmail.com>
> wrote:
> 
> > I was wondering if there exists a syntax to describe a
> > tree structure in a node, like:
> >
> > #headline
> > @tree myproject
> >
> > #body
> > @auto index.html
> > @path style
> >     @auto main.css
> >     @auto simple.css
> >  @path js
> >      @auto model.js
> >      @auto view.js
> >      @auto controller.js
> >
> > ...
> >
> > such that an rclick on @tree, or a command, would  create
> > the defined paths and files, sort of inverted active-path.
> >
> >
> >
> > On Mon, Nov 10, 2014 at 12:49 PM, Edward K. Ream
> > <edream...@gmail.com> wrote:
> > > On Mon, Nov 10, 2014 at 12:34 PM, Fidel N <fidelpe...@gmail.com>
> > > wrote:
> > >
> > >> I have been trying to define tree-structures-templates ever
> > >> since I got into Leo. Always trying to create
> > >> useful-for-more-than-myself templates. But the problem is what
> > >> Terry just said, I often found it very difficult to find the
> > >> "sweet spot", in which they are easy to document and
> > understand,
> > >> and useful to you.
> > >> That can only be solved through experience on what you want, and
> > >> most of the times everyone's needs will be different so I guess
> > >> that answers to
> > why
> > >> you cant find many Leo files with templates to do cool things
> > >> with them
> > :P
> > >
> > >
> > > Very interesting direction this discussion is taking.
> > >
> > > Before offering my two cents, you should be aware that I know
> > > very little about django, python web framework or even sphinx.  I
> > > use sphinx in a stylized way, after creating rST .txt files.
> > >
> > > With this caveat, my opinion is that Leo scripts offer the
> > > ultimate in flexibility.  That's a mixed blessing: it's easy to
> > > go overboard, as the code for the rst3 command in leoRst.leo
> > > shows.
> > >
> > > Leo scripts are attractive because they have such easy access to
> > > both outline data *and* its structure.  This suggest "driving"
> > > the script from the outline data, which is really what the rst3
> > > command does.  Perhaps
> > you
> > > can devise a simpler way to drive the script from outline data...
> > >
> > > Edward
> > >
> > > --
> > > You received this message because you are subscribed to the
> > > Google Groups "leo-editor" group.
> > > To unsubscribe from this group and stop receiving emails from it,
> > > send an email to leo-editor+unsubscr...@googlegroups.com.
> > > To post to this group, send email to leo-editor@googlegroups.com.
> > > Visit this group at http://groups.google.com/group/leo-editor.
> > > For more options, visit https://groups.google.com/d/optout.
> >
> > --
> > You received this message because you are subscribed to the Google
> > Groups "leo-editor" group.
> > To unsubscribe from this group and stop receiving emails from it,
> > send an email to leo-editor+unsubscr...@googlegroups.com.
> > To post to this group, send email to leo-editor@googlegroups.com.
> > Visit this group at http://groups.google.com/group/leo-editor.
> > For more options, visit https://groups.google.com/d/optout.
> >
> 

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To post to this group, send email to leo-editor@googlegroups.com.
Visit this group at http://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.

Reply via email to