I think a good first step to improving the database structure is to
use MySQL work bench.
It's available on all the OS's and is very useful for schema comparisons.
I've added a work bench file to project. Unfortunately, the files are
binary so conflicts might be a bore to resolve. While the set of data
that we are working with is small, it's not difficult to have create
and import scripts under SVN as well as the work bench files. If we
start to have a larger set of data on a live system, dropping the
contents of the database ceases to be an option. Updating a live
database with a tool like MySQL WB is probably the best option.
> --
> You received this message because you are subscribed to the Google Groups "oedipus-decision-maker-discuss" group.
> To post to this group, send email to oedipus-decisio...@googlegroups.com.
> To unsubscribe from this group, send email to oedipus-decision-make...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/oedipus-decision-maker-discuss?hl=en.
>
>
--
Rob Impey
That's a interesting point about the groups splitting up or the name
changing. I think that it will be useful to be able to navigate the UI
by a characters involvement in the drama.
>
> I think it's best to proceed as you say, making the character unique
> to the drama, then we can think of a way to link different character's
> in the UI if it becomes desirable, I'm thinking of some kind of [This
> character is an Alias of ....] drop-down, or a [this character is a
> group composed of ...] dialog.
>
>> We should either have a table for notes on a scene and another for
>> notes on a frame, or (my preference) add a nullable column called
>> 'notes' to the scenes and frames tables. We should not add the
>> instructions to the notes when we create the new frame or scene. "No
>> data" should be stored as null. The PHP UI should display instructions
>> if it finds a null in the notes column.
>>
>
> I agree with adding a nullable column to the scenes and frames tables.
> A much better solution. It's interesting to see how I fell into that
> anti-pattern so neatly!
>
I admit that I only saw it because I saw a similar thing at work on Friday.
>
>> The frames tree table is like a doubly linked list. This is not a good
>> way to store sort order data in a table because it is not easy to
>> select the frames of a scene in order. A better approach might be to
>> add a sort order column to the frames table. The value would be unique
>> for each scene. This makes selecting in order the frames of a scene
>> trivial. We could also add such a column to scenes and acts. The
>> problem with this approach is that it means that you have to update
>> all the frames in a scene if you insert a new frame at the beginning
>> of a scene. As the UI only allows us to add frames to the end of a
>> scene, this shouldn't be a problem.
>>
>
> I should point out that the UI will in the future certainly support
> adding intermediary frames. It will also support branching of frames.
> In fact it will be necessary for the frame, act and scene
> representations to support every kind of branching, forking, inserting
> and copying and pasting of any arbitrary selection of nodes to other
> points in the tree or indeed to other dramas. These features will be
> powerful and necessary when creating fictional dramas and modelling
> existing dramas. They are limited at the moment by the necessity of
> creating a workable UI! I've always imagined a SVG/HTML5/JS solution
> to the UI, the one at the moment is not representative of what I think
> can be created.
>
> I suppose a 'sort_order' column approach is out, as it won't support
> branching frames (scenes/acts).
>
We could probably make it work, but it would involve shifting the sort
order of all the frames in the scene after the branch down to start at
zero.
> Bearing this in mind, what do you think will be the best
> representation? I'm sure what we've got at the moment is not the best
> method. It's true that selecting the frames (scenes/acts) in order
> will be the most common operation, but all of the moving nodes about
> will be quite common as well.
There's no simple answer to the question about what data structure to
choose. Normally there is a compromise for any of the choices. My
guess would be that selecting will be the more frequently performed
operation.
>
>> The doubt column in the stated intentions table should probably be an
>> enum or a look up table.
>>
>
> Yes. In fact the position columns in the stated_intentions and
> positions tables should be an enum (or look-up table) also.
>
>> We should make greater use of views and stored routines.
>>
>
> I'm not sure what you mean!
We could use a view for the select statement for accessing the frames at:
http://dev.mysql.com/doc/refman/5.1/en/create-view.html
We could use a stored routine for operations like adding a frame or branching.
http://dev.mysql.com/doc/refman/5.1/en/stored-routines.html
We can survive perfectly well without them, but they allow us to lock
down the spec of the system.
>
>> Looking at the database of this project, I wonder if drama theory can
>> be expressed entirely in SQL. I believe that it can. This should
>> probably be the line of attack that we take before we do much more
>> work on the UI.
>
> Yes. I agree with this totally. I'm sure it can be expressed in SQL. I
> unfortunately didn't bring the original spec for the project out with
> me, but when I get back next month I will type it up and put it
> online. As a mathematical specification of the oedipus engine it will
> be a useful reference.
>
I'll look forward to it.
I wonder how many other game theory-like systems have been codified in
SQL. SQL is a set based language. Can drama theory be expressed
completely in set theory?
Rob