TurtleDB
A mini distributed database system
ca.uqac.dim.turtledb.XmlQueryParser Class Reference

List of all members.

Classes

class  ParseException

Static Public Member Functions

static Relation parse (String s) throws XmlQueryParser.ParseException
static Relation parse (Document doc) throws XmlQueryParser.ParseException

Static Protected Member Functions

static Relation parse (Node e) throws XmlQueryParser.ParseException
static Relation parseSelection (Node e) throws XmlQueryParser.ParseException
static Relation parseProjection (Node e) throws XmlQueryParser.ParseException
static Relation parseUnion (Node e) throws XmlQueryParser.ParseException
static Relation parseIntersection (Node e) throws XmlQueryParser.ParseException
static Relation parseProduct (Node e) throws XmlQueryParser.ParseException
static Relation parseJoin (Node e) throws XmlQueryParser.ParseException
static Condition parseCondition (Node e) throws XmlQueryParser.ParseException
static Condition parseNAryCondition (NAryCondition c, Node e) throws XmlQueryParser.ParseException
static Equality parseEquality (Node e) throws XmlQueryParser.ParseException
static Attribute parseAttribute (Node e) throws XmlQueryParser.ParseException
static VariableTable parseVariableTable (Node e) throws XmlQueryParser.ParseException
static Table parseTable (Node e) throws XmlQueryParser.ParseException
static Value parseValue (Node e) throws XmlQueryParser.ParseException
static Tuple parseTuple (Node e) throws XmlQueryParser.ParseException
static Schema parseSchema (Node e) throws XmlQueryParser.ParseException

Detailed Description

Facilities to build relational queries from an XML representation. The XmlQueryParser works in pair with the XmlQueryFormatter; more precisely, for any Relation r, we should have that XmlQueryParser.parse(XmlQueryFormatter.toXmlDocument(r)) == r

Author:
sylvain

Definition at line 38 of file XmlQueryParser.java.


Member Function Documentation

static Relation ca.uqac.dim.turtledb.XmlQueryParser.parse ( String  s) throws XmlQueryParser.ParseException [static]

Builds a query from a string

Parameters:
sA string containing an XML representation of the query
Returns:
The query

Definition at line 45 of file XmlQueryParser.java.

static Relation ca.uqac.dim.turtledb.XmlQueryParser.parse ( Document  doc) throws XmlQueryParser.ParseException [static]

Builds a query from a DOM document

Parameters:
sA DOM document containing an XML representation of the query
Returns:
The query

Definition at line 78 of file XmlQueryParser.java.

static Relation ca.uqac.dim.turtledb.XmlQueryParser.parse ( Node  e) throws XmlQueryParser.ParseException [static, protected]

Parse an operand. XML syntax:

 <operand>
   <x></x>
 </operand>
 

where x is either intersection, union, selection, projection or table.

Parameters:
eAn XML DOM node
Returns:

Definition at line 95 of file XmlQueryParser.java.

static Attribute ca.uqac.dim.turtledb.XmlQueryParser.parseAttribute ( Node  e) throws XmlQueryParser.ParseException [static, protected]

Parse an attribute. XML syntax:

 <attribute>name</attribute>
 
Parameters:
eAn XML DOM node
Returns:

Definition at line 445 of file XmlQueryParser.java.

static Condition ca.uqac.dim.turtledb.XmlQueryParser.parseCondition ( Node  e) throws XmlQueryParser.ParseException [static, protected]

Parse an equality. XML syntax:

 <condition>
   <x></x>
 </condition>
 

where x is equals (no other conditions implemented at the moment).

Parameters:
eAn XML DOM node
Returns:

Definition at line 358 of file XmlQueryParser.java.

static Equality ca.uqac.dim.turtledb.XmlQueryParser.parseEquality ( Node  e) throws XmlQueryParser.ParseException [static, protected]

Parse an equality. XML syntax:

 <equals>
   <x></x>
   <y></y>
 </equals>
 

where x and y are either attribute or value

Parameters:
eAn XML DOM node
Returns:

Definition at line 409 of file XmlQueryParser.java.

static Relation ca.uqac.dim.turtledb.XmlQueryParser.parseIntersection ( Node  e) throws XmlQueryParser.ParseException [static, protected]

Parse an intersection. XML syntax:

 <intersection>
   <operand></operand>
   <operand></operand>
   
 </intersection>
 
Parameters:
eAn XML DOM node
Returns:

Definition at line 256 of file XmlQueryParser.java.

static Relation ca.uqac.dim.turtledb.XmlQueryParser.parseJoin ( Node  e) throws XmlQueryParser.ParseException [static, protected]

Parse a join. XML syntax:

 <join>
   <condition></condition>
   <operand></operand>
   <operand></operand>
 </join>
 
Parameters:
eAn XML DOM node
Returns:

Definition at line 316 of file XmlQueryParser.java.

static Condition ca.uqac.dim.turtledb.XmlQueryParser.parseNAryCondition ( NAryCondition  c,
Node  e 
) throws XmlQueryParser.ParseException [static, protected]

Definition at line 381 of file XmlQueryParser.java.

static Relation ca.uqac.dim.turtledb.XmlQueryParser.parseProduct ( Node  e) throws XmlQueryParser.ParseException [static, protected]

Parse a Cartesian product. XML syntax:

 <product>
   <operand></operand>
   <operand></operand>
   
 </product>
 
Parameters:
eAn XML DOM node
Returns:

Definition at line 286 of file XmlQueryParser.java.

static Relation ca.uqac.dim.turtledb.XmlQueryParser.parseProjection ( Node  e) throws XmlQueryParser.ParseException [static, protected]

Parse a projection. XML syntax:

 <projection>
   <schema></schema>
   <operand></operand>
 </projection>
 
Parameters:
eAn XML DOM node
Returns:

Definition at line 191 of file XmlQueryParser.java.

static Schema ca.uqac.dim.turtledb.XmlQueryParser.parseSchema ( Node  e) throws XmlQueryParser.ParseException [static, protected]

Parse a schema. XML syntax:

 <schema>
   <attribute></attribute>
   <attribute></attribute>
   
 </schema>
 
Parameters:
eAn XML DOM node
Returns:

Definition at line 599 of file XmlQueryParser.java.

static Relation ca.uqac.dim.turtledb.XmlQueryParser.parseSelection ( Node  e) throws XmlQueryParser.ParseException [static, protected]

Parse a selection. XML syntax:

 <projection>
   <condition></condition>
   <operand></operand>
 </projection>
 
Parameters:
eAn XML DOM node
Returns:

Definition at line 157 of file XmlQueryParser.java.

static Table ca.uqac.dim.turtledb.XmlQueryParser.parseTable ( Node  e) throws XmlQueryParser.ParseException [static, protected]

Parse a table. XML syntax:

 <table>name</table>
 
Parameters:
eAn XML DOM node
Returns:

Definition at line 508 of file XmlQueryParser.java.

static Tuple ca.uqac.dim.turtledb.XmlQueryParser.parseTuple ( Node  e) throws XmlQueryParser.ParseException [static, protected]

Parse a table tuple. XML syntax:

 <tuple>
   <attr>value</attr>
   <attr>value</attr>
   
 </tuple>
 
Parameters:
eAn XML DOM node
Returns:

Definition at line 568 of file XmlQueryParser.java.

static Relation ca.uqac.dim.turtledb.XmlQueryParser.parseUnion ( Node  e) throws XmlQueryParser.ParseException [static, protected]

Parse a union. XML syntax:

 <union>
   <operand></operand>
   <operand></operand>
   
 </union>
 
Parameters:
eAn XML DOM node
Returns:

Definition at line 226 of file XmlQueryParser.java.

static Value ca.uqac.dim.turtledb.XmlQueryParser.parseValue ( Node  e) throws XmlQueryParser.ParseException [static, protected]

Parse a value. XML syntax:

 <value>name</value>
 
Parameters:
eAn XML DOM node
Returns:

Definition at line 547 of file XmlQueryParser.java.

static VariableTable ca.uqac.dim.turtledb.XmlQueryParser.parseVariableTable ( Node  e) throws XmlQueryParser.ParseException [static, protected]

Parse a table. XML syntax:

 <table>name</table>
 
Parameters:
eAn XML DOM node
Returns:

Definition at line 474 of file XmlQueryParser.java.


The documentation for this class was generated from the following file: