Creating a business model system file manually

When creating a business model system file, consider using only the OWL constructs that are described in this topic. Care must be taken over case sensitivity. OWL constructs are case sensitive and unexpected results occur if is not correct.

Examples supplied

The ModellingSample.owl file

In the Configuration perspective, click Active Profile > Business Model Systems.

Technical Model
Another example of how to create a business model.
WSRR System Properties
These are the registry annotations that are used when creating a business model. Import these files into any OWL editor tools you use, for validation purposes.

Always import this file as an owl:import into the owl:Ontology.

<owl:imports
  rdf:resource="http://www.ibm.com/xmlns/prod/serviceregistry/6/1/model"/>
WSRR Objects
These are representations of the service registry objects that can be used when setting up relationships in a business model. Import this file as an owl:import if relationships to specific registry object types are required.
<owl:imports rdf:resource="http://www.ibm.com/xmlns/prod/websphere/repository/v6r3/xsd"/>
<owl:imports rdf:resource="http://www.ibm.com/xmlns/prod/websphere/repository/base"/>
<owl:imports rdf:resource="http://www.ibm.com/xmlns/prod/serviceregistry/v6r3/wsrrbase"/>
<owl:imports rdf:resource="http://www.ibm.com/xmlns/prod/websphere/repository/policy"/>
<owl:imports rdf:resource="http://www.ibm.com/xmlns/prod/websphere/repository/v6r3/ibmsca"/>
<owl:imports rdf:resource="http://www.ibm.com/xmlns/prod/websphere/repository/v6r3/wsdl11"/>

The following is the basic template for creating a business model system:

<rdf:RDF xml:base="http://your.com/yournamespace"
  xmlns="http://your.com/yournamespace#"
  xmlns:srtest="http://your.com/yournamespace#"
  xmlns:wsrr="http://www.ibm.com/xmlns/prod/serviceregistry/6/1/model#"
  xmlns:rep63policy="http://www.ibm.com/xmlns/prod/websphere/repository/policy#"
  xmlns:rep63sca="http://www.ibm.com/xmlns/prod/websphere/repository/v6r3/ibmsca#"
  xmlns:rep63wsdl11="http://www.ibm.com/xmlns/prod/websphere/repository/v6r3/wsdl11#"
  xmlns:rep63xsd="http://www.ibm.com/xmlns/prod/websphere/repository/v6r3/xsd#"
  xmlns:repbase="http://www.ibm.com/xmlns/prod/websphere/repository/base#"
  xmlns:owl="http://www.w3.org/2002/07/owl#"
  xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
  xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#">
</rdf:RDF> 

Namespace

Set xml:base or xmlns or both, to your own namespace.

The URIs used in OWL files loaded into WSRR should be in URL format rather than a general URI format, starting with the format resource_type://. URIs in other formats, for example, urn: without the// characters, are not correctly identified as absolute URIs, and this might result in an xml:base value being prepended.

Creating a modelling ontology

When defining a business model owl file, always specify an ontology entry. In addition to the usual labels and comments, add an entry that denotes a prefix for the name of any property defined in the file.
<wsrr:prefix rdf:datatype="http://www.w3.org/2001/XMLSchema#string">
  yns
</wsrr:prefix>
where yns is the prefix that is added to any property in the owl file. For example if you have a property:
<owl:DatatypeProperty rdf:ID="StringProperty2">
the property name in the registry is yns_StringProperty2. You must provide a prefix value in a business model owl file. The prefix value must not be the same as a value in use by a previously loaded business model owl file. If this condition is not met, the file will be rejected when you attempt to load it.

The following example shows a typical Ontology entry.

owl:Ontology rdf:about="http://your.com/yournamespace">
    <wsrr:prefix rdf:datatype="http://www.w3.org/2001/XMLSchema#string">yns</wsrr:prefix>
<owl:imports rdf:resource="http://www.ibm.com/xmlns/prod/websphere/repository/v6r3/xsd"/>
<owl:imports rdf:resource="http://www.ibm.com/xmlns/prod/websphere/repository/base"/>
<owl:imports rdf:resource="http://www.ibm.com/xmlns/prod/serviceregistry/v6r3/wsrrbase"/>
<owl:imports rdf:resource="http://www.ibm.com/xmlns/prod/websphere/repository/policy"/>
<owl:imports rdf:resource="http://www.ibm.com/xmlns/prod/websphere/repository/v6r3/ibmsca"/>
<owl:imports rdf:resource="http://www.ibm.com/xmlns/prod/websphere/repository/v6r3/wsdl11"/>
<owl:imports rdf:resource="http://www.ibm.com/xmlns/prod/serviceregistry/6/1/model"/>
    <rdfs:label>Example Model</rdfs:label>
</owl:Ontology>

Creating a modelling class

All classes that are defined in a business model file will show up as business model templates and can be instantiated.
Note: Classes defined in a business model file must not subclass owl:Thing.

If there is a requirement not to show a class, for example if is a superclass of a number of other classes, the following annotation can be applied to that class. This will prevent it being shown in the business model templates.

<wsrr:abstract rdf:datatype="http://www.w3.org/2001/XMLSchema#boolean">
  true
</wsrr:abstract>
Note: The value of the boolean data type is case sensitive and only the following values are valid:
  • true
  • false
  • 1
  • 0
In the example there is a modelling class (ModellingClassExtension) that subclasses another class (ModellingClass). ModellingClassExtension supports a single string property (StringProperty)and a relationship (RelationshipObject). In order for properties and relationships to be regarded as being part of a model, they must be marked as an owl:Restriction.

Creating relationships

The following OWL construct should be used to define a relationship.
<owl:ObjectProperty rdf:ID="RelationshipObject">
     <rdfs:label>Typical Relationship</rdfs:label>
     <rdfs:domain rdf:resource="#ModellingClassExtension"/>
     <rdfs:range rdf:resource="#RelationshipClass"/>
</owl:ObjectProperty>
In this example the target of the relationship is a RelationshipClass that is also defined as a Business Model.

It is also possible to set relationships to point to registry objects. For example, if the targets of the relationships are to be WSDLDocument use:

<rdfs:range
  rdf:resource="http://www.ibm.com/xmlns/prod/websphere/repository/v6r3/wsdl11#WSDLDocument"/>

Inheritance also applies, so if you wanted to have a relationship with targets that are any document type then use.

<rdfs:range rdf:resource="http://www.ibm.com/xmlns/prod/websphere/repository/base
#Document"/>

The URIs that represent the target objects, have changed for WebSphere® Service Registry and Repository (WSRR) Version 6.3. The Registry Objects file has been removed from any profiles, as the information is now held internally. The Object URI table shows how to map the old URIs to the new URIs. If migrating from a previous version of WSRR, the URIs are changed automatically

To use the defined relationship in a class the following constructs should be added to the class.

<rdfs:subClassOf>
  <owl:Restriction>
    <owl:onProperty rdf:resource="#RelationshipObject"/>
    <owl:minCardinality rdf:datatype="http://www.w3.org/2001/
            XMLSchema#nonNegativeInteger">0</owl:minCardinality>	
  </owl:Restriction>
</rdfs:subClassOf>
<rdfs:subClassOf>
  <owl:Restriction>
    <owl:onProperty rdf:resource="#RelationshipObject"/>
    <owl:maxCardinality rdf:datatype="http://www.w3.org/2001/
            XMLSchema#nonNegativeInteger">2</owl:maxCardinality>
  </owl:Restriction>
</rdfs:subClassOf>

This indicates that the relationship points to objects of type RelationshipObject and there can be 0 to 2 of these objects.

Note: If an object A has a relationship to an object B, and the deletion of object B would cause the number of relationship targets to fall below the minimum cardinality that has been defined for the relationship, WSRR does not prevent the deletion of object B.

Creating properties

The following OWL constructs should be used to define a property
<owl:DatatypeProperty rdf:ID="StringProperty2">
    <rdfs:label>Typical String Property 2</rdfs:label>
    <rdfs:domain rdf:resource="#ModellingClassExtension"/>
    <rdfs:range rdf:resource="http://www.w3.org/2001/XMLSchema#string"/>
</owl:DatatypeProperty>

The domain does not have to be specified and any class that has a restriction to the property will have that property available to it. If a property must be specified explicitly on a class, then use the domain.

If a property is to be defined on more than one class, then use the following construct.

<rdfs:domain>
  <owl:Class>
    <owl:unionOf rdf:parseType="Collection">
      <owl:Class rdf:about="#Class1"/>
      <owl:Class rdf:about="#Class2"/>
    </owl:unionOf>
  </owl:Class>
</rdfs:domain>

rdf:about can be used as an alternative to rdf:ID

The possible range for a property can be one of the following XSD Schema type. The business model validator will validate the data only against these types

"http://www.w3.org/2001/XMLSchema#string";
"http://www.w3.org/2001/XMLSchema#anyURI";
"http://www.w3.org/2001/XMLSchema#boolean";
"http://www.w3.org/2001/XMLSchema#int";
"http://www.w3.org/2001/XMLSchema#integer";
"http://www.w3.org/2001/XMLSchema#short";
"http://www.w3.org/2001/XMLSchema#long";
"http://www.w3.org/2001/XMLSchema#float";
"http://www.w3.org/2001/XMLSchema#double";
"http://www.w3.org/2001/XMLSchema#dateTime";
"http://www.w3.org/2001/XMLSchema#time";
"http://www.w3.org/2001/XMLSchema#date";
Note: The business model validator sets the following default values:
"http://www.w3.org/2001/XMLSchema#anyURI"; urn:serviceregistry
"http://www.w3.org/2001/XMLSchema#boolean"; false
"http://www.w3.org/2001/XMLSchema#int"; 0
"http://www.w3.org/2001/XMLSchema#integer"; 0
"http://www.w3.org/2001/XMLSchema#short"; 0
"http://www.w3.org/2001/XMLSchema#long"; 0
"http://www.w3.org/2001/XMLSchema#float"; 0.0
"http://www.w3.org/2001/XMLSchema#double"; 0.0
"http://www.w3.org/2001/XMLSchema#dateTime"; Current date and time
"http://www.w3.org/2001/XMLSchema#time"; Current time
"http://www.w3.org/2001/XMLSchema#date"; Current date 

To use the defined property in a class the following constructs should be added to the class.

<rdfs:subClassOf>
  <owl:Restriction>
    <owl:onProperty rdf:resource="#StringProperty2"/>
    <owl:minCardinality  rdf:datatype="http://www.w3.org/2001/
            XMLSchema#nonNegativeInteger">1</owl:minCardinality>	
  </owl:Restriction>
</rdfs:subClassOf>

For properties of types other than boolean, if you declare the minCardinality to be 1, this means that a property must have a value, otherwise it is necessary only for the property name to exist. If a value is not mandatory, then set the minCardinality to 0.

For properties of type boolean, however, the property musty have a value, which must be either true or false. Note, however, that due to a limitation in the web user interface, the cardinality is always displayed as -1.

The construct can be replaced with

<rdfs:subClassOf>
  <owl:Restriction>
    <owl:onProperty rdf:resource="#StringProperty2"/>
    <owl:cardinality rdf:datatype="http://www.w3.org/2001/
            XMLSchema#nonNegativeInteger">1</owl:cardinality>	
  </owl:Restriction>
</rdfs:subClassOf>

Setting cardinality to 1 effectively sets minCardinality and maxCardinality to be 1.
A default value can be set up on the properties if required.

To do this add the following construct to the DatatypeProperty

<wsrr:default rdf:datatype="http://www.w3.org/2001/XMLSchema#string">
  The Default Value
</wsrr:default>
Note: For the property names specific to custom business models, the restriction for the name length is 1020 bytes less the number of bytes in base namespace.

Enumerations

There are two ways of declaring enumerations. Currently only xsd:string enumerations are supported.

In the first example, a DatatypeProperty points to the enumeration as the range:

<owl:DatatypeProperty rdf:ID="DataTypeProperty_StringEnumeration">
  <rdfs:label>Typical String Enumeration Property</rdfs:label>
  <rdfs:domain rdf:resource="#ModellingClassExtension"/>
  <rdfs:range rdf:resource="#StringEnumeration"/>
</owl:DatatypeProperty>

<owl:DataRange rdf:ID="StringEnumeration">
  <owl:oneOf rdf:parseType="Resource">
    <rdf:first rdf:datatype="http://www.w3.org/2001/
            XMLSchema#string">EnumerationString1</rdf:first>
    <rdf:rest rdf:parseType="Resource">
       <rdf:first rdf:datatype="http://www.w3.org/2001/
               XMLSchema#string">EnumerationString2</rdf:first>
       <rdf:rest rdf:parseType="Resource">
         <rdf:first rdf:datatype="http://www.w3.org/2001/
                 XMLSchema#string">EnumerationString3</rdf:first>
         <rdf:rest rdf:resource="http://www.w3.org/1999/02/22-rdf-syntax-ns#nil"/>
       </rdf:rest>
    </rdf:rest>
  </owl:oneOf>
</owl:DataRange>

In the second example, the DataRange is included in the DatatypeProperty:

<owl:DatatypeProperty rdf:ID="testProperty1">
 <rdfs:range>
  <owl:DataRange>
   <owl:oneOf>
    <rdf:List>
      <rdf:first rdf:datatype="http://www.w3.org/2001/XMLSchema#string">0</rdf:first>
      <rdf:rest>
       <rdf:List>
        <rdf:first rdf:datatype="http://www.w3.org/2001/XMLSchema#string">15</rdf:first>
        <rdf:rest>
         <rdf:List>
          <rdf:first rdf:datatype="http://www.w3.org/2001/XMLSchema#string">30</rdf:first>
          <rdf:rest>
           <rdf:List>
            <rdf:first rdf:datatype="http://www.w3.org/2001/XMLSchema#string">40</rdf:first>
           <rdf:rest rdf:resource="http://www.w3.org/1999/02/22-rdf-syntax-ns#nil" />
          </rdf:List>
         </rdf:rest>
        </rdf:List>
       </rdf:rest>
      </rdf:List>
     </rdf:rest>
    </rdf:List>
   </owl:oneOf>
  </owl:DataRange>
 </rdfs:range>
</owl:DatatypeProperty>
In previous versions, it was possible to load a file where there was no value in the enumeration field. For example:
<rdf:first rdf:datatype="http://www.w3.org/2001/XMLSchema#string"></rdf:first> 
If the type of the enumeration is not a string, for example int (XMLSchema#int), you must ensure that every entry in the enumeration has a value, because a check is made when loading the file to make sure the values are of the correct type.

Subclassing an existing business model system

Do not modify the business model system files that are supplied with WSRR. Instead, create a new business model system file that subclasses an existing business model system, and then modify the new file. To subclass an existing business model system, use a subClassOf element. The following example subclasses the Service business model:
<owl:Class rdf:about="http://www.ibm.com/subservice#MySubService">
  <rdfs:subClassOf 
    rdf:resource="http://www.ibm.com/xmlns/prod/serviceregistry/v6r3/ServiceModel#Service"/>
  <rdfs:label>my subservice class</rdfs:label>
</owl:Class> 

Creating an instance of a business model through the API

If it is necessary to create a business model instance through the API the steps required are as follows.

  1. Create an instance of a GenericObject
  2. Set the primaryType field to the uri of the business model. In the example this is http://your.com/yournamespace#ModellingClassExtension
  3. Add any properties and relationships, as defined by the model.
  4. Store the instance in the registry in the usual way.
  5. As the primaryType field has been set, the business model validator will be triggered, and will validate the data.