|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r78079 - sandbox/icl/libs/xplore/br1/sqlbrowser
From: afojgo_at_[hidden]
Date: 2012-04-19 12:30:16
Author: jofaber
Date: 2012-04-19 12:30:14 EDT (Thu, 19 Apr 2012)
New Revision: 78079
URL: http://svn.boost.org/trac/boost/changeset/78079
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 | 75 +++++++++++++++++++++++++++++++++------
1 files changed, 62 insertions(+), 13 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-19 12:30:14 EDT (Thu, 19 Apr 2012)
@@ -11,7 +11,7 @@
create table ObjectType (key integer primary key, traits integer, name varchar);
create table EdgeType (key integer primary key, refSourceType integer, refRelationType integer, refTargetType integer, name varchar);
create table Vertex (key integer primary key, refObjectType integer, refObject integer);
-create table Edge (key integer primary key, refEdgeType integer, refSourceVertex integer, refTargetVertex integer);
+create table Edge (key integer primary key, refEdgeType integer, refSourceVertex integer, refTargetVertex integer, refObject integer);
create table Object (key integer primary key);
create table Attribute (key integer primary key, name varchar);
create table IntObject (refObject integer, refAttribute integer, value integer, primary key (refObject, refAttribute));
@@ -72,13 +72,16 @@
insert into Vertex values (4, 2, 4);
insert into Vertex values (5, 2, 5);
-insert into Edge values (1, 1, 1, 4);
-insert into Edge values (2, 2, 2, 4);
+insert into Edge values (1, 1, 1, 4, 6);
+insert into Edge values (2, 2, 2, 4, 0);
-- -------------------------------------
-- Dag Related Architecture Linking All
-- D R A C U L A
+-- -------------------------------------------------------
+-- Dag Related Architecture Using Links All over the place
+-- D R A C U L A
create view EdgeTypeCheck as
select
@@ -90,15 +93,61 @@
inner join ObjectType on EdgeType.refTargetType = ObjectType.key
-select
- ObjectType.name as TrgT,
- EdgeType.name
-from EdgeType
- inner join ObjectType on EdgeType.refTargetType = ObjectType.key
--- ---------------------------------------
-select refSourceVertex, VarCharObject.value as Source,
+-- -----------------------------------------------------------------------------
+-- Vertexes
+select Vertex.key as Vtx, Object.key as Obj, ObjectType.Name as Type , Attribute.Name as Attr,
+ VarCharObject.Value as Name, IntObject.value as Year
+from Object
+ inner join Vertex on Vertex.refObject = Object.key
+ inner join ObjectType on Vertex.refObjectType = ObjectType.key
+ inner join Attribute on VarCharObject.refAttribute = Attribute.key
+ inner join VarCharObject on VarCharObject.refObject = Object.key
+ left outer join IntObject on IntObject.refObject = Object.key
+
+-- -----------------------------------------------------------------------------
+-- Edge-Objects and associated values
+select Edge.key as Edg, Object.key as Obj, EdgeType.Name as Type , Attribute.Name as Attr,
+ 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 Attribute on VarCharObject.refAttribute = Attribute.key
+ inner join VarCharObject on VarCharObject.refObject = Object.key
+ left outer join IntObject on IntObject.refObject = Object.key
+
+-- -----------------------------------------------------------------------------
+-- Edges
+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
+
+
+-- -----------------------------------------------------------------------------
+-- Artists
+select Vertex.key as Vtx, Object.key as Obj, VarCharObject.value as Name, IntObject.value as YoBirth
+from Vertex
+ inner join Object on Object.key = Vertex.refObject
+ inner join VarCharObject on Object.key = VarCharObject.refObject and VarCharObject.refAttribute = 1
+ inner join IntObject on Object.key = IntObject.refObject and IntObject.refAttribute = 2
+where
+ Vertex.refObjectType = 1
+
+
+-- -----------------------------------------------------------------------------
+-- Edges 2.
+--
+select refSourceVertex as Src, VarCharObject.value as Source,
(select EdgeType.name from EdgeType where EdgeType.key = Edge.refEdgeType) as Relation,
+ (select IntObject.value
+ from Edge
+ inner join Object on Object.key = Edge.refObject
+ inner join IntObject on Object.key = IntObject.refObject
+ ) as Year,
(select VarCharObject.value
from Edge
inner join Vertex on Vertex.key = Edge.refTargetVertex
@@ -106,9 +155,9 @@
inner join VarCharObject on Object.key = VarCharObject.refObject
) as Target
from Edge
-inner join Vertex on Vertex.key = Edge.refSourceVertex
-inner join Object on Object.key = Vertex.refObject
-inner join VarCharObject on Object.key = VarCharObject.refObject
+ inner join Vertex on Vertex.key = Edge.refSourceVertex
+ inner join Object on Object.key = Vertex.refObject
+ inner join VarCharObject on Object.key = VarCharObject.refObject
Modified: sandbox/icl/libs/xplore/br1/sqlbrowser/objects1.db
==============================================================================
Binary files. No diff available.
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