jcolibri.test.test10
Class Test10

java.lang.Object
  extended by jcolibri.test.test10.Test10
All Implemented Interfaces:
StandardCBRApplication

public class Test10
extends java.lang.Object
implements StandardCBRApplication

This example shows how to use the ontology connector and the ontology-based similarity functions.
To use the ontology connector, all the attributes of the description and the solution must be Instance typed.

This test shows an example where a case is composed by a description and a solution following the mapping:

To configure the connector with that mapping we use the configuration file:
 <OntologyConfiguration>
        <MainOntology>
                <URL>http://gaia.fdi.ucm.es/ontologies/vacation.owl</URL>
                <LocalCopy>jcolibri/test/test10/vacation.owl</LocalCopy>
        </MainOntology>   
        
        <!-- There are not subontologies -->
        
        <CaseMainConcept>VACATION_CASE</CaseMainConcept>
        
        <DescriptionClassName>jcolibri.test.test10.TravelDescription</DescriptionClassName>
        <DescriptionMappings>
                <Map>
                        <Property>HAS-DESTINATION</Property>
                        <Concept>DESTINATION</Concept>
                        <Attribute>Destination</Attribute>
                </Map>
                <Map>
                        <Property>HAS-CATEGORY</Property>
                        <Concept>CATEGORY</Concept>
                        <Attribute>Accommodation</Attribute>
                </Map>
                <Map>
                        <Property>HAS-PERSONS</Property>
                        <Concept>PERSONS</Concept>
                        <Attribute>NumberOfPersons</Attribute>
                </Map>
                <Map>
                        <Property>HAS-TRANSPORTATION</Property>
                        <Concept>TRANSPORTATION</Concept>
                        <Attribute>Transportation</Attribute>
                </Map>
                <Map>
                        <Property>HAS-SEASON</Property>
                        <Concept>SEASON</Concept>
                        <Attribute>Season</Attribute>
                </Map>
                <Map>
                        <Property>HAS-HOLIDAY_TYPE</Property>
                        <Concept>HOLIDAY_TYPE</Concept>
                        <Attribute>HolidayType</Attribute>
                </Map>
                <Map>
                        <Property>HAS-DURATION</Property>
                        <Concept>DURATION</Concept>
                        <Attribute>Duration</Attribute>
                </Map>
        </DescriptionMappings>
        
        <SolutionClassName>jcolibri.test.test10.TravelSolution</SolutionClassName>
        <SolutionMappings>
                <Map>
                        <Property>HAS-PRICE</Property>
                        <Concept>PRICE</Concept>
                        <Attribute>price</Attribute>
                </Map>
        </SolutionMappings>
 </OntologyConfiguration>
 

The source code shows how to use the connector and then an complete CBR cycle using the similarity functions implemented in the package: jcolibri.method.retrieve.NNretrieval.similarity.local.ontology

Version:
1.0
Author:
Juan A. Recio-Garcia
See Also:
OntologyConnector, jcolibri.method.retrieve.NNretrieval.similarity.local.ontology, TravelDescription, TravelSolution

Constructor Summary
Test10()
           
 
Method Summary
 void configure()
          Configures the application: case base, connectors, etc.
 void cycle(CBRQuery query)
          Executes a CBR cycle with the given query.
static void main(java.lang.String[] args)
          Tests the OntologyConnector.
 void postCycle()
          Runs the code to shutdown the application.
 CBRCaseBase preCycle()
          Runs the precyle where typically cases are read and organized into a case base.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Test10

public Test10()
Method Detail

configure

public void configure()
               throws ExecutionException
Description copied from interface: StandardCBRApplication
Configures the application: case base, connectors, etc.

Specified by:
configure in interface StandardCBRApplication
Throws:
ExecutionException

preCycle

public CBRCaseBase preCycle()
                     throws ExecutionException
Description copied from interface: StandardCBRApplication
Runs the precyle where typically cases are read and organized into a case base.

Specified by:
preCycle in interface StandardCBRApplication
Returns:
The created case base with the cases in the storage.
Throws:
ExecutionException

cycle

public void cycle(CBRQuery query)
           throws ExecutionException
Description copied from interface: StandardCBRApplication
Executes a CBR cycle with the given query.

Specified by:
cycle in interface StandardCBRApplication
Throws:
ExecutionException

postCycle

public void postCycle()
               throws ExecutionException
Description copied from interface: StandardCBRApplication
Runs the code to shutdown the application. Typically it closes the connector.

Specified by:
postCycle in interface StandardCBRApplication
Throws:
ExecutionException

main

public static void main(java.lang.String[] args)
Tests the OntologyConnector. It reads the cases, creates a new one, stores the new case in the case base, closes the connector generating a new owl file, reads the cases again, deletes the new case and closes generating a new owl file that is equal to the original one.


GAIA - Group for Artificial Intelligence Applications
http://gaia.fdi.ucm.es