hierarchical-data

Create object hierarchy for test

笑着哭i 提交于 2019-12-24 11:34:23
问题 I building a test-driven application that will sort a flat file into a parent-child-hierarchy. And now I want to create a pretty generic test for my own sorting. For that I want to generate some test data, which I then sort. The object that will be sorted will look something like this: public interface IHierarchicalUnitWithChildren { string Id { get; } string ParentId { get; } IList<IHierarchicalUnitWithChildren> Children { get; set; } } But I don't want to create the test-object myself. I

finding super classes of an entity in SPARQL

无人久伴 提交于 2019-12-24 09:13:09
问题 I want to make a Name Entity Recognizer using wikipedia Data, I need to get all the super classes of a word to see in which category (Place, Human, Organization or None) the word is. I surfed the Internet a lot and find some pages like : SPARQL query to find all sub classes and a super class of a given class which when I execute the query results "No matching records found" even with the word mentioned in the page and trying other namespaces. and: Extracting hierarchy for dbpedia entity using

Return node level of hierarchical xml

自古美人都是妖i 提交于 2019-12-24 03:41:24
问题 In a treeview you can retrieve the level of an item. I am trying to accomplish the same thing with the given input being an object. The XML data I will use for this example would be something like the following <?xml version="1.0" encoding="utf-8" ?> <Testing> <Numbers> <Number val="1"> <Number val="1.1"> <Number val="1.1.1"> <Number val="1.1.2" /> <Number val="1.1.3" /> <Number val="1.1.4" /> </Number> </Number> <Number val="1.2" /> <Number val="1.3" /> <Number val="1.4" /> </Number> <Number

Compute number of files per folder in a complex folder structure?

烂漫一生 提交于 2019-12-23 12:55:08
问题 I have created a simple data.tree through importing a folder structure with files inside of it. if (!require("pacman")) install.packages("pacman") pacman::p_load_gh("trinker/pathr") library(pathr) library(data.tree) folder_structure <- pathr::tree(path = "/Users/username/Downloads/top_level/", use.data.tree = T, include.files = T) Now, I would like to convert the object folder_structure into a data.frame with one row per folder and a column that specifies how many files each folder contains.

Parent Child Relationships PHP/MYSQL

自作多情 提交于 2019-12-23 12:27:18
问题 I have a table like this: id name parent_id I then want to select certain rows based on their id, so something like this: SELECT * FROM TABLE WHERE id IN ('1', '5', '8', '9', '35') I want to, from this query, also show the parent/child relationship, like: id parent ----------- 1 0 5 1 8 0 9 8 35 9 So the final output would look something like this: 1 --5 8 --9 ----35 Do I do this outside of mysql, i have tried using arrays, but can't figure it out, or Do I do it inside MYSQL, which i don't

Oracle 11g CREATE VIEW using CONNECT BY and multiple tables

最后都变了- 提交于 2019-12-23 09:41:35
问题 Using Oracle 11G (not R2) database, we need to create reports that show which Leadership Committe an individual's reporting structure belongs to. At a high level, we determine an individual's presence on the board by locating the employee ID in table board_members. The board_members table has a position ID that can be used to access board_positions, and from there we can determine if the position is on the leadership committee. (Samples below.) For any employee who is on the leadership

WPF DataGrid with TreeView type hierarchy

泪湿孤枕 提交于 2019-12-23 02:16:43
问题 Is it possible to have a pure hierarchical wpf data grid? Now there are 3 possible solutions dicussed over the internet ... GroupStyle TreeListView instead of DataGrid RowDetailsTemplate Now all 3 are not useful in my case as they each have limitations. GroupStyle provides grouped row presenters but their parent is simply GroupItem . This is where my data source is different. In my case the parent of the grouped items will be of the same type of item. e.g. Folder class has List<Folders>

php - convert data from database to hierarchical array

这一生的挚爱 提交于 2019-12-23 01:13:19
问题 I have been puzzling with this problem for days, without any luck. I hope some of you can help. From my database I get a list of files, which various information attached, including a virtual path. Some typical data is: Array ( [0] => Array ( [name] => guide_to_printing.txt [virtual_path] => guides/it ) [1] => Array ( [name] => guide_to_vpn.txt [virtual_path] => guides/it ) [2] => Array ( [name] => for_new_employees.txt [virtual_path] => guides ) ) I wish to convert this into a hierarchical

How do I query for all the nodes between two nodes in a tree?

丶灬走出姿态 提交于 2019-12-23 00:25:17
问题 I have a hierarchical database strucutre, e.g. columns ID and PARENT_ID defined for each row, with the top level rows having a NULL PARENT_ID . I have all the relationships from this table flattened into another table, e.g. if there were three records in a single hierarchy of grandparent, parent, grandchild, there would be 3 records: **ANCESTOR, DESCENDANT** grantparent, parent grandparent, grandchild parent, grandchild Rather than execute a hierarchical query to determine that the grandchild

Genealogy tree mysql

自闭症网瘾萝莉.ら 提交于 2019-12-22 23:00:35
问题 I'm trying to create a structure to store and read dogs pedigree using php and mysql. I found on stackoverflow this kind of structure, and it seems to be efficient: Inbreeding-immune database structure TABLE people (id, name, father_id, mother_id ); TABLE relatives ( person_id, ancestor_id ); There is a working example here: http://sqlfiddle.com/#!2/0bd39/10 Is it possible to retrieve simply a ordered tree or a subtree (for example 4 or 5 generations) starting by an id? EDIT I'm trying to get