Questions tagged [hierarchy]

For issues relating to creating, maintaining, or displaying a hierarchy of data or resources, etc.

A hierarchy is an arrangement of items (objects, names, values, categories, resources, etc.) in which the items are represented as being "above," "below," or "at the same level as" one another. Abstractly, a hierarchy is simply an ordered set or an acyclic directed graph.

A hierarchy can link entities either directly or indirectly, and either vertically or horizontally. The only direct links in a hierarchy, insofar as they are hierarchical, are to one's immediate superior or to one of one's subordinates, although a system that is largely hierarchical can also incorporate alternative hierarchies. Indirect hierarchical links can extend "vertically" upwards or downwards via multiple links in the same direction, following a path. All parts of the hierarchy which are not linked vertically to one another nevertheless can be "horizontally" linked through a path by traveling up the hierarchy to find a common direct or indirect superior, and then down again.

2838 questions
12
votes
3 answers

How can I create a closure table using data from an adjacency list?

I have a database containing a hierarchy of categories stored using the adjacency list model. The hierarchy is 3 levels deep (not including an imaginary root node) and contains approx 1700 nodes. Nodes in the 2nd and 3rd levels can have multiple…
Adnan
  • 413
  • 5
  • 12
11
votes
2 answers

Retrieving full hierarchy sorted by a column under PostgreSQL's Ltree module

I'm using PostgreSQL's Ltree module for storing hierarchical data. I'm looking to retrieve the full hierarchy sorted by a particular column. Consider the following table: votes | path | ... -------+-------+----- 1 | 1 | ... 2 |…
David Chouinard
  • 6,466
  • 8
  • 43
  • 61
11
votes
2 answers

Rounded Corners in Parent DIV not effecting Child DIVs

So, I'm experimenting with using rounded-corners in CSS3 (not in IE, don't care if it works there), and I have the DIV where all of my content lives looking quite nice. The problem I'm having is that there are child DIVs that are not getting…
linnium
  • 368
  • 1
  • 4
  • 15
11
votes
5 answers

Creating Taxonomy Table in MySQL

I am creating a botanical database where the plants will be organized by their taxonomy: Life Domain Kingdom Phylum Class Order Family Genus Species I was considering using the example put forth by the article Managing Hierarchical Data in MySQL,…
DrakeNET
  • 183
  • 1
  • 2
  • 8
11
votes
5 answers

Composition of a hierarchy of functions

Is there a canonical way to express a function that is a composition of a rooted tree of functions? Here is a concrete example of what I mean by "composition of a tree of functions." Take a rooted tree whose nodes are labelled by functions, like…
egnha
  • 1,157
  • 14
  • 22
11
votes
4 answers

Getting all the children of a parent using MSSQL query

I have the following data in my database: Parent Child 101 102 101 103 101 104 101 105 101 106 My parameter is 106. And using the parameter I want to retrieve all the other children under its parent…
waine
  • 111
  • 1
  • 1
  • 5
11
votes
2 answers

Can python objects have nested properties?

I have an object defined as follows class a(): @property def prop(self): print("hello from object.prop") @property def prop1(self): print("Hello from object.prop.prop") When I call >>> obj = a() >>>…
user1876508
  • 12,864
  • 21
  • 68
  • 105
11
votes
2 answers

Linking back to home page in wordpress

So I have WordPress installed in a subdirectory of my website with permalinks set up. I have my website set up like so: -index.php -style.css -/contact ---index.php -/blog ---(Wordpress installation) So my problem is, whenever I use an
Sidetracking
  • 219
  • 2
  • 6
  • 13
10
votes
3 answers

mapping list of string into hierarchical structure of objects

This is not a homework problem. This questions was asked to one of my friend in an interview test. I have a list of lines read from a file as input. Each line has a identifier such as (A,B,NN,C,DD) at the start of line. Depending upon the…
gtiwari333
  • 24,554
  • 15
  • 75
  • 102
10
votes
5 answers

How do I inspect a Python's class hierarchy?

Assuming I have a class X, how do I check which is the base class/classes, and their base class/classes etc? I'm using Eclipse with PyDev, and for Java for example you could type CTRL + T on a class' name and see the hierarchy,…
ElenaT
  • 2,600
  • 4
  • 24
  • 41
10
votes
3 answers

Is PostgreSQL's Ltree module a good fit for threaded comments?

I'm considering using PostgreSQL's Ltree module in my application to help with threaded comments. I've been eying it for a while to use for threaded comments. I figure it would help with cases where you need to update a node and its children, like…
Cory R. King
  • 2,766
  • 1
  • 24
  • 22
10
votes
4 answers

SQL Data Hierarchy

I have looked through a few SQL hierarchy tutorials, but none of them made much sense for my application. Perhaps I am just not understanding them correctly. I'm writing a C# ASP.NET application and I would like to create a tree view hierarchy from…
Will
  • 1,317
  • 3
  • 11
  • 10
10
votes
1 answer

Postgres Materialized Path - What are the benefits of using ltree?

Materialized Path is a method for representing hierarchy in SQL. Each node contains the path itself and all its ancestors (grandparent/parent/self). The django-treebeard implementation of MP (docs): Each step of the path is a fixed length for…
Avi Kaminetzky
  • 1,489
  • 2
  • 19
  • 42
10
votes
3 answers

ASP.NET MVC 3 Treeview

I need to display a Treeview in my MVC3 application. There will be a self referencing hierarchical table (Folders) and another table linked to it (Documents.) (So Folders can have N-subFolders and any folder/sub folder can have many documents.) I…
James
  • 1,158
  • 4
  • 13
  • 23
10
votes
3 answers

What's the best C# pattern for implementing a hierarchy with an enum?

I'm implementing value types which represents a distance (or length). There's an enum that represents the different units of measure, eg: public enum DistanceUnit { Millimeter, Centimeter, Meter, Kilometer, Inch, Foot, Yard, …
Mark
  • 9,320
  • 6
  • 57
  • 70