Page 1 of 1

Announce: Data Load Python Script

Posted: 29 Sep 2009, 07:10
by Clint.Cooper
I have uploaded a python script that generates python scripts to load data into Protégé. Please see the Community / Share / Essential Tools and Components and filename is ‘Data Load’.

A simple example is included showing how to load from an Excel spreadsheet.

I’ll monitor this thread for bug reports and enhancement requests.

(Export to Visio is to come later this week.)

Re: Announce: Data Load Python Script

Posted: 02 Oct 2009, 08:00
by Clint.Cooper
First bug: generates incorrect python code when parameter and class names contain - or :.

Re: Announce: Data Load Python Script

Posted: 02 Oct 2009, 21:05
by Clint.Cooper
Version 2 of script uploaded with bug fixed.

Re: Announce: Data Load Python Script

Posted: 10 Aug 2012, 15:14
by aducci
Hi, Please help, i am trying to generate the class (to import a list of "Application" class... please can you provide the code to generate this, i have looked at the readme file, but still cannot come right.

this is my code: (for location C:\Essential)
1: execfile("C:\Essential\\generateLoadCommand.py")
2: generate("Application")
3: execfile("C:\Essential\\import.txt")

i get this error on step2...
Warning allows more than one cls for param
Traceback (innermost last):
File "<string>", line 1, in ?
File "C:\Essential\generateLoadCommand.py", line 174, in generate
KeyError: 0
exception from Jython: Traceback (innermost last):
File "<string>", line 1, in ?
File "C:\Essential\generateLoadCommand.py", line 174, in generate
KeyError: 0
: Traceback (innermost last):
File "<string>", line 1, in ?
File "C:\Essential\generateLoadCommand.py", line 174, in generate
KeyError: 0
Please assist?

Re: Announce: Data Load Python Script

Posted: 20 Aug 2012, 16:14
by jonathan.carter
Hi,

This script was kindly contributed by a member of our user community and is not supported by the Essential Project Team.

I've had a look at the problem and Clint originally coded this for the Essential Meta Model 1 and some of the updates for EMM3 are causing a problem.

However, I think you should be able to progress with this by modifying the 'generateLoadCommands.py' script as follows:

Code: Select all

SLOTS_TO_IGNORE = [
    'external_repository_instance_reference',
    'name',
    'description', 
    'supersedes_version'
    ]
Note that I have added the 'supersedes_version' to the list of slots to ignore. I think that because this is a slot that takes the same type as the class itself (to capture how things are superseded as the architecture evolves) that is causing some problems with the script

Let me know how you get on and I will pursue the beta release of our more powerful Import Utility.

Jonathan