d6c development support design - gforge.inria.fr ·...
TRANSCRIPT
IST Amigo Project
VantagePointUser’s Guide
October 2007 Amigo
Amigo IST2004004182 1/20
Project Number : IST004182
Project Title : Amigo
Deliverable Type : User’s Guide
Deliverable Number :
Title of Deliverable : VantagePoint User’s Guide
Nature of Deliverable :
Internal Document Number :
Contractual Delivery Date :
Actual Delivery Date :
Contributing WPs : WP3
Author(s) : VTT: Ilkka Niskanen, Toni Piirainen
AbstractThe purpose of this tutorial document is to introduce Amigo application developers to VantagePoint.VantagePoint tool is a Java application that can visualize, query and edit OWL ontologies that model anenvironment of choice. In addition, VantagePoint offers interfaces to Amigo Semantic ServiceRepository and Context Broker components. The tutorial includes four parts: introduction ofVantagePoint, overview of the components in it, installation and the usage of the tool.
Keyword listVantagePoint, Amigo Middleware, Context Broker, Semantic Service Repository, Applicationdevelopment and testing
October 2007 Amigo
Amigo IST2004004182 2/20
Table of Contents
Table of Contents ............................................................................................... 2
Chapter 1 Introduction ...................................................................................... 3
Chapter 2 Components ...................................................................................... 4
Chapter 3 Deployment ....................................................................................... 5
Chapter 4 VantagePoint Quick Start ................................................................ 8A.1 Creating scenarios .................................................................................................................... 8
4.1.1 Creating a new model ........................................................................................................... 84.1.2 Adding a new area ................................................................................................................ 94.1.3 Adding a new item................................................................................................................ 94.1.4 Move.................................................................................................................................. 114.1.5 Delete ................................................................................................................................. 114.1.6 Rotate................................................................................................................................. 114.1.7 Saving the model ................................................................................................................ 11
A.2 Executing queries ................................................................................................................... 124.2.1 Textual query...................................................................................................................... 124.2.2 Graphical Query ................................................................................................................. 12
A.3 Adding Services ...................................................................................................................... 144.3.1 Creating Item Libraries ....................................................................................................... 144.3.2 Registering services ............................................................................................................ 15
A.4 Adding Context Sources ......................................................................................................... 164.4.1 Static context sources.......................................................................................................... 174.4.2 Dynamic context sources .................................................................................................... 174.4.3 Sensor context sources ........................................................................................................ 184.4.4 Managing RDF capabilities................................................................................................. 184.4.5 User locator service ............................................................................................................ 19
October 2007 Amigo
Amigo IST2004004182 3/20
Chapter 1 Introduction
VantagePoint is a tool for the software developer who wishes to create contextaware andservicebased applications. One of the biggest advantages of VantagePoint is that it allowseasily and illustratively creating semantic context models and simulating service andcontext events occurring in them.
This user’s guide document gives an introduction for application developers on how to useVantagePoint tool and exploit the services it provides. The document gives in depthinstructions on how to install VantagePoint to OSGi framework, create semantic contextmodels and cause context change events for context aware applicatons by using theediting operations provided by VantagePoint. It also explains how new services andcontext sources can be added and registered to Amigo network with VantagePoint. Thisuser’s guide as well as the related bundles and their source code can be found at Amigoopen source web page. Additional information about the VantagePoint tool can be found athttp://www.vtt.fi/proj/vantagepoint/index.jsp?lang=en.
This user’s guide is divided into two separate sections. The first one gives instructions onhow VantagePoint and related bundles can be installed in to OSGi framework. The secondsection explains how example scenarios can be easily and illustratively created with theediting operations of VantagePoint and how context sources and services can be added tothis scenario.
October 2007 Amigo
Amigo IST2004004182 4/20
Chapter 2 Components
VantagePoint is delivered in two versions: VantagPoint_1.0.zip and VantagePointAmigo1.0_No_modified_Amigo_MW_bundles.zip. In this document it is presumed that the user hasdownloaded the former mentioned and more extensive VantagePoint version.VantagePoint_1.0.zip archive contains the following components:
vantagepoint.jar: This JAR archive contains all the VantagePoint classes. It can beexecuted independently by running it from the command line or doubleclicking the fileicon. This way VantagePoint will start up in offline mode which means that one canbuild semantic context models but cannot access Amigo Semantic Service Repositoryor Context Broker. VantagePoint.jar is also an OSGi bundle that registers a callbackinterface for the service repository and context broker and launches VantagePoint inonline mode. Now the user can access the service repository and context brokerassuming that the VPAmigoAdapter bundle has been started as well.
vpamigoadapter.jar: This is the adapter bundle that searches the Amigo SemanticService Repository and Context Broker via Amigo lookup and publishes a basic OSGiservice for VantagePoint to use. Via this adapter interface, VantagePoint can registerand unregister services and context sources.
Jena2.4(vp_mod).jar: This library bundle provides all the necessary Jena libraries forVantagePoint to work.
broker(vp_mod).jar: Modified Context Broker component for test usage
semanticrepository1.1.0(vp_mod).jar: Modified Semantic Service Repositorycomponent for test usage
VantagePoint root folder: A folder that contains the bundles as well as the necessaryfolders for VantagePoint to function properly.
o bundles: contains the bundles except vantagepoint.jaro config: contains the ontpolicy.rdf that defines the use of local ontology copieso graphic: contains all the images and iconso lib: place for external libraries like Jenao models: contains all the RDF files that model an environment like homeso ontologies: contains all the ontology fileso services: contains the semantic service descriptionso items: contains the item libraries
October 2007 Amigo
Amigo IST2004004182 5/20
Chapter 3 Deployment
To use VantagePoint you need a version of the Java Runtime Environment (Version 1.6.X). Inaddition you must install an Oscar platform.
1. Download the ‘VantagePoint_1.0.zip’ fromhttp://www.vtt.fi/proj/vantagepoint/index.jsp?lang=en. Unzip the files.
2. Download preconfigured Oscar platform fromhttp://amigo.gforge.inria.fr/obr/tools/index.html.
3. Launch Oscar.
4. Download the bundles shown in Figure 1 from OBR by selecting bundles one at a timeand clicking the ‘start all’ button. NB, when downloading Context Source Manager DONOT press ‘start all’. Instead use the ‘deploy’ button. If you use ‘start all’ with ContextSource Manager it will automatically download a version of the Jena bundle that doesnot export all necessary classes for VantagePoint. The modified Jena bundle forVantagePoint is installed in the next step. (the URLs for the bundle repositories arehttp://amigo.gforge.inria.fr/obr/tools/oscarrepository.xmlhttp://amigo.gforge.inria.fr/obr/v2/repository.xml).
Figure 1: The bundle configuration
If you encounter problems on accessing the OBR, try to edit the proxy settings definedin ‘system.properties’ file which is located in the ‘lib’ folder.
5. Install the context broker, the Jena 2.4 and the Amigo semantic service repositorybundles from the ‘bundles’ folder found in the VantagePoint_1.0.zip. Note that youmust add some additional folders to your OSGi folder to be able to use the semantic
October 2007 Amigo
Amigo IST2004004182 6/20
service repository. See document SDSDCAE_User_Guide.doc fromhttps://gforge.inria.fr/frs/?group_id=160 to get more detailed information about how toinstall and deploy the semantic service repository.
6. Before you install the vantagepoint.jar bundle, you have to execute some configurationoperations. To ensure that VantagePoint finds all the necessary ontologies andlibraries, the 'ontpolicy.rdf' file must be modified. This file can be found in the"configuration" folder which is located in the ‘VantagePoint’ folder. Edit the ‘alternativeURI's for user ontologies’ section by changing the file paths as demonstrated in thefollowing example: The original ontology specification.
If you have downloaded VantagePoint for example to folder "C:/myprojects/..." youmust change the alternative URL as follows:
This operation must be carried out for all ontology specifications under the ‘alternativeURI's for user ontologies’ section. Once you have carried out these configurationoperations, install the VantagePoint bundle.
It is also essential to remember that the additional VantagePoint folders (configuration,graphic, libraries, models, ontologies and queries) must be located at the same rootfolder as the ‘vantagepoint.jar’ OSGi bundle.
7. Install the VantagePoint Amigo Adapter bundle to the OSGi framework.
8. Start the manually installed bundles one by one. As you start the VantagePoint bundle,you should see the VantagePoint user interface appearing to the screen.
NOTE: If the OSGi framework produces some error messages during the starting ofthe VantagePoint or the adapter bundle, it is usually because of the dependiencyproblems between some of the bundles. Try to stop the VantagePoint and the adapterbundle, shut the Oscar down, launch it again and restart the VantagePoint and theadapter bundles
The final bundle configuration can be seen in Figure 2.
October 2007 Amigo
Amigo IST2004004182 7/20
Figure 2: The final bundle configuration
October 2007 Amigo
Amigo IST2004004182 8/20
Chapter 4 VantagePoint Quick Start
This chapter goes through the basic functionalities of VantagePoint. First we will look intocreating scenarios which is basically building semantic context information graphically. Secondwe will see how VantagePoint supports the querying of semantic data. Then we will continueto adding services to the Amigo Semantic Service Repository, and finally we will see how toregister context sources to Amigo Context Broker.
A.1 Creating scenarios
VantagePoint provides a possibility to create scenarios which simulate realworld or abstractenvironments and different context changes occurring in them. These scenarios should helpdevelopers to create and test context aware applications, for example. In the followingsections we introduce how scenarios can be graphically configured using VantagePoint.
4.1.1 Creating a new model
The creation of a new context model is started by first selecting the ‘Context sources’ tab andthe pressing the ‘New Context Source’ button. Next you have to name your own contextsource and it will appear to the list of available context sources. As you double click yourcontext source, an RDF description of the context source will appear to the visualization area.
VantagePoint provides three distinct views to the visualized model: the edit view, the isometricview and the text view. You are able to change the view from the dragdown menu locatedabove the visualization. At this point the views are obviously still quite empty as no areas oritems have been added.
The edit view is a ground plan like view to the model that has been visualized. The edit view isnot as impressive as the isometric view, but it enables to add items and areas more accuratelyto the model. Also reassigning the instances’ locations is easier in this view. Normally, all theadding and editing operations are carried out in this view.
The purpose of the isometric view is to visualize models in a more impressive way. The areasand items are drawn with more details than in the edit view and you should get a bettergeneral view of the contextual environment. However isometric view does not offer asaccurate editing and adding operations as the edit view.
The text view shows the visualized context model in a textual form. It enables to examine thestructure of the OWL file and see how the changes made in the visualization have affected themodel.
October 2007 Amigo
Amigo IST2004004182 9/20
4.1.2 Adding a new area
The adding of a new area is started by selecting the Areas tab. At first you are able to choosewhich texture you want to use to your area by selecting the texture from the list of differentfloor materials. The textures can only be seen in the isometric visualization. An area is createdby selecting the area drawing button from the ‘Areas’ tab and clicking somewhere in thevisualization to point the first corner point of the new area and then dragging the mouse withthe left mouse button held down. As you drag your mouse a rectangle appears to the screen.This rectangle marks the outlines of the area being created. As you let go the left mousebutton, a dialog box will be opened. In this dialog box you are able to name the area. Press the‘OK’ button, and the area will appear to the visualization.
Figure 2: The ‘Add area’ operation
4.1.3 Adding a new item
The adding of items is started by selecting the ‘Items’ tab from the right side of the userinterface. Items can only be added in the edit view. Start by selecting an item library from thelist shown in the lowest part dialog. Current VantagePoint version contains a couple ofpredefined example item libraries but users are able to add their own additional item librariesby inserting new owl files into the ‘items’ folder. To get more detailed information about how tocreate new item libraries, see Section 4.3.1.
Once you have selected an item library from the list, the items belonging to this library willappear to the list located above the library list. When selecting an item from the list, the iconrepresenting this item will appear to the upper part of the dialog. In addition, a selection ofproperties belonging to the selected item will appear to the properties list, which is locatedbelow the icon. If the selected item contains some extra data, like a service description, it isalso shown in the properties list (see Chapter 4.3 for details).
October 2007 Amigo
Amigo IST2004004182 10/20
You can add the item into the model by pressing your left mouse button above the icon anddragging it into the visualization. Once the item is in right position release your mouse buttonand a dialog will appear in which you can name the item. Note that you are not able to additems outside of areas. The adding of items is presented in Figure 3.
Figure 3: The add item operation
Once you have added the items and areas your model is ready. In Figure 4 is presented ascreenshot from VantagePoint GUI, in which an example scenario is created.
Figure 4: The VantagePoint user interface
October 2007 Amigo
Amigo IST2004004182 11/20
Besides of creating scenarios, VantagePoint provides possibities to edit them. The operationsfor the editing activities are described in the following sections.
4.1.4 Move
The “Move” operation allows you to set freely the position of a certain item or area. Once youhave highlighted an area or an item, and pressed the “Move” selection, you can see that thesymbol of the cursor has changed into four crossed arrows. This means that you now are ableto move the instance. Press down the left mouse button and move it around. You can see thatthe selected instance is following the cursor. Once you are happy with the position of theinstance, release the mouse button, and the instance will stay at this position.
4.1.5 Delete
The “Delete” operation allows you to remove items or areas. Just click on a certain instanceand select “Delete”. As the selected instance disappears from the screen, it is also removedfrom the semantic model. Notice that if you choose to remove an area, all items and areasinside that area are removed.
4.1.6 Rotate
This operation works only for items. Highlight an item and choose a direction from the list ofdirections. The direction of the selected item will change.
4.1.7 Saving the context source
To reuse the same scenario again, the context source model must be saved. The model issaved by selecting the ‘Save As’ button from context source tab. The active context source willbe saved to the model repository with the name you define and can be reopened with the“Open Context Source’ selection.
October 2007 Amigo
Amigo IST2004004182 12/20
A.2 Executing queries
VantagePoint offers two ways to make queries: a textual query and a graphical query. Bothquery types cand be found in the query tab and support the SPARQL query language.
4.2.1 Textual query
In the textual query entry you can freely determine your own queries and thus retrieve any kindof information about the model. Write a query statement to the query area, press the ‘Execute’button and the results willl appear to the information area, which is located below thevisualization. Note that the executed query statements do not disappear, but can be found inthe list below the query area. These queries can be loaded back to the query area by doubleclicking them. A screenshot from the textual query entry is presented in Figure 5.
Figure 5: Textual query
4.2.2 Graphical Query
In the graphical querying you can get some additional information about the instances byclicking them in the visualization. Start by pressing the ‘Settings” button in the queriesq tab(see Figure 7), and the ‘Graphical querying’ dialog will appear to the screen. In this dialog youcan determine the query set that will be used in the graphical querying. The main idea is thatall the queries contained by the selected query set will be executed when an instance is beingclicked in the visualization.
October 2007 Amigo
Amigo IST2004004182 13/20
At first you are able to either select one of the predefined query sets or create a new one. Ifyou select a predefined query set, the queries contained by this set will appear to the ‘Queries’text area. If you choose to add your own query set, you have to press the ‘Add’ button locatednext to the ‘Query sets’ text area. A dialog box is opened in which you have to name the queryset. The next step is to select the created query set from the query set list and start to add newqueries to it one by one. This is carried out by pressing the ‘Add query’ button, which is locatedon the right side of the ‘queries’ text area (see Figure 6 to get a better insight about thestructure of the dialog box).
As you press the ‘Add query… ’ button, a new dialog box is opened. In this dialog box you haveto name your query and then define the actual query statement to the “Query statement” textarea. When you press the ‘+ instance +’ button, a string “<#INSTANCE#>” will be added to thequery string. This means that once you have defined your query and started to use it in thegraphical querying, the string “<#INSTANCE#>” will be replaced with a textual definition of theinstance that you select from the visualization. So for example if you want to make a queryabout a certain area, just click the desired area and the string “<#INSTANCE#>” is replacedwith the textual definition of the area that you have just selected. If you select another area,the string “<#INSTANCE#>” will be replaced with the textual definition of that area and so on.In this way you can direct the same queries to different instances. When you have definedyour query statement, press the ‘Add’ button and the query will appear to the queries list. Youcan define as many queries as you want and they all are executed when an instance is beingclicked. Note that you are also able to edit or remove existing queries.
Figure 6: The Graphical query dialog box
As you define your own query sets, VantagePoint stores them automatically in memory. In thisway your query sets will be available when you next time launch VantagePoint. At the bottomof the graphical query dialog there are two buttons: ‘OK’ and ‘Cancel’. If you press the ‘OK’button, the selected query set will be activated and the name of this set appears below the‘Settings’ button in the queries tab (see Figure 7). If you press the ‘Cancel’ button, none of the
October 2007 Amigo
Amigo IST2004004182 14/20
query sets will be activated. Finally, you are able to mark the graphical querying as enabled bychecking the check box located in the bottom of the queries tab.
Figure 7: The Graphical querying in the query tab
A.3 Adding Services
VantagePoint can register services to Amigo Semantic Service Repository when items aredragged to the environment. This requires creating service descriptions and special itemlibraries. The instructions on how to create semantic service descriptions are found fromAmigo open source repository and will not be covered here.
The service tab shows the state of the service repository. From this tab you can register andunregister services. If your application registers services, they will appear in the list of servicesin the services tab. All the operations on the repository will be printed in the VantagePointconsole for testing purposes. One can also test service requests and see the results in theconsole.
4.3.1 Creating Item Libraries
Item libraries are RDF data sets (RDF files) that describe available items. Basically one itemonly needs to announce which icon it uses from the icon library. All the other properties areoptional. If the item provides services, it needs to mention the location of the AmigoSdescription, the service grounding and possible ontologies that will be necessary to import tothe semantic service repository. In addition to service descriptions, the item can specify theOWL class that it belongs to and have additional properties.
Below one can see an example item. One item library file contains multiple items like the onein the example. The only necessary ontologies that must be imported in the item library file arevantagepoint.owl and iconlibrary.owl which you will find from the “ontologies” folder of yourVantagePoint root directory. A good way to check that your item libraries are valid is to browsethe libraries with VantagePoint. If the library is not valid you will see warning messages in theVantagePoint console.
October 2007 Amigo
Amigo IST2004004182 15/20
Figure 8: An example of an item from a library
Creating your own icons to VantagePoint is a different subject and is described in thedeveloper’s guide.
4.3.2 Registering services
When the item is dragged to the house it will be given a name by the user. All the propertiesattached to the library item will be also attached to the one just created. If the item happens tohave the property VantagePoint:providesService, the specific service will be registered to theservice repository. The current VantagePoint version contains an example item library‘AmigoItems.xml’ with two items providing services: a coffee machine and a radio. In Figure 9is presented an example environment, in which these items are added. As can be seen, theservices provided by the items are registered to the service repository. In order to actuallyaccess those services they need to be published as web services which is covered in servicetutorials.
Figure 9: Service registering
User can also register services without attaching them to items via graphical user interface.The locations of the semantic description and the grounding of the service to be registered can
October 2007 Amigo
Amigo IST2004004182 16/20
be entered to the text fields shown in Figure 9. Later on the user can attach those services toitems in the house by rightclicking the item and selecting the attach service option
Items can also be simple decorations or provide some extra information as RDF properties toenrich the complete semantic model of the house. Persons can be defined in item libraries aswell and they can have static preference information attached as extra information.
VantagePoint provides a possibility to test the service requests by defining a task descriptionor a service type. The tested service description can be defined in the task description fieldand the service type class can be entered to service type field, as shown in Figure 10. Therequests are tested by pressing the ‘getServicesForTask()’ and ‘getServiceWithType()’buttons.
Figure 10: Test service requests
The results of the service request tests are printed in the console. An example result is shownin Figure 11. As can be seen the service type URI‘http://amigo.gforge.inria.fr/owl/AlarmClockOntology.owl#FmRadio’ produced one result:‘http://amigo.gforge.inria.fr/owl/FmRadio.owl#FmRadio’
Figure 11: An example service request test result
A.4 Adding Context Sources
VantagePoint can register Amigo compatible context sources to Context Broker. There arethree types of context sources: static context sources, dynamic context sources and sensorcontext sources. Each of these are different but they all implement the context source interfacewhich is basically querysubscribeunsubscribe.
October 2007 Amigo
Amigo IST2004004182 17/20
VantagePoint context source tab has two lists which store context sources. The upper list is aview to the actual Context Broker and the other is the list of available context sources thatVantagePoint has at the moment. In order to register context sources to Context Broker onemust first add them to the available context sources list, then select a context source from thelist, and finally, press the ‘Register’ button. Unregistering a context source from the contextbroker will return the source to the list of available context sources. The registering andunregistering of context sources is illustrated in Figure 12.
Figure 12: Registering and unregistering services
4.4.1 Static context sources
Static context sources are loaded from RDF files or can be created graphically withVantagePoint. The basic idea is that the context source offers more or less static set of RDFstatements. All static context sources can be viewed in text view, edit view and isometric view.If the static context source does not contain any items or areas the edit and isometric willappear empty. Drawing to this empty space will add RDF statements to the context source andcause context events. This is the same if the user has loaded a static context source from afile representing a home environment, he can cause context events by modifying the view forexample moving a person to another location.
One can load static context sources from the context source tab by choosing the RDF file fromthe file system. Once the context source is in the available context sources list, one can view itby doubleclicking the list entry.
4.4.2 Dynamic context sources
Dynamic context sources are developer made Java classes that implement the context sourceinterface. They can be added from the context source tab by choosing the specific class filesfrom the file system. If the classes do not implement the required interface the console will
October 2007 Amigo
Amigo IST2004004182 18/20
report about it. With dynamic context sources the developer has total freedom of quicklycreating custom context sources for his testing purposes.
Dynamic context sources can be observed with the text view. The view can be refreshed bythe user and all the events will be shown in the console.
4.4.3 Sensor context sources
VantagePoint has been integrated with SimuContext framework which provides sensorsimulation. To add a sensor context source load a sensor from CFG file. A sensor setup panelis available for the user in SimuContext libraries to configure the sensor CFG files.
Sensor configuration essentially has two parts: the configuration of the information that thesensor produces and at what rate. The user can select value ranges for the sensor and therate of events that it generates. Values and event rate can be predefined or generated atrandom.
4.4.4 Managing RDF capabilities
Context sources can describe themselves by using short rdf descriptions that give an insighton what kind of context information the sources are able to provide. For example a contextsource that provides information about the locations of different entities can advertise itselfwith the following rdf description:
<?xml version='1.0' encoding='UTF8'?><rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22rdfsyntaxns#"
xmlns:rdfs="http://www.w3.org/2000/01/rdfschema#" xmlns:owl="http://www.w3.org/2002/07/owl#" xmlns:j.0="http://amigo.gforge.inria.fr/owl/AmigoICCS.owl#" xmlns:daml="http://www.daml.org/2001/03/daml+oil#" xmlns:j.1="http://amigo.gforge.inria.fr/owl/ContextTransport.owl#"><j.1:ContextSourceRegistration> <j.1:contextType>EntityLocation</j.1:contextType></j.1:ContextSourceRegistration>
</rdf:RDF>
VantagePoint provides support to manage and control these rdf descriptions by allowing toprint and set the descriptions, and simulate a context source discovery. These operations canbe found in the context source tab and are presented in Figure 13.
October 2007 Amigo
Amigo IST2004004182 19/20
Figure 13: The operations to manage rdf capabilities
To print the rdf capabilities of a context source, select the source from the list of availablecontext sources, press the ‘Print Capabilities’ button and the capabilities will printed in theconsole. To set a rdf capability description for a context source, select the source from theavailable context source list, press the ‘Set Capabilities’ button and a file browser dialog isopened. Now you are able to select an rdf description in an xml file format from the file system,which then will be attached to the selected context source.
In addition, VantagePoint provides a possibility to simulate context source discovery. This iscarried out in the context source tab as shown in Figure 13. To simulate the discovery, select acapability description from the file system (an xml file), press the ‘discoverContextSource’button, and VantagePoint will print the matching context sources in the console. Note, that tobe able to simulate the context source discovery with your own context source, it must be firstregistered to the context broker.
4.4.5 User locator service
VantagePoint provides also a special user locator service to monitor the movements ofpersons in an environment. Create the service by selecting a static context source from the listof available context sources, and press the ‘Create User Locator’ button. If the creation of theuser locator service was successful, it will appear to the list of available context sources (seeFigure 14).
Figure 14: User location context source
October 2007 Amigo
Amigo IST2004004182 20/20
Once the user location context source is in the list of available context sources, it can beregistered to the context broker. The user location context source holds its own context datathat is described in owl language and follows a form supported by several Amigo applications.Client applications are able to subscribe themselves to the user location context source andreceive updated context data models every time a person is moved to another location. InFigure 15 is presented an example context model produced by the user location service. Inthis example a person “Joe” has moved to room “Kitchen”.
Figure 15: An example context model produced by the user location service