|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjcolibri.test.test10.Test10
public class Test10
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:
<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
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 |
---|
public Test10()
Method Detail |
---|
public void configure() throws ExecutionException
StandardCBRApplication
configure
in interface StandardCBRApplication
ExecutionException
public CBRCaseBase preCycle() throws ExecutionException
StandardCBRApplication
preCycle
in interface StandardCBRApplication
ExecutionException
public void cycle(CBRQuery query) throws ExecutionException
StandardCBRApplication
cycle
in interface StandardCBRApplication
ExecutionException
public void postCycle() throws ExecutionException
StandardCBRApplication
postCycle
in interface StandardCBRApplication
ExecutionException
public static void main(java.lang.String[] args)
|
GAIA - Group for Artificial Intelligence Applications http://gaia.fdi.ucm.es |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |