Sunday, November 1, 2009

Model the Ontology

Model the Ontology
Websphere Business Services Fabric v612
Contact us...

Model the Ontology

You can extend classes from the industry core model to create new assertionchannel, and role types to meet your unique and specific requirements.

Prerequisites

The Fabric modeling tool is installed.

Extend the industry core model classes

Extend the industry core model classes to create new assertionchannel, and role types to meet your unique and specific requirements.  These classes are in the Fabric-Model-Stubs project().

Example:
Extend EnumeratedValue using CustomerTypeEnumeration().
  1. Expand a package that contains the subclass (i.e VehicleLoanOntology\Models\VehicleLoanOntologyModel\extensions package, ()). 
  2. Double-click the Main diagram. 
  3. Select the subclass (i.e CustomerTypeEnumeration) and drag/drop it into the Main diagram.
  4. Find the superclass that you want to extend (i.e Fabric-Model-Stubs\Models\Fabric-Core\Core Ontology\EnumeratedValue) and drag/drop it into the same Main diagram().
  5. Extend the superclass (i.e EnumeratedValue) by connecting the subclass (i.e CustomerTypeEnumeration) to the superclass (i.e EnumeratedValue).  From the Palette menu, click Class\Generalization, click the subclass (i.e CustomerTypeEnumeration) and drag/drop the connection to superclass (i.e EnumeratedValue().

Create class instance

In UML models, instance specifications are elements that represent an instance in the modeled system. When you instantiate a classifier in a model, the instance specification that you create represents an entity in the modeled system at a point in time, similar to a snapshot of the entity. You can model changes to the entity over time by creating several instance specifications, one for each snapshot.

Example:
Create the following class instances().
  1. From the Palette menu, click Instance\Class Instance().  Click on the canvas and in the dialog box that appears click Select Existing Element.  
  2. In the Select Element window(), click the Browse tab and select a class you want to instantiate (i.e CustomerTypeEnumeration).  Click OK. A new class instance is created.
  3. Select the new class instance() by clicking it (i.e CustomerTypeEnumerationInstance). 
  4. Click on the Properties\General tab and change the name of the class instance (i.e to CustomerTypeEnumerationInstance:Premium).  In addition, enter a value in the Value: field (i.e Premium).
  5. You can create as many instances of the same class as required (i.e Regular and New instances, ).

7. Create a package named ontology. Apply the fabricNamespace stereotype to this package. In the Stereotype Properties table, in the Directory field, type vehicleloan-assertions, and in the uri field, type http://www.ibm.com/vehicleloan/assertions().

8. Double-click the Main diagram for the ontology package. From the Palette menu, click Class\Class, and create a class named CustomerTypeAssertion(). Click the Stereotypes tab, and apply the stereotypes for this class by clicking the fabricAssertion, owlClass, and rdfs:label stereotypes. In the Label field, type Customer Type Assertion().

9. Go to the Properties section, and click Advanced. Click AssertionDuplicateAllowed, and click the Value True().

10. Drag/drop the ContentBasedAssertion class from the Fabric-Model-Stubs\Models\Fabric-Core\Policy Assertion Ontology package onto the Main diagram.  In the Palette menu, click Class\Generalization and connect CustomerTypeAssertion to ContentBasedAssertion().

11. In the Properties section, click the Attributes tab(). Click the drop-down list (right of the rectangle icon) and select attribute.  A default attribute is created.   Rename the default attribute name to hasCustomerType.  Click on the Type column and select the browse button.  In the Select Element for Type window() select the Search tab and enter a search character/s (i.e s).  All the Types that contains the search character/s appears in the seach result box.  Select the required Type (i.e XSDDataTypes::string) and click OK.

12. Click Stereotypes. Apply the following stereotypes to this attribute: fabricAssertedProperty, owl:DatatypeProperty, owl:FunctionalProperty, rdfs:label().

13. Scroll down to the Stereotype Properties section, and enter the following values():
assertionPropertyComparator: EqualsComparator
controlWidget: referenceSelect
label: CustomerType



14. Expand package extensions. Click and drag the CustomerTypeEnumeration OWL class from the extensions package onto the diagram. Click and create a directed association from the CustomerTypeAssertion towards CustomerTypeEnumeration. In the label field, type hasCustomerType, and apply the fabricEnumeratedProperty stereotype to it, as shown in Figure 8-38.

Figure 8-38 Create directed association


15. Repeat the above steps to create a new assertion called LoanAmountAssertion with the attribute hasLoanAmount, and create a generalization association from LoanAmountAssertion to ContentBasedAssertion, as shown in Figure 8-39.

Figure 8-39 Create generalization association


16. Repeat the steps and create assertions BankIdentifierAssertion, RatingScoreAssertion, and CreditCheckCostAssertion. Figure 8-40 is the final diagram that shows all of the assertions.

Related links




8.7.5 Ontology modeling

Perform the following:

1. Click VehicleLoanOntology Æ Model Æ VehicleLoanOntologyModel. Expand the extensions package. Double-click the Main diagram. Click extensions Æ <<owlClass>>CustomerTypeEnumeration, and drag the CustomerTypeEnumeration OWL class from the extensions package and drop it onto the Main diagram, as shown in Figure 8-32.
 
Figure 8-32 Extensions package view

2. Expand Fabric-Model-Stubs Æ Models Æ Fabric-Core Æ Core Ontology. Click the Enumerated Value class, and drag it to and drop it on the Main diagram.
3. From the Palette menu, click Generalization, and click CustomerTypeEnumeration. Hold the mouse, and click EnumeratedValue.
4. From the Palette menu, click Class Instance, as shown in Figure 8-33.
 
Figure 8-33 Create new class instance

5. Click the canvas, and click Select Existing Element, as shown in Figure 8-34.
 
Figure 8-34 Select existing element

6. In the dialog, click CustomerTypeEnumeration. Go to Properties and change the name to CustomerTypeEnumeration:Premium. Type Premium for the Value, which creates an instance with value Premium. Similarly, create Instances for the Regular and New customer types, as shown in Figure 8-35.
 
Figure 8-35 CustomerType enumeration

7. Create a package named ontology. Apply the fabricNamespace stereotype to this package. In the Stereotype Properties table, in the Directory field, type vehicleloan-assertions, and in the uri field, type http://www.ibm.com/vehicleloan/assertions.
8. Double-click the Main diagram for the ontology package. From the Palette menu, click Class, and create a class named CustomerTypeAssertion. Click the Stereotypes tab, and apply the stereotypes for this class by clicking the fabricAssertion, owlClass, and rdfs:label stereotypes. In the Label field, type Customer Type Assertion, as shown in Figure 8-36.
 
Figure 8-36 Applied Stereotypes for Assertion

9. Go to the Properties section, and click Advanced. Click AssertionDuplicateAllowed, and click the Value True, as shown in Figure 8-37.
 
Figure 8-37 Properties view

10. Expand the Fabric-Model-Stubs Æ Models Æ Fabric-Core Æ Policy Assertion Ontology project, and drag the ContentBasedAssertion OWL class from the Policy Assertion Ontology, and drop it onto the Main diagram. From the Palette menu, click generalization, and click CustomerTypeAssertion. While you hold the mouse, click ContentBasedAssertion.
11. In the Properties section, click attribute. Add an attribute to the CustomerTypeAssertion class called hasCustomerType of type xsd:string.
12. Click Stereotypes. Apply the following stereotypes to this attribute: fabricAssertedProperty, owl:DatatypeProperty, owl:FunctionalProperty, rdfs:label.
13. Scroll down to the Stereotype Properties section, and enter the following values:
    assertionPropertyComparator: EqualsComparator
    controlWidget: referenceSelect
    label: CustomerType
14. Expand package extensions. Click and drag the CustomerTypeEnumeration OWL class from the extensions package onto the diagram. Click and create a directed association from the CustomerTypeAssertion towards CustomerTypeEnumeration. In the label field, type hasCustomerType, and apply the fabricEnumeratedProperty stereotype to it, as shown in Figure 8-38.
 
Figure 8-38 Create directed association

15. Repeat the above steps to create a new assertion called LoanAmountAssertion with the attribute hasLoanAmount, and create a generalization association from LoanAmountAssertion to ContentBasedAssertion, as shown in Figure 8-39.
 
Figure 8-39 Create generalization association

16. Repeat the steps and create assertions BankIdentifierAssertion, RatingScoreAssertion, and CreditCheckCostAssertion. Figure 8-40 is the final diagram that shows all of the assertions.
 
Figure 8-40 Modeled assertions

























































































No comments:

Post a Comment