Home
Categories
Dictionary
Glossary
Download
Project Details
Changes Log
What Links Here
FAQ
License

Second map ontology tutorial



This tutorial use the same Ontology as the map ontology tutorial, but the requests are built using the SPARQL request creation utility, and the results are returned as objects rather than text.

The source code and configuration of this tutorial can be found here: sourceforge.net/projects/protoframeworksamples/

Use case

We have exactly the same use case as for the previous tutorial, but:

Architecture

Overview

We add the following module to the architecture of the previous ontology tutorial:
  • A requestEngine module to generate SPARQL requests and process responses

mapOntologyarchi2

Add a new service for having the results returned as objects

We only need to add one service which is provided by the Jena module:
      <namespace uri="http://dassault-aviation.com/jena">                               
         <requestResponse name="owlObjectRequest">
            <request>
               <data name="reqSchema" desc="Schema key" type="string" />
               <data name="query" desc="JENA query" type="string" />
               <data name="stripPrefix" desc="Strip results prefix" type="bool" />
               <data name="orderedBy" desc="Ordered Results by" type="string" />
            </request>
            <response>
               <data name="respSchema" desc="Schema key" type="string" />
               <data name="response" desc="JENA query response" type="results" />
               <data name="requestStatus" desc="Request status" type="requestStatus" />
            </response>
         </requestResponse>                                                                
      </namespace>
The results type points to the QueryResults class:
      <namespace uri="http://dassault-aviation.com/jena">
         <objectType name="results" class="org.da.protoframework.jena.common.QueryResults" />        
      </namespace>

RequestEngine module

Main Article: requestEngine

The requestEngine module will be responsible to:

Starting the framework

We start the framework with the filelist2.xml file for our configuration[1]
The first filelist.xml configuration file is used for the previous ontology tutorial
, as for all our other tutorials:
      java -jar protoframework.jar config=filelist2.xml
Several windows will appear:

Asking requests

In this tutorial, the requests are sent using the requestEngine UI window:
mapontologyreqGUI

Getting the list of alerts

To have a non empty result you need to check some Alerts in the AlertEngine GUI. Click on the "Alert List" button: you will have this kind of result on the Java console:
      Number of Alerts: 2
      Alarm 7: RedAlarm
      Alarm 3: AmberAlarm      

Getting the distance of a Waypoint

Click on the "Waypoint Distance" button: you will have this kind of result on the Java console:
      Distance of Waypoint WPT6 at 88.74928112853848 NM

Getting the distance of a Waypoint

Click on the "Closest ATT Waypoint" button: you will have this kind of result on the Java console:
      Closest ATT Waypoint is ATT1 at 47.34699500770006 NM

Going further

The next tutorial uses the same Ontology as this one, but we will add a SPARQL custom function to ask for the Meteo data on a Waypoint.

Notes

  1. ^ The first filelist.xml configuration file is used for the previous ontology tutorial

See also


Categories: tutorials

Copyright 2017-2020 Dassault Aviation. All Rights Reserved. Documentation and source under the LGPL v3 licence