Protégé-OWL 3.4.1

edu.stanford.smi.protegex.owl.repository.impl
Class DatabaseRepository

java.lang.Object
  extended by edu.stanford.smi.protegex.owl.repository.impl.DatabaseRepository
All Implemented Interfaces:
Repository

public class DatabaseRepository
extends Object
implements Repository


Field Summary
static edu.stanford.smi.protege.storage.database.DatabaseProperty[] DATABASE_FIELDS
           
static String REPOSITORY_DESCRIPTOR_PREFIX
           
static char SEPARATOR_CHAR
           
 int SQL_GET_TABLE_TYPES_TABLE_TYPE_COL
           
 int SQL_GET_TABLES_TABLENAME_COL
           
static String SQL_TABLE_TYPE
           
static String SQL_VIEW_TYPE
           
 
Constructor Summary
DatabaseRepository(String repositoryDescriptor)
           
DatabaseRepository(String driver, String url, String user, String password)
           
DatabaseRepository(String driver, String url, String user, String password, String table)
           
 
Method Summary
 boolean addTable(String table)
           
 void connect()
           
 boolean contains(URI ontologyName)
          Determines if the repository contains the specified ontology.
 void disconnect()
           
static int getDBPropertyIndex(edu.stanford.smi.protege.storage.database.DatabaseProperty property)
           
 String getDBTable(URI ontologyName)
           
 String getDriver()
           
 Collection<URI> getOntologies()
          Gets the name of the ontologies that this repository contains.
 String getOntologyLocationDescription(URI ontologyName)
          Gets a description of where the specified ontology is located.
 OutputStream getOutputStream(URI ontologyName)
          Gets an output stream which can be used to write changes to the specified ontology.
 String getPassword()
           
 String getRepositoryDescription()
          Gets a description of the type of the repository.
 String getRepositoryDescriptor()
          Gets the descriptor for this repository.
 Map<String,URI> getTableToOntologyMap()
           
 String getUrl()
           
 String getUser()
           
 boolean hasOutputStream(URI ontologyName)
          Determines if the ontology is writable through an output stream.
 boolean isSystem()
          Determines if the ontology repository is a system repository.
 boolean isWritable(URI ontologyName)
          Determines if the specified ontology is writable.
 TripleStore loadImportedAssertions(OWLModel owlModel, URI ontologyName)
           
static List<String> parse(String repositoryDescriptor)
           
 void refresh()
          Causes the repository to contain the latest information.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

REPOSITORY_DESCRIPTOR_PREFIX

public static final String REPOSITORY_DESCRIPTOR_PREFIX
See Also:
Constant Field Values

SEPARATOR_CHAR

public static final char SEPARATOR_CHAR
See Also:
Constant Field Values

SQL_TABLE_TYPE

public static final String SQL_TABLE_TYPE
See Also:
Constant Field Values

SQL_VIEW_TYPE

public static final String SQL_VIEW_TYPE
See Also:
Constant Field Values

SQL_GET_TABLE_TYPES_TABLE_TYPE_COL

public int SQL_GET_TABLE_TYPES_TABLE_TYPE_COL

SQL_GET_TABLES_TABLENAME_COL

public int SQL_GET_TABLES_TABLENAME_COL

DATABASE_FIELDS

public static final edu.stanford.smi.protege.storage.database.DatabaseProperty[] DATABASE_FIELDS
Constructor Detail

DatabaseRepository

public DatabaseRepository(String driver,
                          String url,
                          String user,
                          String password)
                   throws SQLException,
                          ClassNotFoundException
Throws:
SQLException
ClassNotFoundException

DatabaseRepository

public DatabaseRepository(String driver,
                          String url,
                          String user,
                          String password,
                          String table)
                   throws SQLException,
                          ClassNotFoundException
Throws:
SQLException
ClassNotFoundException

DatabaseRepository

public DatabaseRepository(String repositoryDescriptor)
                   throws ClassNotFoundException,
                          SQLException
Throws:
ClassNotFoundException
SQLException
Method Detail

getDBPropertyIndex

public static int getDBPropertyIndex(edu.stanford.smi.protege.storage.database.DatabaseProperty property)

parse

public static List<String> parse(String repositoryDescriptor)

connect

public void connect()
             throws SQLException
Throws:
SQLException

disconnect

public void disconnect()
                throws SQLException
Throws:
SQLException

addTable

public boolean addTable(String table)

loadImportedAssertions

public TripleStore loadImportedAssertions(OWLModel owlModel,
                                          URI ontologyName)
                                   throws edu.stanford.smi.protege.exception.OntologyLoadException
Specified by:
loadImportedAssertions in interface Repository
Parameters:
owlModel - the model to add the import to
ontologyName - the ontology name to use to look up the imported ontology.
Throws:
edu.stanford.smi.protege.exception.OntologyLoadException

contains

public boolean contains(URI ontologyName)
Description copied from interface: Repository
Determines if the repository contains the specified ontology.

Specified by:
contains in interface Repository
Parameters:
ontologyName - The name of the ontology.

getOntologies

public Collection<URI> getOntologies()
Description copied from interface: Repository
Gets the name of the ontologies that this repository contains.

Specified by:
getOntologies in interface Repository
Returns:
A Collection containing URIs.

getDBTable

public String getDBTable(URI ontologyName)

getOntologyLocationDescription

public String getOntologyLocationDescription(URI ontologyName)
Description copied from interface: Repository
Gets a description of where the specified ontology is located.

Specified by:
getOntologyLocationDescription in interface Repository
Parameters:
ontologyName - The name of the ontology.
Returns:
A String description of the location of the ontology, for example, "file:/Users/Blah/Blah/Blah". This return value will be an empty String if the repository does not contain the specified ontology.

getOutputStream

public OutputStream getOutputStream(URI ontologyName)
                             throws IOException
Description copied from interface: Repository
Gets an output stream which can be used to write changes to the specified ontology.

Specified by:
getOutputStream in interface Repository
Parameters:
ontologyName - The ontology to be written
Returns:
an OutputStream that can be used to write changes to the ontology, or null if the ontology is not writable.
Throws:
IOException

getRepositoryDescription

public String getRepositoryDescription()
Description copied from interface: Repository
Gets a description of the type of the repository. For example, "Local folder".

Specified by:
getRepositoryDescription in interface Repository

getRepositoryDescriptor

public String getRepositoryDescriptor()
Description copied from interface: Repository
Gets the descriptor for this repository. This is used to serialise the repository in a list of the available repositories.

Specified by:
getRepositoryDescriptor in interface Repository

isSystem

public boolean isSystem()
Description copied from interface: Repository
Determines if the ontology repository is a system repository.

Specified by:
isSystem in interface Repository

isWritable

public boolean isWritable(URI ontologyName)
Description copied from interface: Repository
Determines if the specified ontology is writable.

Specified by:
isWritable in interface Repository
Returns:
true if the ontology is writable, or false if the ontology is not writable.

hasOutputStream

public boolean hasOutputStream(URI ontologyName)
Description copied from interface: Repository
Determines if the ontology is writable through an output stream. Can only be true if the ontology is writable.

Specified by:
hasOutputStream in interface Repository

refresh

public void refresh()
Description copied from interface: Repository
Causes the repository to contain the latest information.

Specified by:
refresh in interface Repository

getDriver

public String getDriver()

getUrl

public String getUrl()

getUser

public String getUser()

getPassword

public String getPassword()

getTableToOntologyMap

public Map<String,URI> getTableToOntologyMap()

Protégé-OWL 3.4.1

Submit a bug report or feature request
Copyright (c) 1998-2009 Stanford University.