Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r78089 - sandbox/icl/libs/xplore/br1/sqlbrowser
From: afojgo_at_[hidden]
Date: 2012-04-20 06:36:41


Author: jofaber
Date: 2012-04-20 06:36:40 EDT (Fri, 20 Apr 2012)
New Revision: 78089
URL: http://svn.boost.org/trac/boost/changeset/78089

Log:
Building example Dag. Checking queries.
Binary files modified:
   sandbox/icl/libs/xplore/br1/sqlbrowser/objects1.db
Text files modified:
   sandbox/icl/libs/xplore/br1/sqlbrowser/TypeExtensibleDag.sql | 67 ++++++++++++++++++-
   sandbox/icl/libs/xplore/br1/sqlbrowser/browserwidget.ui | 140 ++++++++++++++++++---------------------
   sandbox/icl/libs/xplore/br1/sqlbrowser/sqlbrowser4.pro | 6 -
   3 files changed, 129 insertions(+), 84 deletions(-)

Modified: sandbox/icl/libs/xplore/br1/sqlbrowser/TypeExtensibleDag.sql
==============================================================================
--- sandbox/icl/libs/xplore/br1/sqlbrowser/TypeExtensibleDag.sql (original)
+++ sandbox/icl/libs/xplore/br1/sqlbrowser/TypeExtensibleDag.sql 2012-04-20 06:36:40 EDT (Fri, 20 Apr 2012)
@@ -35,11 +35,14 @@
 insert into ObjectType values (7, 2, 'r:performed');
 insert into ObjectType values (8, 2, 'r:recorded as');
 insert into ObjectType values (9, 2, 'r:located at');
+insert into ObjectType values (10, 0, 'c:album');
+insert into ObjectType values (11, 2, 'r:contains');
 
 insert into EdgeType values (1, 1, 6, 2, 'artist composed title' );
 insert into EdgeType values (2, 1, 7, 3, 'artist performed record' );
 insert into EdgeType values (3, 2, 8, 3, 'title recorded as record');
 insert into EdgeType values (4, 3, 9, 4, 'record located at url' );
+insert into EdgeType values (5, 10, 11, 3, 'album contains record' );
 
 insert into Object values (0);
 
@@ -60,20 +63,42 @@
 insert into VarCharObject values (5, 1, "Body & Soul");
 
 insert into Object values (6);
-insert into VarCharObject values (6, 1, "composed in 2001");
+insert into VarCharObject values (6, 1, "composed in 1995");
 
 insert into Object values (7);
 insert into VarCharObject values (7, 1, "composed in 1930");
 
+insert into Object values (8);
+insert into VarCharObject values (8, 1, "N&tC: Twighlight Song");
+
+insert into Object values (9);
+insert into VarCharObject values (9, 1, "N&tC: Body & Soul");
+
+insert into Object values (10);
+insert into VarCharObject values (10, 1, "Night & the City");
+
+
 insert into Vertex values (0, 0, 0);
 insert into Vertex values (1, 1, 1);
 insert into Vertex values (2, 1, 2);
 insert into Vertex values (3, 1, 3);
 insert into Vertex values (4, 2, 4);
 insert into Vertex values (5, 2, 5);
+insert into Vertex values (8, 3, 8);
+insert into Vertex values (9, 3, 9);
+insert into Vertex values (10, 3, 10);
 
 insert into Edge values (1, 1, 1, 4, 6);
-insert into Edge values (2, 2, 2, 4, 0);
+-- 2:key 1:composed 3:J.Green 5:Body&Soul 7:comp1930
+insert into Edge values (2, 1, 3, 5, 7);
+
+-- 3:key 2:performed 2:K.Barron 10:N&tC 11:rec1996
+insert into Edge values (3, 2, 2, 10, 11);
+-- 4:key 7:performed 1:C.Haden 10:N&tC
+insert into Edge values (4, 2, 1, 10, 11);
+
+insert into Object values (11);
+insert into VarCharObject values (11, 1, "recoreded 1996");
 
 
 -- -------------------------------------
@@ -83,6 +108,8 @@
 -- Dag Related Architecture Using Links All over the place
 -- D R A C U L A
 
+-- -----------------------------------------------------------------------------
+-- Check for EdgeTypes
 create view EdgeTypeCheck as
 select
   (select ObjectType.name from ObjectType where ObjectType.key = EdgeType.refSourceType) as SrcT,
@@ -92,6 +119,13 @@
 from EdgeType
   inner join ObjectType on EdgeType.refTargetType = ObjectType.key
   
+-- -----------------------------------------------------------------------------
+-- Named Objects
+create view NamedObjects as
+select Object.key as Obj, VarCharObject.value as Name
+from Object
+ inner join VarCharObject on VarCharObject.refObject = Object.key
+
 
   
 -- -----------------------------------------------------------------------------
@@ -118,12 +152,37 @@
 
 -- -----------------------------------------------------------------------------
 -- Edges
-select Edge.key as Edg, Object.key as Obj, EdgeType.Name as Type
- VarCharObject.Value as Name, IntObject.value as Year
+select Edge.key as Edg, Object.key as Obj, EdgeType.Name as Type,
+ VarCharObject.value as Name, IntObject.value as Year
+from Object
+ inner join Edge on Edge.refObject = Object.key
+ inner join EdgeType on Edge.refEdgeType = EdgeType.key
+ inner join VarCharObject on VarCharObject.refObject = Object.key
+ left outer join IntObject on IntObject.refObject = Object.key
+
+-- -----------------------------------------------------------------------------
+-- EdgesMinimal
+create view EdgesMinimal as
+select SrcName.Value as Source, EdgeType.Name as Type, TrgName.Value as Target
+from Object
+ inner join Edge on Edge.refObject = Object.key
+ inner join EdgeType on Edge.refEdgeType = EdgeType.key
+ inner join VarCharObject on VarCharObject.refObject = Object.key
+ inner join VarCharObject as SrcName on Edge.refSourceVertex = SrcName.refObject
+ inner join VarCharObject as TrgName on Edge.refTargetVertex = TrgName.refObject
+
+-- -----------------------------------------------------------------------------
+-- EdgesComplete
+select Edge.key as Edg, Object.key as Obj, EdgeType.Name as Type,
+ VarCharObject.value as Name, IntObject.value as Year,
+ Edge.refSourceVertex as Src, SrcName.Value,
+ Edge.refTargetVertex as Trg, TrgName.Value
 from Object
   inner join Edge on Edge.refObject = Object.key
   inner join EdgeType on Edge.refEdgeType = EdgeType.key
   inner join VarCharObject on VarCharObject.refObject = Object.key
+ inner join VarCharObject as SrcName on Edge.refSourceVertex = SrcName.refObject
+ inner join VarCharObject as TrgName on Edge.refTargetVertex = TrgName.refObject
   left outer join IntObject on IntObject.refObject = Object.key
   
 

Modified: sandbox/icl/libs/xplore/br1/sqlbrowser/browserwidget.ui
==============================================================================
--- sandbox/icl/libs/xplore/br1/sqlbrowser/browserwidget.ui (original)
+++ sandbox/icl/libs/xplore/br1/sqlbrowser/browserwidget.ui 2012-04-20 06:36:40 EDT (Fri, 20 Apr 2012)
@@ -7,7 +7,7 @@
     <x>0</x>
     <y>0</y>
     <width>850</width>
- <height>516</height>
+ <height>605</height>
    </rect>
   </property>
   <property name="windowTitle">
@@ -602,7 +602,7 @@
    <item>
     <widget class="QGroupBox" name="groupBox">
      <property name="sizePolicy">
- <sizepolicy hsizetype="Preferred" vsizetype="MinimumExpanding">
+ <sizepolicy hsizetype="Expanding" vsizetype="MinimumExpanding">
        <horstretch>0</horstretch>
        <verstretch>0</verstretch>
       </sizepolicy>
@@ -616,80 +616,68 @@
      <property name="title">
       <string>SQL Query</string>
      </property>
- <widget class="QTextEdit" name="sqlEdit">
- <property name="geometry">
- <rect>
- <x>9</x>
- <y>9</y>
- <width>816</width>
- <height>127</height>
- </rect>
- </property>
- <property name="sizePolicy">
- <sizepolicy hsizetype="Expanding" vsizetype="MinimumExpanding">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="minimumSize">
- <size>
- <width>0</width>
- <height>18</height>
- </size>
- </property>
- <property name="baseSize">
- <size>
- <width>0</width>
- <height>120</height>
- </size>
- </property>
- </widget>
- <widget class="QWidget" name="">
- <property name="geometry">
- <rect>
- <x>10</x>
- <y>140</y>
- <width>811</width>
- <height>29</height>
- </rect>
- </property>
- <layout class="QHBoxLayout" name="horizontalLayout">
- <item>
- <spacer>
- <property name="orientation">
- <enum>Qt::Horizontal</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>40</width>
- <height>20</height>
- </size>
- </property>
- </spacer>
- </item>
- <item>
- <widget class="QPushButton" name="submitButton">
- <property name="text">
- <string>&amp;Submit</string>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QPushButton" name="clearButton">
- <property name="text">
- <string>&amp;Clear</string>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QPushButton" name="scriptButton">
- <property name="text">
- <string>&amp;Run Script</string>
- </property>
- </widget>
- </item>
- </layout>
- </widget>
+ <layout class="QVBoxLayout" name="verticalLayout">
+ <item>
+ <widget class="QTextEdit" name="sqlEdit">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Expanding" vsizetype="MinimumExpanding">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>0</width>
+ <height>18</height>
+ </size>
+ </property>
+ <property name="baseSize">
+ <size>
+ <width>0</width>
+ <height>120</height>
+ </size>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout">
+ <item>
+ <spacer>
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QPushButton" name="submitButton">
+ <property name="text">
+ <string>&amp;Submit</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QPushButton" name="clearButton">
+ <property name="text">
+ <string>&amp;Clear</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QPushButton" name="scriptButton">
+ <property name="text">
+ <string>&amp;Run Script</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ </layout>
     </widget>
    </item>
   </layout>

Modified: sandbox/icl/libs/xplore/br1/sqlbrowser/objects1.db
==============================================================================
Binary files. No diff available.

Modified: sandbox/icl/libs/xplore/br1/sqlbrowser/sqlbrowser4.pro
==============================================================================
--- sandbox/icl/libs/xplore/br1/sqlbrowser/sqlbrowser4.pro (original)
+++ sandbox/icl/libs/xplore/br1/sqlbrowser/sqlbrowser4.pro 2012-04-20 06:36:40 EDT (Fri, 20 Apr 2012)
@@ -13,13 +13,11 @@
     dagmodel.h \
     StringVisitor.h \
     Dag.h \
- CreatorVisitor.h \
- exttreeview.h
+ CreatorVisitor.h
 SOURCES = main.cpp browser.cpp connectionwidget.cpp qsqlconnectiondialog.cpp \
     exttableview.cpp \
     dagitem.cpp \
- dagmodel.cpp \
- exttreeview.cpp
+ dagmodel.cpp
 
 FORMS = browserwidget.ui qsqlconnectiondialog.ui
 build_all:!build_pass {


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk