hierarchical taxonomies

chrism2671 - June 9, 2008 - 12:29
Project:Taxonomy import/export via XML
Version:5.x-1.0
Component:Code
Category:support request
Priority:normal
Assigned:Unassigned
Status:by design
Description

Does this support hierarchy of terms?

Any help much appreciated!

Many thanks,
Chris.

#1

OnkelTem - September 28, 2008 - 14:34

I have exactly the same task - need to import hierarchical dictionary. And I guess it is impossible with this simple module. Schema is plain and is not for humans, but for machines. So if you are not going to play a role of a computer and construct all those IDs you wont get it imported.

Why not to use NATIVE format like:

<term>
  <name>Name1</name>
  <term>
    <name>Name2</name>
    etc ....

- I have no any sane idea

#2

meeta - December 26, 2008 - 06:02

Has anyone discovered a way to achieve hierarchical taxonomies imported?

If not any other module to import hierarchical taxonomies with duplicate terms.

If so kindly reply soon.

Thanks!!

#3

dman - December 26, 2008 - 09:43
Status:active» postponed (maintainer needs more info)

All of the documented import formats do support hierarchical taxonomies.
You just need to supply the input with the terms parents tagged as needed.

For structured XML, unlimited nesting doesn't scale, or allow multiple lineage - which is why a relational structure is more useful.

Which formats are not performing as expected?

#4

meeta - December 29, 2008 - 06:52

Thanks !!

What do u mean by Relational structure with xml?

Actually my task is to import hierarchical taxonomy through xml import export module.I am using drupal 6.6.
The input for this module is from cmap tool on which i applied a perl script and got a xml file which is compatible with drupal xml format.

Importing is not a problem but when i tried to structure my hierarchy drupal is forcing me to generate ids for my terms relevant to the hierarchy structure only then the hierarchy will be created.

My file is huge and not possible to analyze the whole file and generate ids by my own.

Duplicate terms issue which i wrote in my last request is solved.

Kindly help regarding hierarchy.

Thanks!!

#5

dman - December 30, 2008 - 01:59

Relational (like relational databases) - in that each item may contain pointers to its parents or children, rather than repeating them or nesting them.

Item A can say "here is my data, my parent is item B - for its data, go look at it"
This scales better, as it's even possible to import chunks of a tree in batches (which you can't do with an all-in-one tree) and can even refer to different documents.

The drawback is, at some point, you have to have cannonic, unique, identifiers.

If you have a huge file that's too big for you to even generate the IDs, it's unlikely that a giant tree import will work in one go either.

Instead, there is even (not very documented) support for batch imports allowing a file to define the location of other files/URLs containing parts of a tree. You have to be using RDF/XML import for that to really work at the moment though.

Maybe CSV import would be easier for you - that's as simple as it can get.

#6

meeta - December 31, 2008 - 11:05

Thanks dman!!

But my problem is not solved using CSV.
I will explain you in detail.
Below is my sample input file from cmap tool.

Rice_fungal_disease isa Sheath
Rice_bacterial_disease isa False_smut
Rice_nematode_disease isa Rice_nematode
Disease isa Rice_disease
Rice_disease isa Rice_fungal_disease
Rice_disease isa Rice_bacterial_disease
Rice_disease isa Rice_nematode_disease
Viral_disease isa Different_Disease

I use a perl script to convert it into xml format acceptable by drupal.

The taxonomy which i require in drupal is :

1Disease
2Rice_disease
3Rice_fungal_disease
4Sheath
3Rice_bacterial_disease
4False_smut
3ice_nematode_disease
4ice_nematode
1Viral_disease
2Different_Disease

level 2 is child of level 1
level 3 is child of level 2
level 4 is child of level 3
The main issue is to generate proper ids for the term which i am finding very difficult manually.
I am attaching the basic perl script (not modified)which i am using.

Thanks again.

AttachmentSize
taxonomy_list2xml.pl_.txt 1.08 KB

#7

dman - August 30, 2009 - 11:36
Status:postponed (maintainer needs more info)» by design

CVS does the trick just fine.
Not sure about the 'isa' terminology you use there - looks like it's backwards. So I replaced 'isa' with 'narrower' and got this:

Rice_fungal_disease, narrower, Sheath
Rice_bacterial_disease, narrower, False_smut
Rice_nematode_disease, narrower, Rice_nematode
Disease, narrower, Rice_disease
Rice_disease, narrower, Rice_fungal_disease
Rice_disease, narrower, Rice_bacterial_disease
Rice_disease, narrower, Rice_nematode_disease
Viral_disease, narrower, Different_Disease

AttachmentSize
rice_diseases_imported.png 14.73 KB
rice diseases.csv_.txt 341 bytes
 
 

Drupal is a registered trademark of Dries Buytaert.