org.semanticweb.kaon2.api
Interface KAON2Connection


public interface KAON2Connection

The connection to the KAON2. One connection encapsulates several ontologies that include each other.


Field Summary
static java.lang.String LOAD_FROM_INPUT_STREAM
          This property can be used in the map of parameters to the openOntology() call to specify that the contents of the ontology should be loaded from a stream.
static java.lang.String LOAD_FROM_READER
          This property can be used in the map of parameters to the openOntology() call to specify that the contents of the ontology should be loaded from a read.
static java.lang.String USE_PROXY
          This property can be used in the map of parameters to the openOntology() call to specify that the ontology should be accessed through a proxy.
static java.lang.String USE_SIMPLIFIED_RDF_PARSING
          This property can be set to Boolean.TRUE in the map of parameters to the openOntology() call to specify that the simplified, but incomplete, algorithms should be used when reading RDF files.
 
Method Summary
 java.lang.Object accept(KAON2Visitor visitor)
          Accepts a visitor for this object.
 void cancelPendingOpen()
          Cancels the open operation that is pending on this connection.
 void close()
          Closes this connection.
 void closeOntologies(java.util.Set<Ontology> ontologies)
          Closes the ontologies in the specified set.
 Ontology createOntology(java.lang.String ontologyURI, java.util.Map<java.lang.String,java.lang.Object> parameters)
          Creates an ontology with given physical URI.
 java.util.Set<Ontology> getOntologies()
          Returns the set of ontologies open by the connection.
 Ontology getOntology(java.lang.String ontologyURI)
          Returns an ontology with a given ontology URI, provided that it was opened or created before.
 OntologyResolver getOntologyResovler()
          Returns the ontology resolver used by this connection.
 java.util.Set<java.lang.String> getOntologyURIs()
          Returns the set of logical URIs of all ontologies open by the connection.
 boolean isOpen()
          Returns true if this connection is open.
 Ontology openOntology(java.lang.String ontologyURI, java.util.Map<java.lang.String,java.lang.Object> parameters)
          Opens an ontology with given ontology URI.
 void setOntologyResolver(OntologyResolver ontologyResolver)
          Registers the ontology resolver into this connection.
 

Field Detail

LOAD_FROM_INPUT_STREAM

static final java.lang.String LOAD_FROM_INPUT_STREAM
This property can be used in the map of parameters to the openOntology() call to specify that the contents of the ontology should be loaded from a stream.

See Also:
Constant Field Values

LOAD_FROM_READER

static final java.lang.String LOAD_FROM_READER
This property can be used in the map of parameters to the openOntology() call to specify that the contents of the ontology should be loaded from a read.

See Also:
Constant Field Values

USE_PROXY

static final java.lang.String USE_PROXY
This property can be used in the map of parameters to the openOntology() call to specify that the ontology should be accessed through a proxy.

See Also:
Constant Field Values

USE_SIMPLIFIED_RDF_PARSING

static final java.lang.String USE_SIMPLIFIED_RDF_PARSING
This property can be set to Boolean.TRUE in the map of parameters to the openOntology() call to specify that the simplified, but incomplete, algorithms should be used when reading RDF files.

See Also:
Constant Field Values
Method Detail

accept

java.lang.Object accept(KAON2Visitor visitor)
Accepts a visitor for this object.

Parameters:
visitor - the visitor for this object
Returns:
the return value of the visitor (can be null)

setOntologyResolver

void setOntologyResolver(OntologyResolver ontologyResolver)
Registers the ontology resolver into this connection.

Parameters:
ontologyResolver - the ontology resolver

getOntologyResovler

OntologyResolver getOntologyResovler()
Returns the ontology resolver used by this connection.

Returns:
the ontology resolved that this connection uses

close

void close()
           throws KAON2Exception
Closes this connection. All child connections created by this connection are also closed.

Throws:
KAON2Exception - thrown if there is an error

isOpen

boolean isOpen()
               throws KAON2Exception
Returns true if this connection is open.

Returns:
true if the connection is open
Throws:
KAON2Exception - thrown if there is an error

getOntology

Ontology getOntology(java.lang.String ontologyURI)
                     throws KAON2Exception
Returns an ontology with a given ontology URI, provided that it was opened or created before.

Parameters:
ontologyURI - the ontology URI of the ontology
Returns:
the ontology, or null if the onotlogy was not opened or created
Throws:
KAON2Exception - thrown if there is an error

openOntology

Ontology openOntology(java.lang.String ontologyURI,
                      java.util.Map<java.lang.String,java.lang.Object> parameters)
                      throws KAON2Exception,
                             java.lang.InterruptedException
Opens an ontology with given ontology URI.

Parameters:
ontologyURI - the ontology URI of the ontology
parameters - the parameters for the ontology
Returns:
the ontology
Throws:
KAON2Exception - thrown if there is an error
java.lang.InterruptedException - thrown if the open operation is interrupted

createOntology

Ontology createOntology(java.lang.String ontologyURI,
                        java.util.Map<java.lang.String,java.lang.Object> parameters)
                        throws KAON2Exception
Creates an ontology with given physical URI.

Parameters:
ontologyURI - the ontology URI of the ontology
parameters - the parameters for the ontology
Returns:
the ontology
Throws:
KAON2Exception - thrown if there is an error

closeOntologies

void closeOntologies(java.util.Set<Ontology> ontologies)
                     throws KAON2Exception
Closes the ontologies in the specified set. If an ontology is included in another ontology, it can be closed only together with the including ontology.

Parameters:
ontologies - the set of ontologies
Throws:
KAON2Exception - thrown if there is an error

getOntologies

java.util.Set<Ontology> getOntologies()
                                      throws KAON2Exception
Returns the set of ontologies open by the connection.

Returns:
the set of ontologies objects represented by this connection
Throws:
KAON2Exception - thrown if there is an error

getOntologyURIs

java.util.Set<java.lang.String> getOntologyURIs()
                                                throws KAON2Exception
Returns the set of logical URIs of all ontologies open by the connection.

Returns:
the set of ontologies objects represented by this connection
Throws:
KAON2Exception - thrown if there is an error

cancelPendingOpen

void cancelPendingOpen()
                       throws KAON2Exception
Cancels the open operation that is pending on this connection. If no open operation is pending, this method has no effect.

Throws:
KAON2Exception - thrown if there is an error