net.sourceforge.fluxion.datasource.utils
Class BeanConverter

java.lang.Object
  extended by net.sourceforge.fluxion.datasource.utils.BeanConverter

public class BeanConverter
extends java.lang.Object

This class converts submitted beanInstances into OWLIndividuals, and adds them to an ontology.

Version:
1.0
Author:
Tony Burdett

Constructor Summary
BeanConverter(ReasonerSession session, org.semanticweb.owl.model.OWLOntology schemaOntology, org.semanticweb.owl.model.OWLOntology resultOntology, org.semanticweb.owl.model.OWLDescription query, Filter filter)
           
 
Method Summary
 org.semanticweb.owl.model.OWLIndividual convertToOWLIndividual(java.lang.Object beanInstance)
          Converts a concrete bean instance into its owl equivalent.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BeanConverter

public BeanConverter(ReasonerSession session,
                     org.semanticweb.owl.model.OWLOntology schemaOntology,
                     org.semanticweb.owl.model.OWLOntology resultOntology,
                     org.semanticweb.owl.model.OWLDescription query,
                     Filter filter)
              throws OWLTransformationException
Throws:
OWLTransformationException
Method Detail

convertToOWLIndividual

public org.semanticweb.owl.model.OWLIndividual convertToOWLIndividual(java.lang.Object beanInstance)
                                                               throws OWLTransformationException
Converts a concrete bean instance into its owl equivalent. This creates an owl instance for inclusion in the ontology, not a template class instance (See QueryUtils.createFilters()) which are used to model restricted classes. The instance passed to this method should all be of a the type used to create the beanConverter - if not, an Exception will be thrown. This optimises conversion times and prevents repeated class loading. If there are instances of several different owl classes to be converted, you should create a new BeanConverter for each.

Parameters:
beanInstance - the object that we want to convert into an owl instance
Returns:
the created individual
Throws:
OWLTransformationException - if there is some problem transforming the owl


Copyright © 2010. All Rights Reserved.