Source xml structure for Integration tab using essential.xsl

Post Reply
Walker
Posts: 1
Joined: 11 Feb 2011, 16:13

Hello,

I'm an ex-System Architect user and am keen to give Essentials a go here (new place). Unfortunatly I don't have much xml/xls experience, so any pointers much appreciated.

I've a load of source hardware data in excel format.
To limit my learning curve i'm trying to manipulate the data within excel and export the data in suitable xml format to import using the essentials integration tab and the standard importEssentialInstances.xsl.

I have succesfuly imported a series of hardware nodes, such as the xml example:

Code: Select all

<?xml version="1.0" ?>

<knowledge_base
	xmlns="http://protege.stanford.edu/xml"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://protege.stanford.edu/xml http://protege.stanford.edu/xml/schema/protege.xsd">

	<simple_instance>
		<name>ExcelSpreadsheetNameAndLineRef1</name>
		<type>Technology_Node</type>
		<own_slot_value>
			<slot_reference>description</slot_reference>
			<value value_type="string">s/n USE548N0T3</value>
		</own_slot_value>
		<own_slot_value>
			<slot_reference>name</slot_reference>
			<value value_type="string">CALLMANAGER01</value>
		</own_slot_value>

</knowledge_base>

I've hit a wall trying to expand on this to include links to other (existing) instances within the repository; in this case linking the Technology_Node 'CALLMANAGER01' to the site 'Gratham Road', which I already have defined.

I'm appended the following lines:

Code: Select all

<?xml version="1.0" ?>

<knowledge_base
	xmlns="http://protege.stanford.edu/xml"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://protege.stanford.edu/xml http://protege.stanford.edu/xml/schema/protege.xsd">

	<simple_instance>
		<name>ExcelSpreadsheetNameAndLineRef1</name>
		<type>Technology_Node</type>
		<own_slot_value>
			<slot_reference>description</slot_reference>
			<value value_type="string">s/n USE548N0T3</value>
		</own_slot_value>
		<own_slot_value>
			<slot_reference>name</slot_reference>
			<value value_type="string">CALLMANAGER01</value>
		</own_slot_value>
		<own_slot_value>
			<slot_reference>technology_deployment_located_at</slot_reference>
			<slot_reference>name</slot_reference>
			<value value_type="string">Gratham Road</value>
		</own_slot_value>

	</simple_instance>

</knowledge_base>
Can anyone give me a hint....?
(I think I should have something stating the 'type' is 'site' but i've tried many concertations with no sucess. I also tried the 'importTechNodes' example xml/xsl combo, but it failed with
javax.script.ScriptException: Traceback (innermost last):
File "<unknown>", line 5, in ?
IOError: File not found - standardFunctions.txt (The system cannot find the file specified)
)

Many thanks for any input,

Matt
User avatar
jonathan.carter
Posts: 1087
Joined: 04 Feb 2009, 15:44

Hi Matt,

I think you're almost there.

When a you are defining a direct relationship between two instances, the value in the relationship slot must be the instance reference ID (internal repository ID) rather than the name of the artefact.

So, in your case, the value of your technology_deployment_located_at slot should be something like the following:
<own_slot_value>
<slot_reference>technology_deployment_located_at</slot_reference>
<slot_reference>name</slot_reference>
<value value_type="simple_instance">INSTANCE ID OF Gratham Road</value>
</own_slot_value>
So, relationship slots have a value_type of "simple_instance".
If you've defined Gratham Road in your spreadsheet, use the value that you have in the simple_instance/name tag, e.g. based on what you've described for the Node, "ExcelSpreadsheetNameAndLineRef2".

If, however, you've defined Gratham Road 'by hand' in Protege, this will be a little more complex. We need to find the internal Protege instance ID for that Site instance. Probably the simplest approach would be to publish your repository from Protege to Essential Viewer and then open the resulting 'reportXML.xml' file that you will find in the
<tomcat_install>/webapps/essential_viewer
folder.

Search for "Gratham Road" using a regular text editor and you'll see a definition like the one you are building for your node. The value you need is in the <simple_instance><name>THIS VALUE</name> ... </simple_instance> tag.

THIS VALUE should look suitably computer-generated with a prefix that's based on your Protege project name.
Note that this is different to the simple_instance/own_slot_value/slot_reference="name"

Let me know how you get on with this - hopefully it makes sense.

Integration can be a bit tricky but as long as your source data is relatively straight-forward your approach should work well. Imports that require a lot of cross-referencing / relationships can quickly become complex and we have some alternative approaches to help with those that we can explore as required

Jonathan
Essential Project Team
manikvijay
Posts: 20
Joined: 04 Apr 2011, 18:19

Hi Jonathan,

In my case i am trying to do below


<?xml version="1.0" ?>
<knowledge_base
xmlns="http://protege.stanford.edu/xml"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://protege.stanford.edu/xml http://protege.stanford.edu/xml/schema/protege.xsd">

<simple_instance>
<name>essential_prj_CC_Instance_660002</name>
<type>Application</type>
<own_slot_value>
<slot_reference>description</slot_reference>
<value value_type="string">The Sabre tool that manages profiles. It is central to many of the functions that are on the Sabre and Comarch systems</value>
</own_slot_value>

<own_slot_value>

<slot_reference>name</slot_reference>

<value value_type="string">Customer Insight(CI)</value>

</own_slot_value>

<own_slot_value>
<slot_reference>External Reference Links</slot_reference>
<value value_type="SSW1"> essential_prj_CC_Instance_660006</value>
</own_slot_value>

</simple_instance>

<simple_instance>

<name>essential_prj_CC_Instance_660003</name>
<type>Application</type>
<own_slot_value>

<slot_reference>description</slot_reference>
<value value_type="string">This is a hosted application used by both crew members and customers
for booking vacation packages that accepts only visa, master card, diners, discover and amex</value>
</own_slot_value>
<own_slot_value>
<slot_reference>name</slot_reference>
<value value_type="string">EzRez</value>
</own_slot_value>
</simple_instance>





I am trying to create dependency between SSWI and Customer Insight(CI) and i declared this above in Customer Insight(CI)

<own_slot_value>
<slot_reference>External Reference Links</slot_reference>
<value value_type="SSW1"> essential_prj_CC_Instance_660006</value>
</own_slot_value>

Now my question is am i using the correct slot reference?
the integration upload works perfectly without any issues but i could able to see any dependency in the Essential viewer.

Let me what i am missing here.
User avatar
jonathan.carter
Posts: 1087
Joined: 04 Feb 2009, 15:44

Hi,

I think I can see what you're trying to do.
There are a couple of things that need looking at here. Tackling the import this way (creating the XML in Essential XSD format) is not straightforward and I think I would only recommend this if you are importing simple definitions. If you are importing more complex things - especially defining relationships between elements, then I would recommend finding a simple XML format and then defining a transform that takes advantage of the import libraries that we have defined. For some more background on how that works have a look at the How To Write Integration Transforms tutorial. Note that this is a fairly advanced topic.

The issue that you're hitting is that the XML defines relationships between elements using the <name> tag value in slots of Instance type. This is a very elegant solution but when importing, how do we define a relationship between elements when one of them may not have been imported yet? We have some functions in the library to help with this.
So, this means that you have to have unique values in every simple_instance/name tag in your XML to uniquely identify each instance in the repository.

To define a relationship between 2 things, we use the <name> value of the referenced element in the slot that manages the relationship. e.g. if we have 2 instances of Class A 'instance_1' and 'instance_2' and Class A has a slot called 'relationship', we define this in XML as follows:
<simple_instance>
<name>instance_1</name>
<type>Class A</type>
<own_slot_value>
...
<slot_reference>name</slot_reference>
<value value_type="string">First Class A</value>
<slot_reference>relationship</slot_reference>
<value value_type="simple_instance">instance_2</value>
</own_slot_value>
</simple_instance>

<simple_instance>
<name>instance_2</name>
<type>Class A</type>
<own_slot_value>
...
<slot_reference>name</slot_reference>
<value value_type="string">Second Class A</value>
</own_slot_value>
</simple_instance>
So, that's a how we do the relationships in the XML. We have published the XSD for this and it's also worth going into your Essential Viewer home directory and looking at the 'reportXML.xml' file for more detailed examples.

From what you describe, it sounds like you're trying to create a dependency between 2 applications. We do this by defining each application as an instance of an 'Application_Provider' class and then use the 'APU-TO-APU-STATIC-RELATION' class to capture the relationship between two Application Providers in the context of one of those Application Provider's static architecture. I think it would be worth having a look at this thread for some general background.

The Application meta class is really just a taxonomical thing - a way of grouping Application Providers under a commonly used and usually imprecise name. The External References slot is for defining references to things that exist outside of the Essential Architecture Manager repository, e.g. documentation on a file server, UML class models and so on.

Hope this helps - we've covered a number of things here, so it's probably worth working through this and seeing how things are.

Jonathan
Essential Project Team
Post Reply