PDA

View Full Version : Importing Existing Relationships


ashwken
10-16-2005, 10:37 PM
I'm new to the program, and not entirly sure that this can be done, but before I spend hours on trial and error I thought I might pose this question:

How do I import an exisiting relational structure?

I have an external database (in Alpha5 simialr to MS-Access) consisting of individual entity tables, and various sets (table joins to create relational views).

The data can be exported to csv, I can create new joins (querys) for export purposes, and manipulate the tables prior to export. For example, add a field to hold a concatated value for mapping to UR-Item Title.

I have been able to import an individual table to a specific Folder using a Derived Template, so I've gotten my mind around some of the program.

I can't figure out how to import a parent-child AND have the child import as a linked item.

I think part of the procedure is described at this thread:

http://www.kinook.com/Forum/showthread.php?s=&threadid=1157

This mentions the addition of a field to the external table for mapping to UR-Indent Level (assign value of: 0=Parent, 1=Child). So that each row of the csv contains a value for Indent Level - does this mean that the import is accomplished in 2-passes, one pass to import the parent, then a second pass to import the children (???).

How should I handle (prepare) the external data tables for import porposes?

For example: if I "flatten" an external Parent-Child set, each row contains columns from the Parent (repeating data for rows of children) and unique Child columns. I don't see how to apply the Indent Level to this type of structure.

AND to the second part of my question - can an imported Child be assigned a Link value?

For example: after import, unique instances of Child items should become the source for future usage as linked (cloned) items - building new records.

Or, is it possible to export the UR-Item ID, or some other system fields to establish linkage externally, then re-import?

I guess my point is how should exisitng tables be structured (and/or joined) for export - import to UR.

Also, is there any point in creating Item Attributes for mapping the unique and forgein keys from the exisitng tables?

Any insight would be helpful.


KenA

kevina
10-17-2005, 12:07 PM
You can see how the csv "indenting" feature works by exporting some csv data from an Ultra Recall Info Database with this field.

Essentially here is how it works (for import or export): Parent rows will have an IndentLevel value of 0. Obviously each row of data represents a single Info Item. If a row has child children (rows), then they will immediately follow with an incremented indent level (ie. immediate children will have an indent level of 1).

If you are trying to import data from an external relational database, then you would need to export the parent rows, with children rows following immediately after the appropriate parent row with an incremented IndentLevel value.

You'll want to create a csv file something like this (obviously with other attributes and real data!):

IndentLevel, ItemTitle, Url, ItemNotes
0,"Main Parent","http://acme.com/parent1",Notes
1,"First Child","http://acme.com/child","Some other notes"
1,"2nd Child","http://acme.com/child2","Long note"
2,"1st grandchild,"http://acme.com/grandchild1","Other note"
0,"Second Parent","http://acme.parent2",Notes

The one thing that currently can't be done is specify an alternate template for the children Info Items. Is this something of importance for your import?

If so, perhaps the csv import functionality of a future version could also take a TemplateName field that would be used (if found in the Info Database) to override the general template name provided with the import...