|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--org.ilrt.inkling.api.SQLGraph
Copyright University of Bristol, 2003
This software is released under the W3C license:
http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
A Graph for SQL Databases.
To add data to an SQLGraph, create a Graph and then add() to SQLGraph.
Use setdb() and setDriver() to specify the database.
See test/SQLGraphTest.java for usage.
String
db="jdbc:mysql://127.0.0.1:3306/codepict3?user=mysql";
int count=0;
SQLGraph sq = new SQLGraph();
sq.setdb(db);
sq.setDriver("com.mysql.jdbc.Driver");
Graph gr = new Graph(null, uri, Util.RDFXML);
gr.load();
sq.add(gr);
java.sql.ResultSet r=sq.askSquish(query);
| Constructor Summary | |
SQLGraph()
|
|
| Method Summary | |
void |
add(Graph g)
Loads in a Graph, removing existing data from that Graph first. |
java.util.Vector |
ask(java.lang.Object ss,
java.lang.Object pp,
java.lang.Object oo)
Ask a simple query of the database (via a generated squish query) |
Graph |
ask(Query query)
Ask a simple query of the database (via a generated squish query) |
java.sql.ResultSet |
askSquish(java.lang.String query)
Ask a squish query of this database, returning a ResultSet. |
java.sql.ResultSet |
askSquish(java.lang.String query,
boolean prov)
Ask a squish query of this database, returning a ResultSet. |
boolean |
delete(Statement statement)
Delete a triple or triples from the database. |
java.sql.ResultSet |
doSQLQuery(java.lang.String sql_query,
boolean prov)
Performs an SQL query, converting the result to a org.ilrt.inkling.query.ResultSet, so that provenance and literal, bnode etc can be identified through the extended API. |
java.sql.ResultSet |
doSQLQueryClean(java.lang.String sql_query)
Performs a simple SQL query. |
java.lang.String |
getBase()
The base url for an SQLGraph is the database url, e.g. |
java.lang.String |
getdb()
Return the database url |
java.lang.String |
getDriver()
Return the database driver |
java.util.Hashtable |
getGraphs()
Get a list of all the Graphs in the database |
int |
getSize()
Get the size of the database |
int |
getSize(java.lang.String id)
|
java.util.Vector |
getStatements()
get all the Statements in the SQLGraph |
static void |
main(java.lang.String[] args)
|
void |
makeJDBCCommand(java.lang.String command)
Makes a command to a jdbc db - i.e. |
void |
remove(java.lang.String base)
|
boolean |
removeAll()
Remove all the triples from the entire SQL database. |
void |
setBase(java.lang.String base)
the base url for an SQLGraph is the database url, e.g. |
void |
setdb(java.lang.String dburi)
Set the database uri, for example setdb("jdbc:postgresql://localhost:5432/test?auth=password&user=postgres&password=notneeded") |
void |
setDriver(java.lang.String driver)
set the database driver, e.g. |
int |
size()
Get the size of the database |
void |
tell(Statement statement)
Insert a statement into the database, using the ID of the database as the source id. |
void |
tell(Statement statement,
java.lang.String id)
Insert a statement into the database. |
void |
tellAll(java.util.Vector states)
Tell all the Statements in a Vector to the SQLGraph. |
void |
tellAll(java.util.Vector states,
java.lang.String graphid)
Tell all the Statements in a Vector to the SQLGraph. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public SQLGraph()
| Method Detail |
public static void main(java.lang.String[] args)
public void setdb(java.lang.String dburi)
public void setDriver(java.lang.String driver)
public java.lang.String getdb()
public java.lang.String getDriver()
public void add(Graph g)
public void remove(java.lang.String base)
public void tellAll(java.util.Vector states)
tellAll in interface GraphInterface
public void tellAll(java.util.Vector states,
java.lang.String graphid)
public void tell(Statement statement)
tell in interface GraphInterface
public void tell(Statement statement,
java.lang.String id)
public void makeJDBCCommand(java.lang.String command)
throws java.sql.SQLException
public java.sql.ResultSet doSQLQuery(java.lang.String sql_query,
boolean prov)
public java.sql.ResultSet doSQLQueryClean(java.lang.String sql_query)
public java.sql.ResultSet askSquish(java.lang.String query)
askSquish in interface GraphInterface
public java.sql.ResultSet askSquish(java.lang.String query,
boolean prov)
public java.util.Vector ask(java.lang.Object ss,
java.lang.Object pp,
java.lang.Object oo)
ask in interface GraphInterfacepublic Graph ask(Query query)
ask in interface GraphInterfacepublic int getSize(java.lang.String id)
public int getSize()
public int size()
public java.util.Hashtable getGraphs()
public java.util.Vector getStatements()
getStatements in interface GraphInterfacepublic java.lang.String getBase()
getBase in interface GraphInterfacepublic void setBase(java.lang.String base)
setBase in interface GraphInterfacepublic boolean delete(Statement statement)
delete in interface GraphInterfacepublic boolean removeAll()
removeAll in interface GraphInterface
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||