|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectuk.ac.bbk.dcs.automed.hdmstore.HdmStore
public class HdmStore
A HdmStore allows data to be stored and queried in an HDM repository which is implemented in a Postgres databas).
| Field Summary | |
|---|---|
Debug |
debug
|
static char |
edgeSpan
|
static char |
nodeSpan
|
| Constructor Summary | |
|---|---|
HdmStore()
Default constructor assumes only error messages should be displayed (not debugs) |
|
HdmStore(Debug pDebug)
Constructor is passed debug class to send debug & error messages to |
|
| Method Summary | |
|---|---|
boolean |
addEdge(Edge edge)
Takes an Edge struture and stores this in the database. |
boolean |
addNode(java.lang.String nodeType,
java.lang.String nodeValue)
Takes a node type and a value and adds to the database |
boolean |
connect()
If connecting to the HDM store without a schema being passed assume same data source as for the MDR |
boolean |
connect(java.lang.String schemaName)
Connect to the database using the access method for the named schema. |
boolean |
connect(java.lang.String schemaName,
java.lang.String passWord)
Connect to the database using the access method for the named schema using the access method in the repository for the schema and the password supplied. |
boolean |
createDBtables()
|
boolean |
createDBtables(java.lang.String schemaName)
Check to see if the repository tables are in place on the HDM store data source. |
boolean |
createHdmStore(java.lang.String schemaName,
java.lang.String hdmStoreName)
Create a logical HDM store for the given schema. |
boolean |
deleteEdge(java.lang.String edgeType,
java.lang.String edgeValue)
Check the node type is valid & and instance of the node with this value exists. |
boolean |
deleteNode(java.lang.String nodeType,
java.lang.String nodeValue)
Check the node type is valid & and instance of the node with this value exists. |
void |
dropSequence()
Older versions of Postgres do not automatically drop sequences created for primary keys etc when the table is dropped - this loops through dropping the sequences explicitly. |
boolean |
edgeExists(Span span)
Test to see if an edge exists has been passed a Span structure - split this
out into type and and value and return the result. |
boolean |
edgeExists(java.lang.String edgeType,
java.lang.String edgeValues)
Does and edge with this type and value exist in the HDM store? |
boolean |
edgeInstanceExists(java.lang.String type,
java.lang.String values)
Check to see if an instance of this edge exists in the HDM store |
boolean |
edgeNameIsUnique(java.lang.String edgeName)
Edge names dont have to be unique - the combination of edge name and types is unique i.e. |
boolean |
edgeTypeExists(java.lang.String edgeType)
Given an edge type e.g. |
java.lang.String |
edgeTypeForName(java.lang.String edgeName)
Assuming edge name is unique (which need to be checked before calling) return its edge type e.g. |
java.util.LinkedList |
getEdgeInstances(java.lang.String edgeType)
Return all the instances of the passed edge type as a LinkedList of Span
elements, each Span representing an instance of an edge. |
java.util.LinkedList |
getNodeInstances(java.lang.String nodeType)
Given a node type return all the instances in the HDM store as a LinkedList
with elements of type Span, each element representing an instance |
java.util.LinkedList |
getSpans(int hid,
int eid)
For the edge specified return a LinkedList with each element of type
Span representing a span in that edge. |
boolean |
hdmStoreExists(java.lang.String hdmStoreName)
Is there an HDM store with the passed name in the repository? |
int |
hid(java.lang.String hdmStoreName)
Given an HDM store name return its row id number (or -1 if it does not exist) |
void |
listNodes()
Want to display all the nodes so pass just a wildcard as a the pattern |
void |
listNodes(java.lang.String nodeType)
List the instance nodes of the passed nodeType (or wildcard) |
boolean |
nodeExists(Span span)
For the node instance specifed in the Span data structure check if it exists in the
HDM store |
boolean |
nodeExists(java.lang.String nodeType,
java.lang.String nodeValue)
For the node instance specifed by node type & value, check if it exists in the HDM store |
boolean |
nodeTypeExists(java.lang.String nodeType)
Check whether any instances of this node type are currently stored in the HDM store |
int |
numberOfRowsInResultSet(java.sql.ResultSet rset)
Given a result set - how many rows are in it? |
boolean |
okToAddEdge(Edge edge)
Given an Edge is it OK to add the edge e.g. |
java.lang.String |
schemaName(java.lang.String hdmStoreName)
Given an HDM store name return the name of the schema it stores data for |
void |
setAddMissingNodes(boolean pAddMissingNodes)
If you try to add an instance of an edge then all the nodes and edges that are spans of the new edge must already exist in the database. |
boolean |
setDatatype(java.lang.String nodeType,
java.lang.String datatype)
The meta data for an HDM store is contained in the associated AutoMed schema except for the data type of the nodes in the schema which are set with this method (initially they default to String) |
boolean |
use(java.lang.String hdmStoreName)
Use the named HDM store - subsequent calls to this HdmStore will use this store as default |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final char nodeSpan
public static final char edgeSpan
public Debug debug
| Constructor Detail |
|---|
public HdmStore()
public HdmStore(Debug pDebug)
| Method Detail |
|---|
public boolean addEdge(Edge edge)
Edge struture and stores this in the database. Returned boolean
indicates if successful.
public boolean addNode(java.lang.String nodeType,
java.lang.String nodeValue)
public boolean connect()
public boolean connect(java.lang.String schemaName)
public boolean connect(java.lang.String schemaName,
java.lang.String passWord)
public boolean createDBtables()
public boolean createDBtables(java.lang.String schemaName)
public boolean createHdmStore(java.lang.String schemaName,
java.lang.String hdmStoreName)
public boolean deleteEdge(java.lang.String edgeType,
java.lang.String edgeValue)
public boolean deleteNode(java.lang.String nodeType,
java.lang.String nodeValue)
public void dropSequence()
public boolean edgeExists(Span span)
Span structure - split this
out into type and and value and return the result.
public boolean edgeExists(java.lang.String edgeType,
java.lang.String edgeValues)
public boolean edgeInstanceExists(java.lang.String type,
java.lang.String values)
public boolean edgeNameIsUnique(java.lang.String edgeName)
public boolean edgeTypeExists(java.lang.String edgeType)
public java.lang.String edgeTypeForName(java.lang.String edgeName)
public java.util.LinkedList getEdgeInstances(java.lang.String edgeType)
LinkedList of Span
elements, each Span representing an instance of an edge.
public java.util.LinkedList getNodeInstances(java.lang.String nodeType)
LinkedList
with elements of type Span, each element representing an instance
public java.util.LinkedList getSpans(int hid,
int eid)
LinkedList with each element of type
Span representing a span in that edge.
public boolean hdmStoreExists(java.lang.String hdmStoreName)
public int hid(java.lang.String hdmStoreName)
public void listNodes()
public void listNodes(java.lang.String nodeType)
public boolean nodeExists(Span span)
Span data structure check if it exists in the
HDM store
public boolean nodeExists(java.lang.String nodeType,
java.lang.String nodeValue)
public boolean nodeTypeExists(java.lang.String nodeType)
public int numberOfRowsInResultSet(java.sql.ResultSet rset)
public boolean okToAddEdge(Edge edge)
Edge is it OK to add the edge e.g. are all the spans valid type & do the
instances exist?
public java.lang.String schemaName(java.lang.String hdmStoreName)
public void setAddMissingNodes(boolean pAddMissingNodes)
public boolean setDatatype(java.lang.String nodeType,
java.lang.String datatype)
public boolean use(java.lang.String hdmStoreName)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||