hierarchical-data

Hierarchical Data Models: Adjacency List vs. Nested Sets

I have a product catalog. Each category consists of different number (in deep) of subcategories. The number of levels (deep) is unknown, but I quite sure that it will not be exceed of 5,6 levels. The data changes are much more rarely then reads. The question is: what type of hierarchical data model is more suitable for such situation. T...

MySQL parent -> child query

Hello, I'm working with mySQL, and I'm in a situation where I need to select data from one table that matches an ID at any level in parent -> child data hierarchy in the other table. Further more, I would like to resolve this with a well written SQL query, rather than a recursive function in my PHP code, as this feature will be used qu...

C# algorithm for generating hierarchy

I've got a text file that looks like this: { Id = 1, ParentId = 0, Position = 0, Title = "root" } { Id = 2, ParentId = 1, Position = 0, Title = "child 1" } { Id = 3, ParentId = 1, Position = 1, Title = "child 2" } { Id = 4, ParentId = 1, Position = 2, Title = "child 3" } { Id = 5, ParentId = 4, Position = 0, Title = "grandchild 1" } I...

Sum of hierarchical data using LINQ?

Is it possible to sum hierarchical data using .NET's LINQ? My data class looks like this: class Node { public decimal Amount; public IEnumerable<Node> Children { get; set; } } So I would have some data looks like this, but the tree could of course be arbitrarily deep. var amounts = new Node { Amount = 10; Children = ...

[Flex] parent data calculated from children fields in hierarchical data structure

Hello! In flex 3 I have a hierarchical data structure. I would like to display the content of it in a tree. My problem is that I have nodes which data calculated from children nodes. How to structure the hierarchy to make automatic changes to those parent nodes, if their children's data changed? For example: Every node has a warning f...

Storing hierarchical data in Google App Engine Datastore?

Can someone illustrate how I can store and easily query hierarchical data in google app engine datastore? ...

Accessible navigation of large information trees

I am developing a public website which is the front end to information about medical conditions. After the user does a search (questionnaire based) they are presented with the results which are categorised in to sections and sub-sections. Information items can be assigned to both sections and sub-sections. At the moment sections are...

How to bind a dataset with multiple tables to asp.net treeview control?

Hello All, I have a tree view control which I have to bind a dataset with multiple data tables in it, and have relations between them. can you suggest how can I do that, I have tried many ways but none of them proved useful... Thanks ...

How can I visualise a "broken" hierarchical dataset?

I have a reasonably large datatable structured something like this: StaffNo Grade Direct Boss2 Boss3 Boss4 Boss5 Boss6 ------- ----- ----- ----- ----- ----- ----- ----- 10001 1 10002 10002 10057 10094 10043 10099 10002 2 10057 NULL 10057 100...

Hierarchical Databinding with Linq to SQL

I am attempting what I think is a rather simple databinding scenario with Linq To SQL. I have a table of FacultyMembers, whose schema looks something like this: FacultyMemberID - int PK Name - nvarchar UniversityID - int FK to University table and so forth. There are various other string properties. I generate LTS DataClasses. I dr...

Hierarchical Data in MySQL

I've got a sort of tree like thing going on in my MySQL database. I have a database that has categories, and each category has a subcat. I'm keeping all the categories in one table, so the columns are like this: *categories table* id | name | parent_id 1 | Toys | 0 2 | Dolls | 1 3 | Bikes | 1 Each item in my database is assigned...

Multiple tables in nested sets hierarchy

I have a number of distinct items stored in different MySQL tables, which I'd like to put in a tree hierarchy. Using the adjacency list model, I can add a parent_id field to each table and link the tables using a foreign key relationship. However, I'd like to use a nested sets/modified preorder tree traversal model. The data will be use...

Proper Use of a Class Instance

I'm using Access 2003 VBA to process recursive data for manufacturing BOMs. I built a class module to let my main tables have static scope. This seems to simplify recursion -- it sets me free from counting levels down and up again as I traverse a BOM. I'm not opening the same recordset redundantly; I'm filtering a lot instead. Afte...

Find duplicate/repeated rows in hierarchical sql

I'm attempting to detect duplicated/repeated values within a hierarchical table. Consider the following (slightly contrived) example: SELECT * FROM emp START WITH mgr IN (SELECT empno FROM emp WHERE ename = 'JONES' UNION ALL SELECT empno FROM emp WHERE ename = 'JONES') CONNECT BY PRIOR empno = mg...

Put linq to sql results into hierarchical structure for using in a un-ordered list ( for jquery tree )

I have 5 tables in a L2S Classes dbml : Global >> Categories >> Sub-Category >> Item >> Item Data. I want to be able to navigate from the Global table down a tree like structure to get to the items - displaying the title from the Item Data table. I have an existing control that uses a IHierarchyData / IHierarchicalEnumerable extended co...

SQL Find all direct descendants in a tree

I have a tree in my database that is stored using parent id links. A sample of what I have for data in the table is: id | name | parent id ---+-------------+----------- 0 | root | NULL 1 | Node 1 | 0 2 | Node 2 | 0 3 | Node 1.1 | 1 4 | Node 1.1.1| 3 5 | Node 1.1.2| 3 Now I would like to get a list o...

hierarchical .Net file format?

Our company has been for a while looking at a file format to hold a large amount of lab sensor data. Each time they run the instrumentation, it generates a file, which we consume and store in a database for trending, etc. A hierarchical format is preferred as it allows us to "group" data. This is a intermediate file format before we p...

How To create Multicolumn TreeView with header and sorting in WPF?

Hi! i have created tree view demo in Visual Studio 2008 C# in WPF but i want to give header and when header is clicked it sort data. i want to create demo like this header1………….header2……….header3 -parent1…………..parent2………..parent3 …-child1……………-child1………….child1 ……child1……………-child1…………child1 -parent2…………..parent2………..parent2 …-ch...

Enforce Referential Integrity on Materialized Path?

I'm trying to implement a tree like structure using a Materialized Path model described here: http://www.dbazine.com/oracle/or-articles/tropashko4. Is it possible to enforce referential integrity on the [path] field? I don't see how SQL could do it, do I have to do it manually in the DAL? ...

complex sql tree rows

table structure id | message | reply_id 1 | help me! | 0 434 | love to | 1 852 | didn't work | 434 0110 | try this | 852 2200 | this wont | 0 5465 | done. :) | 0110 i have a id "852" which is middle of tree menu, but i want to get all the previous related and next re...