473,890 Members | 1,354 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

The stupidest design I ever saw

This is a continuation of the old theme, now featuring xml.

<tree>
<node id=0 parent_id=null label='A'>
<node id=1 parent_id=0 label='B'>
<node id=2 parent_id=0 label='C'>
...
</tree>

Apr 5 '06
44 2827
JOG

Andy Dingley wrote:
On 5 Apr 2006 11:17:49 -0700, "Marshall Spight"
<ma************ *@gmail.com> wrote:
the real world is tree structured.


No, the real world is graph structured. Tress are just a limited special
case of graphs.

Another advantage of RDF over XML's data model!


you are joking right?

Apr 6 '06 #11

Marshall Spight wrote:
Joseph Kesselman wrote:
Mikito Harakiri wrote:
<node id=0 parent_id=null label='A'>


Whatever that is, it isn't XML. XML attribute values must be quoted.


Exactly. Once you put quotes around the attribute values, the
design becomes really good, because text based formats are
flexible and nice. You can just put in whatever you want. That's
the right way to manage structured data. "Traditiona l" databases
are no good, because tables are flat, and the real world is tree
structured.


Did you have someone write this post for you, Marshall? Even I
wouldn't make your "the real world is..." statement and some might
expect it from me ;-) Do you want to withdraw it or is that a
statement of faith on your part? --dawn

Apr 6 '06 #12
Andy Dingley wrote:
On 5 Apr 2006 11:17:49 -0700, "Marshall Spight"
<ma************ *@gmail.com> wrote:
the real world is tree structured.


No, the real world is graph structured. Tress are just a limited special
case of graphs.

Another advantage of RDF over XML's data model!


"We learn from history that we learn nothing from history."

This becomes a repetitive theme nowadays.

Apr 6 '06 #13

JOG wrote:
Andy Dingley wrote:
On 5 Apr 2006 11:17:49 -0700, "Marshall Spight"
<ma************ *@gmail.com> wrote:
the real world is tree structured.


No, the real world is graph structured. Tress are just a limited special
case of graphs.

Another advantage of RDF over XML's data model!


you are joking right?


Andy's posting history doesn't leave any doubt that he is serious.
Anyway, the link to RDF turned out to be informative. Here is what I
found:

<rdf:RDF
xmlns:rdf="http ://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:rdfs="htt p://www.w3.org/2000/01/rdf-schema#"
xml:base="http://example.org/schemas/vehicles">

<rdf:Descriptio n rdf:ID="MotorVe hicle">
<rdf:type rdf:resource="h ttp://www.w3.org/2000/01/rdf-schema#Class"/>
</rdf:Description >

<rdf:Descriptio n rdf:ID="Passeng erVehicle">
<rdf:type rdf:resource="h ttp://www.w3.org/2000/01/rdf-schema#Class"/>
<rdfs:subClassO f rdf:resource="# MotorVehicle"/>
</rdf:Description >

<rdf:Descriptio n rdf:ID="Truck">
<rdf:type rdf:resource="h ttp://www.w3.org/2000/01/rdf-schema#Class"/>
<rdfs:subClassO f rdf:resource="# MotorVehicle"/>
</rdf:Description >

<rdf:Descriptio n rdf:ID="Van">
<rdf:type rdf:resource="h ttp://www.w3.org/2000/01/rdf-schema#Class"/>
<rdfs:subClassO f rdf:resource="# MotorVehicle"/>
</rdf:Description >

<rdf:Descriptio n rdf:ID="MiniVan ">
<rdf:type rdf:resource="h ttp://www.w3.org/2000/01/rdf-schema#Class"/>
<rdfs:subClassO f rdf:resource="# Van"/>
<rdfs:subClassO f rdf:resource="# PassengerVehicl e"/>
</rdf:Description >

</rdf:RDF>

The folks who wrote this apparently have no idea that graph is defined
by the set of nodes and edges between them. They wrap their naive
understanding what the graph is into XML cludgy syntax and claim it to
be a superior solution. To what problem may I ask?

Apr 6 '06 #14
Neo
> The folks who wrote this apparently have no idea that graph is defined by the set of nodes and edges between them. They wrap their naive understanding what the graph is into XML cludgy syntax and claim it to be a superior solution.
..
What is the better solution? Could you show it (possibly using the
vehicle classes above)?

Apr 6 '06 #15
JOG
Mikito Harakiri wrote:
JOG wrote:
Andy Dingley wrote:
On 5 Apr 2006 11:17:49 -0700, "Marshall Spight"
<ma************ *@gmail.com> wrote:

>the real world is tree structured.

No, the real world is graph structured. Tress are just a limited special
case of graphs.

Another advantage of RDF over XML's data model!
you are joking right?


Andy's posting history doesn't leave any doubt that he is serious.
Anyway, the link to RDF turned out to be informative. Here is what I
found:

<rdf:RDF
xmlns:rdf="http ://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:rdfs="htt p://www.w3.org/2000/01/rdf-schema#"
xml:base="http://example.org/schemas/vehicles">

<rdf:Descriptio n rdf:ID="MotorVe hicle">
<rdf:type rdf:resource="h ttp://www.w3.org/2000/01/rdf-schema#Class"/>
</rdf:Description >

<rdf:Descriptio n rdf:ID="Passeng erVehicle">
<rdf:type rdf:resource="h ttp://www.w3.org/2000/01/rdf-schema#Class"/>
<rdfs:subClassO f rdf:resource="# MotorVehicle"/>
</rdf:Description >

<rdf:Descriptio n rdf:ID="Truck">
<rdf:type rdf:resource="h ttp://www.w3.org/2000/01/rdf-schema#Class"/>
<rdfs:subClassO f rdf:resource="# MotorVehicle"/>
</rdf:Description >

<rdf:Descriptio n rdf:ID="Van">
<rdf:type rdf:resource="h ttp://www.w3.org/2000/01/rdf-schema#Class"/>
<rdfs:subClassO f rdf:resource="# MotorVehicle"/>
</rdf:Description >

<rdf:Descriptio n rdf:ID="MiniVan ">
<rdf:type rdf:resource="h ttp://www.w3.org/2000/01/rdf-schema#Class"/>
<rdfs:subClassO f rdf:resource="# Van"/>
<rdfs:subClassO f rdf:resource="# PassengerVehicl e"/>
</rdf:Description >

</rdf:RDF>


Don't you just love the way that xml is human readable and
self-describing.

The folks who wrote this apparently have no idea that graph is defined
by the set of nodes and edges between them. They wrap their naive
understanding what the graph is into XML cludgy syntax and claim it to
be a superior solution. To what problem may I ask?


I believe the problem was that semantic network research had finally
come to a sticky end in the AI field, so its proponents had to find a
new home for their nonsense. It seems that with RDF they have indeed
solved this...

Apr 6 '06 #16
Neo wrote:
The folks who wrote this apparently have no idea that graph is defined by the set of nodes and edges between them. They wrap their naive understanding what the graph is into XML cludgy syntax and claim it to be a superior solution.

.
What is the better solution? Could you show it (possibly using the
vehicle classes above)?


To what kind of problem? Do you really insist on vehicle classification
in the first place? You may want spend some time on Bruce Jacobs site
where he advocates that classification system for data management
problems is a poor solution in general.

Note, that I'm not saying that graph related problems don't exist. I
merely challenge their applicability in this case.

Now, storing a graph in the database is no brainer.

table Nodes (
id number,
... -- content
)

table Edges (
tail number,
head number,
... -- more content, if edges are labeled
)

I have two chapters about trees and graphs in my book.
http://www.rampant-books.com/book_20...ing_styles.htm

Apr 6 '06 #17
Marshall Spight wrote:

Once you put quotes around the attribute values, the
design becomes really good,


To everyone who asked: yes, I was joking.
Marshall

Apr 6 '06 #18
Neo
> table Nodes (id number, ... -- content)
table Edges (tail number, head number, ... -- more content, if edges are labeled)


How do I use the above schema to model the vehicle classes shown in the
RDF example given earlier? I still don't see it.

Apr 6 '06 #19

Neo wrote:
table Nodes (id number, ... -- content)
table Edges (tail number, head number, ... -- more content, if edges are labeled)


How do I use the above schema to model the vehicle classes shown in the
RDF example given earlier? I still don't see it.


No, you first please demonstrate that the above classification serves
some useful purpose.

I prefer to write a database schema for cities and travel links
instead. Here we go:

table Cities (
name string
)
table Connections (
tail string,
head string,
distance integer
)

Example query: find the shortest path between two cities.
Surprisingly, it's not easy to express this or parts explosion kind of
query in XQuery (which is allegedly a superior tool for graph/tree
related problems). You can compare XQuery solution

define function total (element PART $part)
returns element PART {
let $subparts := $part/PART/total(.)
return
<PART NAME="$part/@NAME"
COST="$part/@COST + sum($subparts/@COST)">{
$subparts
}</PART>
}

from
http://homepages.inf.ed.ac.uk/wadler...afp-slides.pdf
with SQL (which I just mindlessly copying and pasting from my book
without really making sure they accomplish the same thing):

select leaf, sum(factoredQua ntity) from (
select product(Quantit y) factoredQuantit y,
first(Part) root, last(SubPart) leaf
from AssemblyEdges
connect by prior Part = later SubPart
) where root = 'Bicycle'
group by leaf

Apr 6 '06 #20

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

22
2147
by: Nunaya | last post by:
We have developed two objects called "customer" and "salesrep". For simplicity, assume that these two objects will talk directly to a database. The database has three tables: customers, customersalesreps (allows multiple salesreps to be associated with a customer), and salesreps. The customer object has business rules that allow manipulation of customer information (add,update,delete,select,etc). The salesrep object has business rules...
4
1612
by: Merlin | last post by:
Hi Imagine the following classes (A class diagram will help) BASE, A, B, C, D, E, F, G. A, B, C, D, G inherit from BASE. E, F inherit from D.
8
3776
by: Ash | last post by:
Hello all, I am hoping this is the appropriate newsgroup for a C++ interface design question. I am trying to design an interface for a subscriber to register/deregister handlers for various events. The callbacks specified by the subscriber will be called when the events get trigerred in a different thread. Each event has different kinds of data associated with it. To achieve this I have the following: // The following describes the...
7
1428
by: chrisn | last post by:
Do real developers use the design view? Thought it would be interesting to start a debate on this subject. According to all the MCP materials (yes, I know a bit mickey mouse), the design view is the way to build your ASP.NET pages. Problem is: - it generates goddam awful HTML, certainly not standards-based. - use of absolute positioning and tables for layout.
20
1545
by: Brad Pears | last post by:
I am completely new to vb .net. I am using visual Studio 2005 to redo an Access 2000 application into a .net OO application using SQL Server 2000 - so a complete rewrite and re-thinking of how this app will work. I have NEVER done any OO programming at all although I have used OO techniques in programs of course - just never actually designed the classes etc... So I am just a tad nervous in re-writing this Access application as it is...
17
4871
by: roN | last post by:
Hi, I'm creating a Website with divs and i do have some troubles, to make it looking the same way in Firefox and IE (tested with IE7). I checked it with the e3c validator and it says: " This Page Is Valid XHTML 1.0 Transitional!" but it still wouldn't look the same. It is on http://www.dvdnowkiosks.com/new/theproduct.php scroll down and recognize the black bottom bar when you go ewith firefox(2.0) which isn't there with IE7. Why does...
2
1148
by: John | last post by:
Hi there, I am writing a simple program that will connect to database. Database has 2 tables, let's call them father and child. This is one to many relationship. I would like to create corresponding classes for each table. Each class would have functions Insert, Edit, Delete I would like to find some information how to properly design my classes. I used to program in php and delphi.
23
2452
by: JohnH | last post by:
I'm just recently come to work for an auto brokerage firm. My position involves performing mysterious rites, rituals and magick in order to get information out of their access database. This is due to the fact that the "designer" they hired had an unfortunate ability to tink around with a program far beyond her reach. She had no concept of any of the principles of database design, so what i'm left with is a junkpile. The only reason I...
7
1716
by: Darko | last post by:
Isn't JS the stupidest language? <script> function x() { var i = 2; alert( "i = " + i ); if ( i == 2 ) { var i = 3; alert( "i = " + i );
0
9829
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
11236
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10836
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10926
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7172
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
6064
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4683
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
4278
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3287
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.