A continuation from the Part 1 article on how to define new custom Ontologies for use in IMM.
Once you have your properties and vocabulary defined, you now need to create classes to use those properties with. In IMM, there are a number of pre defined core classes that are used throughout the solution. Some examples of those include the VideoItem, AudioItem, and ImageItem classes. There are also some lower level base classes like MediaItem, Container, and Anchor that other classes can derive from. Most classes in IMM Core derive from the base IMM Object class.
To define your own classes, you have two choices, you can take an existing class such as VideoItem and add your own specific properties to it, or you can define your own custom class that is semantically different from the classes that IMM Core provides. Your custom classes should derive from one of the core types whenever possible.
To define a new class in SemanticWorks, just switch to the Classes tab and select the insert owl:Class button at the top of the tab page.
For this example, I am going to create a new Container type called Catalog. For sake of demonstration, I will define a Catalog as a virtual grouping of assets similar to a virtual folder in IMM, but in this case it may contain some more custom metadata and lets just say that it is semantically different than just a folder in the "Contoso" business rules.
So this new class would look like this in the Classes tab page.
Since our new Catalog can contain pointers to assets or other containers, we must set it to derive from the did:Container class in the IMM Core ontology.
To do so, click into the new cont:Catalog class and right click on the class. Select the add Subclass of menu option. Now, right click on the arrow subClassOf arrow and select add Class. From the drop down select the did:Container class.
You can now add custom properties and restrictions to this new class. I'll go back and create a new property called cont:ContainerName in the Contoso namespace, set it to type xsd:string, and then add it to the cont:Catalog class as a property restriction. The final class should look like this.
That's all there is to it. You can now get a lot fancier with defining more semantic information about your classes and their equivalents, etc...
Save the final OWL file for Contoso, and you should be able to generate .NET helper classes with the IMM 2.0 Visual Studio tools now. The tools will generate classes that derive from RdfObject tha can be used in IMM Workflows and your own custom web parts to create instances of RDF that will be valid within your custom ontology.