org.ilrt.inkling.api
Class ComplexQuery

java.lang.Object
  |
  +--org.ilrt.inkling.api.Graph
        |
        +--org.ilrt.inkling.api.ComplexQuery
All Implemented Interfaces:
GraphInterface, SimpleQueryInterface
Direct Known Subclasses:
SquishParser

public class ComplexQuery
extends Graph
implements GraphInterface

An object to encompass a squish query - basically a Graph with some
useful extra bits.

You should not have to deal with it directly: for squish queries use

Graph gr = new Graph(null, uri, Util.RDFXML);
gr.load();
UnionGraph ug=new UnionGraph();
ug.add(gr);

java.sql.ResultSet r=ug.askSquish(query);

or for squish queries with 'from' clauses specifying the urls to query, use

Graph gr = new Graph();
java.sql.ResultSet r=gr.askSquish(query);


and for SQLGraph queries use this:

SQLGraph sq = new SQLGraph();
sq.setdb("jdbc:mysql://127.0.0.1:3306/codepict3?user=mysql&useUnicode=true");
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);

although you can use ComplexQuery directly:

ComplexQuery cq=(ComplexQuery)SquishParser.parse(query);
cq.getGraphs().addElement(ug);
QE qe=new QE();

java.sql.ResultSet r=qe.executeQuery(cq);


Constructor Summary
ComplexQuery()
           
 
Method Summary
 java.util.Vector getConstraints()
          A Vector of constraints in Statement form
 java.util.Vector getGraphs()
          A Vector of Graphs used in the Query
 java.util.Vector getTriples()
          Returns a list of the triples part of the query - the WHERE clauses, as Querys
 java.util.Vector getVariables()
          All the variables used in the query.
 java.util.Vector getVariablesWeWant()
          returns the variables specified in the SELECT clause
 void setVariablesWeWant(java.util.Vector v)
          Sets the variables in the select clause
 
Methods inherited from class org.ilrt.inkling.api.Graph
ask, ask, askForObjects, askForSubjects, askQuery, askSquish, delete, getBase, getDefault, getEdges, getID, getNodes, getObjects, getPredicates, getSize, getStatements, getSubjects, getType, inspect, load, load, removeAll, setBase, setID, setType, size, tell, tellAll
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.ilrt.inkling.api.GraphInterface
ask, ask, askSquish, delete, getBase, getStatements, removeAll, setBase, tell, tellAll
 

Constructor Detail

ComplexQuery

public ComplexQuery()
Method Detail

getGraphs

public java.util.Vector getGraphs()
A Vector of Graphs used in the Query

getVariablesWeWant

public java.util.Vector getVariablesWeWant()
returns the variables specified in the SELECT clause

getVariables

public java.util.Vector getVariables()
All the variables used in the query. Use getVariablesWeWant for the variables in the SELECT clause.

setVariablesWeWant

public void setVariablesWeWant(java.util.Vector v)
Sets the variables in the select clause

getConstraints

public java.util.Vector getConstraints()
A Vector of constraints in Statement form

getTriples

public java.util.Vector getTriples()
Returns a list of the triples part of the query - the WHERE clauses, as Querys