hierarchy

Drupal 7: Pathauto hierarchical taxonomy terms pattern

依然范特西╮ 提交于 2019-12-06 05:06:55
问题 I have a Drupal 7.9 taxonomy vocabulary according to the following scheme: category-1 category-1 > subcategory-1-1 category-1 > subcategory-1-2 category-1 > subcategory-1-3 category-2 category-2 > subcategory-2-1 I want to reflect this taxonomy hierarchy in my page url path like category-1/subcategory-1-1/page-123 To achieve this I'm using the modul Pathauto version 7.x-1.0. but I don't know which pattern I have to use. Currently I'm using [node:%field_taxonomy%]/[node:title] but with this

SQL query to get full hierarchy path from different tables

早过忘川 提交于 2019-12-06 04:29:10
This is very relevant to the question SQL query to get full hierarchy path . The only difference is that my hierarchy contains different entity types from different tables, for example: Project Phase Folder Document I want to select all documents along with their full paths (from poject level to folder level). Phases and folders can have subphases and folders. I'm horrible at SQL and just can't figure out how to adapt the answer to the linked question to suit my needs. Data model and example data DECLARE @Project TABLE (ID INTEGER, Name VARCHAR(32)) DECLARE @Phase TABLE (ID INTEGER, Project_ID

Working with a dynamic hierarchy SQL Server

孤街醉人 提交于 2019-12-06 04:04:25
I have the following datasets in SQL Server Hierarchy Table: Report | Immediate Parent Child1 Parent1 Child2 Parent1 Child3 Parent2 Parent1 Grandparent1 Parent2 Grandparent1 Data Table (Only exists for Base level children): Report | Sales Child1 1000 Child2 1000 Child3 1000 From this I need to create a dataset which contains Report | Sales Parent1 2000 Parent2 1000 Grandparent1 3000 I do not know how many hierarchy levels there will be, could be great *10 grandparents. My solution to this problem was to use recursion and dynamic SQL to keep creating temporary tables for each hierarchy level i

Build JSON Hierarchy from Structured Data

五迷三道 提交于 2019-12-06 03:41:10
C# | .NET 4.5 | Entity Framework 5 I have data coming back from a SQL Query in the form of ID,ParentID,Name. I'd like to take that data and parse it into a Hierarchical JSON string. So far it seems to be much more of a daunting task than it should be. Since I'm using Entity the data comes back nicely to me as an IEnumerable. Now I believe I just need some form of recursion, but I'm not quite sure where to start. Any help is appreciated. Data Returns as id parentId name 1 1 TopLoc 2 1 Loc1 3 1 Loc2 4 2 Loc1A Code is public static string GetJsonLocationHierarchy(long locationID) { using

Rails Associations Through Multiple Levels

百般思念 提交于 2019-12-06 03:28:54
I am relatively new to Rails and am working on a project that involves multiple, "nested" levels of data. I am having issues making the proper associations so I can get all the child elements of a model 3 levels higher. Here is an example of the models: class Country < ActiveRecord::Base has_many :states end class State < ActiveRecord::Base belongs_to :country has_many :cities end class City < ActiveRecord::Base belongs_to :state has_many :people end class Person < ActiveRecord::Base belongs_to :city end I have implemented a relationship in the Country model, has_many :cities, :through =>

How to populate a tree view based on a flat list with “levels”?

╄→尐↘猪︶ㄣ 提交于 2019-12-06 02:58:33
问题 I have a list of objects populated from a third-party project file. The way this file was designed is so each item is on a "level" of hierarchy. So the very first item is on level 0, all of its child items are on level 1, and so on. As an example: 1. Node 1 (Level 0) 2. Node 1.1 (Level 1) 3. Node 1.2 (Level 1) 4. Node 1.3 (Level 1) 5. Node 1.3.1 (Level 2) 6. Node 1.4 (Level 1) 7. Node 2 (Level 0) 8. Node 2.1 (Level 1) 9. Node 2.1.1 (Level 2) 10. Node 3 (Level 0) This would produce a hierarchy

How to use ‘hts’ with multi-level hierarchies?

非 Y 不嫁゛ 提交于 2019-12-06 01:46:49
问题 I am forecasting on a large set of time series (5,000+). I would like to do this with a hierarchical approach were I do the forecasting at a higher level and then allocate the forecast down to each SKU. I see a need for doing this in order to zoom into a lower geographic level of detail, while doing the forecasting on a higher level (top-down). For example, below you see a sample of the structure that I am thinking about. Total => Europe => Netherlands => RegionA => Client_A_in_Netherlands =>

Retrieving Hierarchical/Nested Data From CouchDB

寵の児 提交于 2019-12-06 01:41:29
问题 I'm pretty new to couchDB and even after reading (latest archive as now deleted) http://wiki.apache.org/couchdb/How_to_store_hierarchical_data (via ‘Store the full path to each node as an attribute in that node's document’) it's still not clicking just yet. Instead of using the full path pattern as described in the wiki I'm hoping to keep track of children as an array of UUIDs and the parent as a single UUID. I'm leaning towards this pattern so I can maintain the order of children by their

Question about SQL Server HierarchyID depth-first performance

好久不见. 提交于 2019-12-05 22:11:11
问题 I am trying to implement hierarchyID in a table (dbo.[Message]) containing roughly 50,000 rows (will grow substantially in the future). However it takes 30-40 seconds to retrieve about 25 results. The root node is a filler in order to provide uniqueness, therefor every subsequent row is a child of that dummy row. I need to be able to traverse the table depth-first and have made the hierarchyID column (dbo.[Message].MessageID) the clustering primary key, have also added a computed smallint

MySQL hierarchical storage: searching through all parent/grandparent/etc. nodes given a child node id?

为君一笑 提交于 2019-12-05 21:04:51
I'm storing categories using a hierarchical model like so: CATEGORIES id | parent_id | name --------------------- 1 | 0 | Cars 2 | 0 | Planes 3 | 1 | Hatchbacks 4 | 1 | Convertibles 5 | 2 | Jets 6 | 3 | Peugeot 7 | 3 | BMW 8 | 6 | 206 9 | 6 | 306 I then store actual data with one of these category ids like so: CARS vehicle_id | category_id | name ------------------------------- 1 | 8 | Really fast silver Peugeot 206 2 | 9 | Really fast silver Peugeot 306 3 | 5 | Really fast Boeing 747 4 | 3 | Another Peugeot but only in Hatchbacks category When searching for any of this data, I would like to