|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.lehigh.swat.hawk.storage.StorageModel
edu.lehigh.swat.hawk.storage.PersistentStorageModel
edu.lehigh.swat.hawk.storage.simpledb.DatabaseStorage
public class DatabaseStorage
Field Summary | |
---|---|
protected java.util.Hashtable |
cachedDocs
|
protected java.sql.Connection |
con
|
protected java.lang.String |
dbName
|
protected java.lang.String |
emptyTableState
|
protected java.util.Hashtable |
knownDocs
|
protected java.util.Hashtable |
knownOntos
|
protected java.util.Hashtable |
knownUrls
|
protected java.util.Hashtable |
loadedDocs
|
protected int |
loadedTripleNum
|
protected int |
maxUrlNum
|
protected int |
ontSeqNum
|
protected java.util.Hashtable |
propertyTypes
|
protected boolean |
queryOnly
|
protected java.lang.String |
queryOnto
|
protected int |
sourceSeqNum
|
protected java.sql.Statement |
stmt
|
Constructor Summary | |
---|---|
DatabaseStorage(java.lang.String DBName)
Constructor. |
Method Summary | |
---|---|
void |
addDocument(Document d)
Add a document to this model. |
void |
clearViewDefinitions()
|
void |
close()
Close the database connection. |
Document |
createDocument()
Create an Document object. |
void |
createKb()
Initialize the database. |
Ontology |
createOntology()
Create an Ontology object. |
int[] |
decideCommitOnto(Document doc,
ObjectId id)
Decide which ontology would commit to giving the resource doc and objectId. |
protected void |
flushLoadedDocs(boolean doneLoading)
|
void |
forcedExit()
Forced exit. |
java.lang.String |
getDBName()
Get the database name. |
Document |
getDocument(java.lang.String url)
Get the specified document. |
java.util.Iterator |
getDocumentIterator()
Get all the documents in the model. |
DocId[] |
getImportsClosure(Document doc)
Get the imports closure. |
java.util.Hashtable |
getKnownOntologies()
retrieval ontologies already exist in database |
java.util.Hashtable |
getKnownUrls()
Retrieval Urls already exist in database |
int |
getOntSeq(java.lang.String ns)
Get the sequence number for giving ontology. |
java.util.Hashtable |
getPropertyTypes()
Get the types of properties. |
java.lang.String |
getQueryOntology()
Get the query ontology. |
int |
getSeqNum(DocId did)
Get the sequence number for giving Document |
void |
getSourceNum()
Get the maximum source sequence number in the databade. |
java.sql.Statement |
getStatement()
Get the sql statement. |
java.lang.String |
getTableName(ObjectId id)
Get the table name for giving id. |
java.util.Hashtable |
getUpdatedViewDefs()
|
protected int |
getUrlIndex(java.lang.String url)
Get the index for given uri. |
java.lang.String |
getViewDefinition(java.lang.String vName)
Get sql definition for giving view name. |
ResultSet |
issueQuery(Query qry)
Execute query and return results. |
ResultSet |
issueQuery(SparqlQuery query)
Execute query and return results. |
void |
open()
Open a connection to the database. |
void |
open(boolean readOnly)
open kb with arguments |
void |
pushImports(Ontology ont)
Add imports objects to ontology, for the use of memory-based storage model. |
void |
setConnection(java.sql.Connection Conn)
Sets the connection to the database. |
void |
setImplictImports(boolean imp)
Set whether or not include implictly imported documents. |
void |
setKnownOntologies(java.util.Hashtable KnownOntos)
Sets the hashtable that contains the known ontologies. |
void |
setQueryOntology(java.lang.String uri)
Set the query ontology. |
void |
setViewDefinition(java.lang.String vName,
java.lang.String vDef)
|
void |
storeOntology(Ontology ontd)
|
void |
updateDocument(Document d)
Update a document. |
void |
updatePropertyTypes()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected int ontSeqNum
protected int sourceSeqNum
protected int maxUrlNum
protected java.util.Hashtable knownOntos
protected java.util.Hashtable knownDocs
protected java.util.Hashtable knownUrls
protected java.util.Hashtable propertyTypes
protected java.lang.String dbName
protected java.lang.String queryOnto
protected java.sql.Connection con
protected java.sql.Statement stmt
protected java.util.Hashtable cachedDocs
protected java.util.Hashtable loadedDocs
protected java.lang.String emptyTableState
protected int loadedTripleNum
protected boolean queryOnly
Constructor Detail |
---|
public DatabaseStorage(java.lang.String DBName)
DBName
- Method Detail |
---|
public void open()
open
in class PersistentStorageModel
public void open(boolean readOnly)
public void close()
close
in class PersistentStorageModel
public java.sql.Statement getStatement()
protected void flushLoadedDocs(boolean doneLoading)
public void storeOntology(Ontology ontd)
public void addDocument(Document d)
addDocument
in class StorageModel
public Document getDocument(java.lang.String url)
getDocument
in class StorageModel
public void updateDocument(Document d)
updateDocument
in class StorageModel
public java.util.Iterator getDocumentIterator()
getDocumentIterator
in class StorageModel
public void setImplictImports(boolean imp)
setImplictImports
in class StorageModel
public Ontology createOntology()
createOntology
in class StorageModel
public Document createDocument()
createDocument
in class StorageModel
public java.util.Hashtable getKnownOntologies()
public void getSourceNum()
public void createKb()
public java.lang.String getTableName(ObjectId id)
public java.util.Hashtable getKnownUrls()
protected int getUrlIndex(java.lang.String url)
public int getSeqNum(DocId did)
public void setViewDefinition(java.lang.String vName, java.lang.String vDef)
public java.util.Hashtable getUpdatedViewDefs()
public void clearViewDefinitions()
public java.lang.String getViewDefinition(java.lang.String vName)
public int getOntSeq(java.lang.String ns)
public void forcedExit()
public ResultSet issueQuery(Query qry)
public ResultSet issueQuery(SparqlQuery query)
public java.util.Hashtable getPropertyTypes()
public void updatePropertyTypes()
public int[] decideCommitOnto(Document doc, ObjectId id)
public void setQueryOntology(java.lang.String uri)
public java.lang.String getQueryOntology()
public java.lang.String getDBName()
public void setKnownOntologies(java.util.Hashtable KnownOntos)
KnownOntos
- the hashtable of known ontologiespublic void setConnection(java.sql.Connection Conn) throws java.sql.SQLException
Conn
- a Connection object.
java.sql.SQLException
public void pushImports(Ontology ont)
pushImports
in class StorageModel
ont
- Ontologypublic DocId[] getImportsClosure(Document doc)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |