Questions tagged [hierarchical-data]

Hierarchical data reflects a set of parent-child relationships. These can be found in a genealogy, a taxonomy, a list of requirements for parts assembly, and innumerably other instances. Methods for dealing with hierarchical data are often essential for data management and analysis.

Hierarchical data reflects a set of parent-child relationships. As Materials Resource Planning was developed by manufacturers in the 1950s, hierarchical data management emerged as a theoretical and practical discipline. A manufacturer uses the term Bill of Materials (BOM) for the set of items required to assemble a parent item; the term BOM was adopted by mathematicians and software developers, and it is used today in both realms.

Hierarchical data is ubiquitous and has called forth some of the most important and complex work of database management. It has also propelled object-oriented programming.

The key design element is recursion. Imagine starting at the trunk of a tree and visiting every leaf; this theoretical exercise would require an enormously large number of decision points occurring in a nested or recursive pattern. Requirements for this analysis are remarkably varied and have produced entire sub-disciplines of database design.

2030 questions
0
votes
0 answers

Plotting Hierarchical Quantitative Data

I am trying to visualize some quantitative data that can be summarized hierarchically. The data is arranged such that each node either: has children, with this node's value the mean of the value of its children has no children (is terminal) with a…
Andrew
  • 459
  • 5
  • 15
0
votes
2 answers

Hierarchical bar charts in r

I'm working on a visualization project in R and thought of creating bar charts for hierarchical data (states with constituencies in it, each constituency possessing a numeric value). I came across this web page…
Avinash
  • 133
  • 9
0
votes
1 answer

Tree View UI Relationship with Self Referencing Data Structure(Hierarchical[parent-child] Relationship)

I have a self referencing data structure and I want to show this data in my UI layer as a Tree View. My Model Class looks like: public class Person { public Person() { Children = new List(); } public int Id {…
0
votes
1 answer

Plotting a hierarchically indexing pandas dataframe

Consider the following code: col_indices = pd.MultiIndex.from_product([[1,2], ['a', 'b']]) row_indices = [1,2,3] df = pd.DataFrame(index=row_indices, columns=col_indices) When I plot this, I get five legend entries including one which says None,…
rhz
  • 960
  • 14
  • 29
0
votes
1 answer

Getting error for HierarchyId while fetching the data from another server and inserting it into my server c#

Error is The type of column 'MemberHId' is not supported. The type is 'SqlHierarchyId'. In both the server the datatype is same "HierarchyId". I am just using the ADO.Net. The assembly is Microsoft.SqlServer.ManagedDTS version- 13.0.0.0 We are…
0
votes
1 answer

Need to show grandchild under child under parent in Oracle Hierarchical query

I have a table that has a tree of state, region, district, building and classes. Each row has a node id and a parent id. I am using the following select name, child node, parent id from tableA connect by prior child node = parent id i get: …
user722226
  • 179
  • 1
  • 10
0
votes
1 answer

List all ancestors of a child in hierarchical data structure

Consider the following sample table: with v1 as ( select 'I' as parent_id, 'M' as child_id from dual union all select 'M', 'M1' from dual union all select 'M', 'D' from dual union all select 'I', 'P' from dual union all select 'P', 'K' from dual…
Sachin S
  • 396
  • 8
  • 17
0
votes
1 answer

How to Sort a Hierarchy structure with a Sort Order Column

I have a hierarchy structure with some dummy data in SQL: HierarchyID ParentItemID SortOrder Name 1 NULL 99 Main Parent 2 1 80 Sub Parent 1 3 1 99 Sub Parent 2 4 …
RJ Oosthuizen
  • 21
  • 1
  • 3
0
votes
1 answer

Write a query that returns all parents on top and then children

Table structure: |--------------------------------|-------------| |branchid |branchcode |parentid|branchtypeid | |-----------------------|--------|-------------| |438 |UKHQR |438 | 2 …
CCC
  • 111
  • 5
  • 16
0
votes
3 answers

When paginating by parents, display their children

I have a resultset with parent and child rows. (Child rows never have childs). I need to do pagination on it (considering the sort) so that: First need to select only the parents on the pagination page (for example, when page size = 10, it must…
0
votes
0 answers

How do I join a table with itself to get the data's hierarchy

A section of my database includes a table saving information about blocks: CREATE TABLE blocks ( id_block INTEGER NOT NULL, id_type INTEGER NOT NULL, id_parent_block INTEGER NOT NULL, PRIMARY KEY (id_block), FOREIGN KEY (id_type)…
0
votes
0 answers

create hierarchical view tree type

From the table below, I need hierarchical view of fNAME, lNAME, USER_MAIL and PARENT_USERNAME, the path follows by lNAME/PARENT_USERNAME create table USER ( USERNAME varchar2 (30), fNAME varchar2 (30) not null, lNAME varchar2 (30) not…
user3171451
0
votes
1 answer

Oracle - Loop through hierarchised records

So, since I struggled to find an accurate title, I think a detailled shema will be much more understandable. I have this table PROGRAM that I will reduce to 3 fields for simplicity: ID |NAME |ID_ORIGINAL_PROGRAM 1 |name_1 | 2 |name_2 |1 3 …
Marc
  • 352
  • 2
  • 6
  • 19
0
votes
1 answer

Node JS How to build a nested object using parent ids

for my internship, I need to build a nested object using parent IDs I don't want children attribute array. I have an array of object with id and parent id and I use npm flatnest to do it. This works for a one-level hierarchy but the code must be…
0
votes
1 answer

How to convert path data to adjacency list

I'm setting up a rails "import from csv" task, and I came across departments data (in db) in the form of path. I want it to be adjacency list. Smth I have: ID, NAME,…
Norman Edance
  • 352
  • 4
  • 14