jcolibri.connector
Class OntologyConnector

java.lang.Object
  extended by jcolibri.connector.OntologyConnector
All Implemented Interfaces:
Connector

public class OntologyConnector
extends java.lang.Object
implements Connector

Implements a generic Ontology connector. It uses OntoBridge to manage the ontologies and the reasoner. To configure this connector create a configuration xml file following this schema: /doc/configfilesSchemas/OntologyConnector.xsd:

This connector only maps case structures without compound attributes. All attributes must be Instance typed. For a complete example see Test 10.

Version:
2.0
Author:
Juan A. Recio-Garcia
See Also:
Test10

Constructor Summary
OntologyConnector()
           
 
Method Summary
 void close()
          If there was any modification to the ontology, the owl file is replaced with a new one that contains the changes.
 void deleteCases(java.util.Collection<CBRCase> cases)
          Deletes cases in the ontology.
 java.lang.String getCaseMainConcept()
           
 java.util.ArrayList<OntologyMapping> getDescriptionMappings()
           
 java.util.ArrayList<OntologyMapping> getJustOfSolutionMappings()
           
 OntologyInfo getMainOntologyInfo()
           
 java.util.ArrayList<OntologyMapping> getResultMappings()
           
 java.util.ArrayList<OntologyMapping> getSolutionMappings()
           
 java.util.ArrayList<OntologyInfo> getSubOntologiesInfo()
           
 void initFromXMLfile(java.net.URL file)
          Initializes the connector from an XML config file.
 java.util.Collection<CBRCase> retrieveAllCases()
          Returns max cases without any special consideration
 java.util.Collection<CBRCase> retrieveSomeCases(CaseBaseFilter filter)
          UnImplemented.
 void storeCases(java.util.Collection<CBRCase> cases)
          Stores cases into the ontology.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OntologyConnector

public OntologyConnector()
Method Detail

initFromXMLfile

public void initFromXMLfile(java.net.URL file)
                     throws InitializingException
Initializes the connector from an XML config file. This method reads the configuration and launches OntoBridge with the Pellet reasoner. Then the ontologies are loaded into memory.

Specified by:
initFromXMLfile in interface Connector
Parameters:
file - XMl file with the settings
Throws:
InitializingException - Raised if the connector can not be initialezed.
See Also:
Connector.initFromXMLfile(java.net.URL)

retrieveAllCases

public java.util.Collection<CBRCase> retrieveAllCases()
Description copied from interface: Connector
Returns max cases without any special consideration

Specified by:
retrieveAllCases in interface Connector
Returns:
The list of retrieved cases

retrieveSomeCases

public java.util.Collection<CBRCase> retrieveSomeCases(CaseBaseFilter filter)
UnImplemented.

Specified by:
retrieveSomeCases in interface Connector
See Also:
Connector.retrieveSomeCases(jcolibri.cbrcore.CaseBaseFilter)

storeCases

public void storeCases(java.util.Collection<CBRCase> cases)
Stores cases into the ontology.

Specified by:
storeCases in interface Connector
Parameters:
cases - List of cases
See Also:
Connector.storeCases(java.util.Collection)

close

public void close()
If there was any modification to the ontology, the owl file is replaced with a new one that contains the changes. The new owl file is completely regenerated from scrach with the current content of the reasoner (not including the inferred model). OntoBridge uses the RDF/XML-ABBREV syntax for the owl files.

Specified by:
close in interface Connector
See Also:
Connector.close()

deleteCases

public void deleteCases(java.util.Collection<CBRCase> cases)
Deletes cases in the ontology. Only the main instance (case id mapped instance) is removed, so the instances mapped to attributes are keep.

Specified by:
deleteCases in interface Connector
Parameters:
cases - List of cases
See Also:
Connector.deleteCases(java.util.Collection)

getCaseMainConcept

public java.lang.String getCaseMainConcept()
Returns:
Returns the caseMainConcept.

getDescriptionMappings

public java.util.ArrayList<OntologyMapping> getDescriptionMappings()
Returns:
Returns the descriptionMappings.

getJustOfSolutionMappings

public java.util.ArrayList<OntologyMapping> getJustOfSolutionMappings()
Returns:
Returns the justOfSolutionMappings.

getMainOntologyInfo

public OntologyInfo getMainOntologyInfo()
Returns:
Returns the mainOntologyInfo.

getResultMappings

public java.util.ArrayList<OntologyMapping> getResultMappings()
Returns:
Returns the resultMappings.

getSolutionMappings

public java.util.ArrayList<OntologyMapping> getSolutionMappings()
Returns:
Returns the solutionMappings.

getSubOntologiesInfo

public java.util.ArrayList<OntologyInfo> getSubOntologiesInfo()
Returns:
Returns the subOntologiesInfo.

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