This article demonstrates how you can quickly create and install a new classification system from a Web Ontology Language (OWL) file and a new default lifecycle using a State Adaptive Choreography Language (SACL) file and an OWL file for use within IBM® WebSphere® Service Registry and Repository V6.0.0.1 and higher. It enables the WebSphere Service Registry and Repository configuration administrator to exploit an existing hierarchy of categories or a particular lifecycle, which may already exist within their enterprise, within WebSphere Service Registry and Repository. Once configured within WebSphere Service Registry and Repository, it will then be available for other WebSphere Service Registry and Repository users or for a proof of concept without having to spend time loading, learning or using any additional tooling.
The approach taken is to use a simple text editor to create the category hierarchy or lifecycle flow and then use a Java™ application to generate the appropriate OWL or SACL files. You can use this article to extend it to add a GUI front-end to create the text files to feed into the OWL and SACL creator applications.
Create a new classification system for WebSphere Service Registry and Repository
Your enterprise may already exploit a hierarchy of categories (alias classes) elsewhere within your company that you would like to reuse within WebSphere Service Registry and Repository. For the benefit of this article, we use the following hierarchy, from MadeUpCo Enterprises, as a simple example on how to use this utility.
Figure 1. Hierarchy of classes for MadeUpCo Enterprises
This figure shows that any category has at most one parent category. Multiple parents are not supported within a WebSphere Service Registry and Repository classification system.
The first step is to take this hierarchy of categories and reformat them into a flat text file. Each level of category is defined by having 2 x level spaces at the start of each line, where the top-level category, MadeUpCo Enterprises is level 0 (zero). This will result in a text file (we will call it MadeUpCo.txt) which looks like Listing 1:
Listing 1. MadeUpCo.txt text file
MadeUpCo Enterprises
Departments
Finance
Human Resources
Sales
Development
Products
Hardware
32-bit
64-bit
Single core
Multi-core
Software
|
If your hierarchy labels have special characters in them (&, <, >, ') the OWL creation class will convert them into escaped text so that they can display correctly from with the UI. Additionally, if there is a double-quote (") in the label it will be converted to a single-quote.
Throughout this text file you can add comment lines by starting the line with a # character. All the comment lines
in the text file will be grouped into a comment section at the start of the rdf element within the OWL file.
To uniquely identify the newly created OWL file, you have the ability, within the text file, to specify a namespace
for the classifications by having a line that starts with NAMESPACE:. If you do not specify this line here or on the
command line, a default namespace will be used: http://www.ibm.com/ontology/system/namespace.
An OWL file should have an Ontology element to describe what the file represents. This label can be defined by
having a line starting with ONTOLOGY:. This is the top-level label that you will see in the Browse classifications
view within the UI. You can additionally add a comment (using a line starting COMMENT:) describing the ontology for
the benefit of others; it will not be displayed in the UI.
The start of your text file should now look like Listing 2 below:
Listing 2. Code for the beginning of the text file
# MadeUpCo Enterprises
# ---
# General classification system for MadeUpCo Ent.
ONTOLOGY:MadeUpCo Enterprises Hierarchy
COMMENT:This hierarchy was created using an automated OWL creation tool
NAMESPACE:http://www.madeupco.com/classification
# The hierarchy starts here!
|
Now that we have created the input file, we can invoke the utility class to generate the OWL file that can then be read and parsed by WebSphere Service Registry and Repository and used to classify entities within WebSphere Service Registry and Repository.
The syntax of the class available in the resources jar is (Notice that angle brackets and square brackets represent required and optional parameters):
CreateOWL <input filename> [namespace] [output filename]
|
By default, if you do not specify an output filename, the output will be piped to stdout. As alluded to above,
the namespace (NAMESPACE:) that you may have specified in the input file can be overridden
by specifying one as input to the CreateOWL utility. If one is not specified within the
input file or on the command line, then it will use [output filename] if specified, as the
namespace; for example, file:///MadeUpCo.txt. Otherwise, it will use
http://www.ibm.com/ontology/system/namespace
To convert the input text file into an understandable OWL file, run the following at the command prompt:
java -cp quickStartUtilities.jar
com.ibm.serviceregistry.quickstart.CreateOWL MadeUpCo.txt MadeUpCo.owl
|
Loading the OWL file into WebSphere Service Registry and Repository
The output file: MadeUpCo.owl, can now be loaded into your WebSphere Service Registry and Repository via the Web UI or via
the administration scripts. Within the Web UI, you will be able to browse this new classification system as shown in Figure 2.
To load the OWL file using the WAS administration script, use the following command:
wsadmin -wsadmin_classpath ServiceRegistryClient.jar
-f loadOntologySystem.jacl /temp MadeUpCo.owl
|
Note that paths to the relevant files will need to be included and the path to the OWL file must, if necessary, use forward slashes.
Figure 2. MadeUpCo Enterprises new classification system within WebSphere Service Registry and Repository.
Using the new classification system
Entities within WebSphere Service Registry and Repository can now be classified with any of the classifications from MadeUpCo Enterprises Hierarchy.
Then, for example, you can run API queries to retrieve all the entities that have been classified with one of these new classifications. The following query searches for entities that are classified by the Development class or any of its child classes:
/WSRR/WSDLDocument[classifiedByAllOf('http://www.madeupco.com/classificationDevelopment')]
|
Create a new lifecycle for WebSphere Service Registry and Repository
The first stage of creating a new lifecycle is to model the states and transitions that you wish to represent in WebSphere Service Registry and Repository. For example, Figure 3 is a lifecycle that MadeUpCo Enterprises would like to introduce into WebSphere Service Registry and Repository.
Figure 3. MadeUpCo Enterprises lifecycle state machine
As WebSphere Service Registry and Repository can only have one lifecycle registered at once, no entities within WebSphere Service Registry and Repository must be governed with an existing lifecycle.
This section shows you how to create a new WebSphere Service Registry and Repository lifecycle from a text file. For MadeUpCo Enterprises, we will
call it MadeUpCoLifecycle.txt. The format for any lifecycle transformation is from
an old state via a transition to a new state. The following syntax describes the way this is represented
within the text file is:
[old state]--<transition name>--><new state>
|
A new lifecycle initial state within this file is identified by the first line that has an empty [old state];
for example, --Object created-->Created
Now that the lifecycle has been defined, we can create the text file. The lifecycle using the above syntax can be described as in Listing 3 below:
Listing 3. Text file with syntax
--Object creation-->Created
Created--Approve-->Planned
Created--Non-conformant-->Inappropriate
Inappropriate--Retry-->Created
Inappropriate--Close-->Closed
Planned--DCUT-->Developed
Planned--Drop-->Dropped
Planned--Defer-->Deferred
Developed--Test-->Tested
Tested--Deploy-->Deployed
Tested--Stage-->Staged
Staged--Deploy-->Deployed
Deployed--Warn for retire-->Retiring soon
Deployed--Retire-->Retired
Retiring soon--Retire-->Retired
Retired--Delete-->Unavailable
|
As with the OWL creation text files, these files can also have comment lines by having a line that starts with a # character.
There are two additional SACL file descriptors that you can include at the top of your text file. They provide
the SACL a descriptive label (use LIFECYCLE:) and a namespace for the SACL (use
NAMESPACE:). If you do not define the namespace within the file or on the command
line the following default namespace will be used: http://www.ibm.com/lifecycle/system/namespace.
A sample text file header, for MadeUpCo Enterprises could look like Listing 4:
Listing 4. Sample text file header for MadeUpCo Enterprises
#
# Sample lifecycle for MadeUpCo Enterprises ...
#
LIFECYCLE:MadeUpCo Enterprises Lifecycle
NAMESPACE:http://www.madeupco.com/lifecycle
####
# DEPLOYMENT LIFECYCLE
####
|
Now that we have created the input file, we can invoke the utility class to generate the SACL file that can then be read and parsed by WebSphere Service Registry and Repository and used as the governance lifecycle within WebSphere Service Registry and Repository.
The syntax of the class available in the resources jar is:
CreateSACL <input filename> [namespace] [output filename]
|
By default, if you do not specify an output filename, the output will be piped to stdout. As alluded to above,
the namespace (NAMESPACE:) that you may have specified in the input file can be
overridden by specifying one as input to the CreateSACL utility. If one is not
specified within the input file or on the command line then it will use
[output filename] if specified, as the namespace;
for example, file:///MadeUpCoLifecycle.txt. Otherwise, it will use
http://www.ibm.com/lifecycle/system/namespace
To convert the input text file into an understandable SACL file, run the following at the command prompt:
java -cp quickStartUtilities.jar com.ibm.serviceregistry.quickstart.CreateSACL
MadeUpCoLifecycle.txt MadeUpCoLifecycle.sacl
|
SACL files that are going to be loaded into WebSphere Service Registry and Repository need a corresponding OWL file. This is created by using
the XSLT file that is included with your WebSphere Service Registry and Repository installation; GenerateLifecycleOntology.xsl.
To create the OWL you will need to invoke the following from the command prompt:
java org.apache.xalan.xslt.Process
-in .\MadeUpCoLifecycle.sacl
-xsl .\GenerateLifecycleOntology.xsl
-out .\MadeUpCoLifecycle.owl
|
The output files; MadeUpCoLifecycle.sacl and MadeUpCoLifecycle.owl,
can now be loaded into your WebSphere Service Registry and Repository via the administration scripts or, for the owl file, via the WebUI.
Load the new SACL and matching OWL files into WebSphere Service Registry and Repository
Important: For WebSphere Service Registry and Repository V6.0.0.1, only one SACL file should exist within WebSphere Service Registry and Repository at any one time. Therefore, you need to ensure that there are not any entities under lifecycle and governance control within WebSphere Service Registry and Repository before removing your current lifecycle. Otherwise, unpredictable results could occur.
To remove the current SACL configuration file from WebSphere Service Registry and Repository, the following WAS administration command can be used:
wsadmin -wsadmin_classpath ServiceRegistryClient.jar
-f deleteConfiguration.jacl
LifecycleDefinition SACL
|
Note that paths to the relevant files will need to be included.
To load the new MadeUpCo Enterprises SACL file, the following command can be used:
wsadmin -wsadmin_classpath ServiceRegistryClient.jar
-f loadConfiguration.jacl
/temp MadeUpCoLifecycle.sacl LifecycleDefinition SACL true
|
Note that the path to the SACL file must, if necessary, use forward slashes.
The matching OWL file can be loaded into WebSphere Service Registry and Repository in the same way as loading the hierarchy OWL file is the first part of this article, for example,
wsadmin -wsadmin_classpath ServiceRegistryClient.jar
-f loadOntologySystem.jacl
/temp MadeUpCoLifecycle.owl
|
Using the new lifecycle definition
The new lifecycle can now be applied to entities within WebSphere Service Registry and Repository by performing the makeGovernable
action either using the API or applying the Default transition to an entity. After applying
the default transition you will be able to see, from within the WebUI (Figure 4), that your next transition from
Created can be Approve or Non-conformant,
as visualized in Figure 3.
Figure 4. Governed entity within WebSphere Service Registry and Repository using MadeUpCo Enterprises new lifecycle.
In this article, you learned how to quickly create and install a new classification system and a new default lifecycle for use within WebSphere Service Registry and Repository V6.0.0.1, so you can take advantage of the existing hierarchy of categories or a particular lifecycle within WebSphere Service Registry and Repository.
| Description | Name | Size | Download method |
|---|---|---|---|
| Utility classes to use with this article | 0703_shore-quickStartUtilities.jar | 18KB | HTTP |
Information about download methods
Learn
-
"Web Ontology Language (OWL)" is designed for use by applications that need to process the content of information instead of just presenting information to humans.
-
"Customizing the WebSphere Service Registry and Repository user interface" (developerWorks, Nov 2006) is a four-part series of articles that step-by-step guide that describes the concepts and architecture of the WebSphere Service Registry and Repository user interface.
-
Browse the technology bookstore for books on these and other technical topics.
-
Get the learning resources you need on the WebSphere Business Integration zone.
Get products and technologies
-
"WebSphere Service Registry and Repository product homepage". WebSphere Service Registry and Repository helps increase the business value of your service oriented architecture (SOA).
Ian Shore is an IT Specialist in the Application and Integration Middleware Software division of the IBM Software Group. For technical questions or comments about the content of this tutorial contact Ian at ishore@uk.ibm.com.
Comments (Undergoing maintenance)





