Skip to main content

developerWorks >  Information Management  >  Forums  >  IBM InfoSphere Data Architect  >  developerWorks

[RDA] How to open a physical model (schema)    Point your RSS reader here for a feed of the latest messages in this thread


Tags for this thread: 

     

 
 

My developerWorks
 Welcome, Guest
Sign in or register
This question is answered.

Permlink Replies: 13 - Pages: 1 - Last Post: Oct 14, 2009 5:30 PM Last Post By: GregMalick
erik.gollot

Posts: 24
Registered: Mar 26, 2009 04:31:50 AM
[RDA] How to open a physical model (schema)
Posted: Jun 23, 2009 07:43:10 AM
 
Click to report abuse...   Click to reply to this thread Reply
Hey,

I would like to know how to open a physical data model (from a design project) using the API.
I know how to "traverse" a schema if this schema is currently selected into the project explorer but how can I retrieve this schema if I only have the .dbm filename ?

Thanks
IBM employee or contractor Anson_Forum

Posts: 10
Registered: Feb 20, 2006 04:20:44 PM
Re: [RDA] How to open a physical model (schema)
Posted: Jun 24, 2009 10:08:21 AM   in response to: erik.gollot in response to: erik.gollot's post
 
Click to report abuse...   Click to reply to this thread Reply
Hello Erik,

I believe what you are asking is how can you take a *.dbm file from one project and then open it up in another project. You can basically use the Data Export/ Import facility to open up files from one project into another project.

I have attached a word document outlining the steps of exporting the file from one project and the importing it into another project.

Hopefully this meets your needs and I have answered your question..

Thanks,
Anson
erik.gollot

Posts: 24
Registered: Mar 26, 2009 04:31:50 AM
Re: [RDA] How to open a physical model (schema)
Posted: Jun 24, 2009 02:15:12 PM   in response to: Anson_Forum in response to: Anson_Forum's post
 
Click to report abuse...   Click to reply to this thread Reply
Thanks for your answer but this not what I want to do.
I want to open the .dbm file with the Java api (datatool api ??).

I'm looking for something like this :

Database db = SOME_UNKNOWN_CLASS.loadPhysicalModel("myPhysicalModel.dbm");


I want to do that into a pluglet.

Note : I know how to retrieve the database, schema or tables from the selection in the project explorer but here, I would like to open a .dbm file from its filename.

Thanks if you can help me again
erik.gollot

Posts: 24
Registered: Mar 26, 2009 04:31:50 AM
Re: [RDA] How to open a physical model (schema)
Posted: Jun 26, 2009 01:47:50 PM   in response to: erik.gollot in response to: erik.gollot's post
 
Click to report abuse...   Click to reply to this thread Reply
Nobody knows how to do that ?
I'm really disappointed for this first question on this new forum ! :-(

Nobody ?
nmullin

Posts: 111
Registered: Apr 28, 2004 08:36:22 AM
Re: [RDA] How to open a physical model (schema)
Posted: Jun 28, 2009 06:48:30 PM   in response to: erik.gollot in response to: erik.gollot's post
 
Click to report abuse...   Click to reply to this thread Reply
Erik,

You are probably not going to find too many Data Architects and Data Modelers trying to access and manipulate the data models outside the tool and I wonder why would you need to do that, unless you are looking to extend IDA rather than just read the models.

However, you might want to look at the article: " Extend IBM InfoSphere Data Architect to meet your specific data modeling and integration requirements, Part 1: Modifying IDA models and customizing properties". The article is very specific and it shows you the SQL Model Schema diagram as well as traversing the model.
Because IDA uses the SQL model defined in DTP as the basis of its metamodels, the section Programmatically traverse and modify RDA logical data model and physical data model, as well as the sample code provided with the article, were updated on June 2009.

http://www.ibm.com/developerworks/db2/library/techarticle/dm-0807liu/index.html

I hope this helps,

Norma

erik.gollot

Posts: 24
Registered: Mar 26, 2009 04:31:50 AM
Re: [RDA] How to open a physical model (schema)
Posted: Jul 01, 2009 03:39:09 AM   in response to: nmullin in response to: nmullin's post
 
Click to report abuse...   Click to reply to this thread Reply
Thanks but I know this article.
The problem is that this article does not explain how to open a database model from its filename.
To give you a example, under Rational Software Modeler, you can open an UML model with the API like this :

Model model = UMLModeler.openModel(fullFilename);


UMLModeler is com.ibm.xtools.modeler.ui.UMLModeler

and yes, I would like to extend IDA. I would like to create a "bridge" between RSM and IDA. The objective of this bridge is to mark UML models with DB informations like "This Class is stored in this Table". In the GUI that I already provide to do that, I would like to be able to "browse" a database schema so that the user can select the table from a list of existing tables. To do that, I need to be able to open a physical model with the API.

I'm really surprised that the IDA API is not documented.

Do you know the api to use to open a .dbm file ?

Thanks
nmullin

Posts: 111
Registered: Apr 28, 2004 08:36:22 AM
Re: [RDA] How to open a physical model (schema)
Posted: Jul 01, 2009 12:06:22 PM   in response to: erik.gollot in response to: erik.gollot's post
 
Click to report abuse...   Click to reply to this thread Reply
Erik,

The simple answer is no. There is no IDA API available for what you are looking to do. The IDA team will not recommend any such API.

Norma
erik.gollot

Posts: 24
Registered: Mar 26, 2009 04:31:50 AM
Re: [RDA] How to open a physical model (schema)
Posted: Jul 01, 2009 04:54:47 PM   in response to: nmullin in response to: nmullin's post
 
Click to report abuse...   Click to reply to this thread Reply
euh ???????????????????
sorry but could you explain me how the .dbm file can be read by IDA ?
You should say, the IDA development team does not want to give you any information, does not what to document the api
Sorry for my english but this answer looks really ridiculous (no api ??? ah ah ah !!!!)
Maybe we will have to pay for this documentation ?
Kumar_Thirunavu...

Posts: 1
Registered: Jun 29, 2009 05:59:46 PM
Re: [RDA] How to open a physical model (schema)
Posted: Jul 01, 2009 10:10:55 PM   in response to: erik.gollot in response to: erik.gollot's post
 
Click to report abuse...   Click to reply to this thread Reply
As part of the IDA team, I can confirm that the API for the purpose you are trying to use is not available at present. It might be made available in the future but I don't see it in the product plan in the near horizon. If it is a high priority for you, please follow up with your IBM sales rep so that he can open it as a Requirement against the product.
erik.gollot

Posts: 24
Registered: Mar 26, 2009 04:31:50 AM
Re: [RDA] How to open a physical model (schema)
Posted: Jul 02, 2009 12:43:47 PM   in response to: Kumar_Thirunavukkarasu in response to: Kumar_Thirunavukkarasu's post
 
Click to report abuse...   Click to reply to this thread Reply
It looks very strange to me (I'm a developer too)
How do you load a .dbm file ? You're obliged to do that to show the tables, views, indexes,... on the project explorer view. Which mechanism do you use ? You also need to be able to create a physical model when you execute de LDM-to-PDM tranformation and then you've to write the database/schema into the .dbm file, no ?

Maybe I missed something ?
erik.gollot

Posts: 24
Registered: Mar 26, 2009 04:31:50 AM
Re: [RDA] How to open a physical model (schema)
Posted: Jul 07, 2009 02:51:25 AM   in response to: erik.gollot in response to: erik.gollot's post
 
Click to report abuse...   Click to reply to this thread Reply
Thanks to myself !!!

Here is the code to load a physical data model
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
 
import org.eclipse.emf.common.util.URI;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.resource.Resource;
import org.eclipse.emf.ecore.xmi.impl.XMIResourceImpl;
import org.eclipse.wst.rdb.internal.models.sql.schema.SQLObject;
 
public class PhysicalDataModelLoader {
 
	private Resource theEMFResource = null;
 
	private SQLObject root = null;
 
	public PhysicalDataModelLoader(String projectName,
			String projectRelativeFilename) {
		URI fileURI = URI.createPlatformResourceURI("platform:/" + projectName
				+ "/" + projectRelativeFilename);
		this.theEMFResource = new XMIResourceImpl(fileURI);
	}
 
	public void load() throws IOException {
		if (!theEMFResource.isLoaded()) {
			Map options = new HashMap();
			options.put("DECLARE_XML", Boolean.TRUE);
			options.put("ENCODING", "UTF-8");
			theEMFResource.load(options);
		}
		if (theEMFResource.isLoaded()) {
			EObject current = (EObject) theEMFResource.getContents().get(0);
			setRoot(current);
		}
	}
 
	private void setRoot(EObject newObject) {
		this.root = (SQLObject) newObject;
	}
 
	public SQLObject getRoot() {
		return root;
	}
}


To use this basic class, do the following :

PhysicalDataModelLoader loader = new PhysicalDataModelLoader("MyDBProject","Entity.dbm");						
						try {
							loader.load();
							SQLObject root = loader.getRoot();											
							
							Database db = (Database)root;
							List<Schema> schemas = db.getSchemas();
							for (Schema schema : schemas)
								out.println("Schema : "+schema.getName());
						} catch (IOException e) {							
							e.printStackTrace();
						}
erik.gollot

Posts: 24
Registered: Mar 26, 2009 04:31:50 AM
Re: [RDA] How to open a physical model (schema)
Posted: Jul 07, 2009 02:51:37 AM   in response to: erik.gollot in response to: erik.gollot's post
 
Click to report abuse...   Click to reply to this thread Reply
Thanks to me
wcboyd

Posts: 4
Registered: Aug 10, 2009 03:24:57 PM
Re: [RDA] How to open a physical model (schema)
Posted: Aug 10, 2009 04:34:39 PM   in response to: erik.gollot in response to: erik.gollot's post
 
Click to report abuse...   Click to reply to this thread Reply
Erik,

Thanks for doing this!
This is very helpful for us Data Modelers, even if we have to pass it to one of our programmer friends in order to get done what we need to get done.

I don't know what you are planning to use this for, but as an ERwin user who has written VBA code against the ERwin API we use this kind of thing for mass updates to the model. For example, suppose we have have a project where we have added a couple dozen tables and a couple hundred attributes and now we need to populate the information classification UDFs (in IDA that would be a custom property). We can easily populate a spreadsheet with the attributes and values then invoke the ERwin API to do a mass update to the model from the spreadsheet.

IDA is going to have either document their API or provide some kind of customizable interface to allow its user base to do this. I favor the interface approach simply because I know most of my peers would rather spend their time modeling and not programming. Certainly would be a selling point over ERwin.....

Thanks,

Craig
GregMalick

Posts: 1
Registered: Feb 12, 2009 01:37:50 PM
Re: [RDA] How to open a physical model (schema)
Posted: Oct 14, 2009 05:30:50 PM   in response to: erik.gollot in response to: erik.gollot's post
 
Click to report abuse...   Click to reply to this thread Reply
This is great information.
I'm surprised there aren't more posts about this.

thanks
 Tags
Help

Use the search field to find all types of content in My developerWorks with that tag.

Use the slider bar to see more or fewer tags.

Popular tags shows the top tags for this particular type of content or application that you're viewing.

My tags shows your tags for this particular type of content or application that you're viewing.

 

MoreLess 


Point your RSS reader here for a feed of the latest messages in all forums