Creating your first story

This section shows the creation of a simple story called Hello my Lord. The source code of this story comes together with the distribution and can be found in the dgiovanni/src/stories/helloMyLord/ package.

Starting the story ^

After downloading DGiovanni, the simplest way to start the Hello my Lord story is:

Hello_my_Lord.bat (For Windows)

or

Hello_my_Lord.sh (For Unix/Linux)

Creating a new project ^

For the creation of a new story the first thing to be done is the creation of its ontology. For this, in the following example, it will be used the NeOn Toolkit ontology engineering environment (http://neon-toolkit.org/wiki/Main_Page). First, a new project must be created. In this case, its name will be HelloMyLord.

Creating a new project


Defining the name of the project


The new project in the ontology navigator


Importing the DGiovanni's ontologies ^

The next step is to import the DGiovanni's archTbox.owl and archAbox.owl from dgiovanni/src/dgiovanni/ontology/ directory.

Importing an ontology from the filesystem


Importing the tbox of the architecture


Importing the abox of the architecture


Creating one ontology for the story ^

Create a new ontology and add the ontology identifier (e.g. http://dgiovanni.sourceforge.net/stories/ontology/HelloMyLord) and the default namespace (e.g. http://dgiovanni.sourceforge.net/stories/ontology/HelloMyLord#).

Creating the abox of the story


The HelloMyLord ontology must import the DGiovanni's archAbox.

The abox of the story importing the architecture's abox


Now create the individuals for the classes. For the HelloMyLord story the following individuals have been created:


Adding the new ontology to the configuration file ^

Now copy the created abox to its final location (e.g. dgiovanni/src/stories/helloMyLord/ontology/) and add it to the architecture's configuration file (dgiovanni/config.xml). In this case, the id is a string value used to define the story to be started, the attribute name keeps the name of the story, the iri relates to the full Internationalized Resource Identifier of the story's instance, the ontology refers to the location of story's owl file, and the attribute disposeOfReasonerAfterLoading indicates whether the OWL Reasoner that reasons over the "root" ontology (the user defined story abox) must be disposed of after the story loading. Indeed, if the attribute disposeOfReasonerAfterLoading is "false", it is possible to get a reference to the reasoner by means of the dgiovanni.core.system.SystemObjHolder class.

The architecture's configuration file


In the next figure it is possible to see how the IRI/URI of the story can be discovered .

Discovering the IRI of the story's instance


Finally, now it is time to create the JAVA classes that are loaded through reflection, and the asl files that contain the characters' behaviors and where the beats are coded. As an example, see the source code of the Hello My Lord story that can be found in the dgiovanni/src/stories/helloMyLord/ package.