Announce: Data Load Python Script

Post Reply
Clint.Cooper
Posts: 6
Joined: 16 Aug 2009, 22:00

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.)
Clint.
Clint.Cooper
Posts: 6
Joined: 16 Aug 2009, 22:00

First bug: generates incorrect python code when parameter and class names contain - or :.
Clint.
Clint.Cooper
Posts: 6
Joined: 16 Aug 2009, 22:00

Version 2 of script uploaded with bug fixed.
Clint.
aducci
Posts: 14
Joined: 14 Oct 2011, 13:42

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?
User avatar
jonathan.carter
Posts: 1087
Joined: 04 Feb 2009, 15:44

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
Essential Project Team
Post Reply