net.sourceforge.fluxion.datasource.impl
Class BeanModelDataSource

java.lang.Object
  extended by net.sourceforge.fluxion.datasource.impl.BeanModelDataSource
All Implemented Interfaces:
DataSource

public class BeanModelDataSource
extends java.lang.Object
implements DataSource

A DataSource that is backed by a Bean-model artifact. Such artifacts are jar files produced by installing a bean-model maven artifact.

Version:
0.2
Author:
Tony Burdett

Constructor Summary
BeanModelDataSource(java.net.URI uri, org.semanticweb.owl.model.OWLOntology ontology)
           
 
Method Summary
 java.net.URI getReasonerLevel()
          The reasoner level at which this datasource operates.
 org.semanticweb.owl.model.OWLOntology getSchema()
          The "schema" ontology for this datasource (sometimes called the T-Box).
 java.net.URI getURI()
          The URI of this datasource.
 org.semanticweb.owl.model.OWLOntology query(org.semanticweb.owl.model.OWLOntology ontology, java.net.URI queryClass)
          Queries this datasource for all instances that may be instances of the OWL class with the URI given by the queryClass parameter.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BeanModelDataSource

public BeanModelDataSource(java.net.URI uri,
                           org.semanticweb.owl.model.OWLOntology ontology)
Method Detail

getURI

public java.net.URI getURI()
Description copied from interface: DataSource
The URI of this datasource. Generally, this will correspond to the URI assigned to the OWL Ontology this datasource exposes data for.

Specified by:
getURI in interface DataSource
Returns:
the (usually ontology) URI

getReasonerLevel

public java.net.URI getReasonerLevel()
                              throws DataSourceException
Description copied from interface: DataSource
The reasoner level at which this datasource operates. Normally this should be OWL-DL, but this method is there to future-proof against datasources that may need OWL-Full expressivity.

Specified by:
getReasonerLevel in interface DataSource
Returns:
the URI of the flavour of OWL this datasource utilises
Throws:
DataSourceException - if there was a problem retrieving the expressivity of this datasource

getSchema

public org.semanticweb.owl.model.OWLOntology getSchema()
                                                throws DataSourceException
Description copied from interface: DataSource
The "schema" ontology for this datasource (sometimes called the T-Box). This is the ontology, without any individual axioms representing A-Box data.

Specified by:
getSchema in interface DataSource
Returns:
the schema OWL Ontology
Throws:
DataSourceException - if the schema could not be recovered

query

public org.semanticweb.owl.model.OWLOntology query(org.semanticweb.owl.model.OWLOntology ontology,
                                                   java.net.URI queryClass)
                                            throws DataSourceException
Description copied from interface: DataSource
Queries this datasource for all instances that may be instances of the OWL class with the URI given by the queryClass parameter.

Implementations are free to return as much data as they choose here, but must guarantee to return at least all individuals belonging to the given query class, and never less. It would be viable (but not helpful) to return every individual in this datasource, for example.

The ontology parameter supplied is the query ontology; any extra axioms here, compared with the schema ontology, should be merged before returning results. This means querying clients can add extra assertions to restrict the results they acquire. This can include adding new classes - so, for example, clients can declare a new class "foo" where foo is the union of classes A and B, and then query for all instances of foo by passing the newly declared URI.

The result is the knowledgebase, contains all schema axioms, all newly added axioms supplied by the client, and all instances that satisfy the query (plus, optionally, more).

Specified by:
query in interface DataSource
Parameters:
ontology - the ontology containing any axioms we need to describe the query
queryClass - the URI of the class we require individuals of
Returns:
an ontology containing all asserted axioms and the individuals of the query class
Throws:
DataSourceException - if there was any problem acquiring results


Copyright © 2010. All Rights Reserved.