Turtle DB
A mini DDBMS
ca.uqac.dim.ddb.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 Condition parseCondition (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

Member Function Documentation

static Relation ca.uqac.dim.ddb.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
static Relation ca.uqac.dim.ddb.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
static Relation ca.uqac.dim.ddb.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:

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

Parse an attribute. XML syntax:

 <attribute>name</attribute>
 
Parameters:
eAn XML DOM node
Returns:
static Condition ca.uqac.dim.ddb.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:
static Equality ca.uqac.dim.ddb.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:
static Relation ca.uqac.dim.ddb.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:
static Relation ca.uqac.dim.ddb.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:
static Schema ca.uqac.dim.ddb.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:
static Relation ca.uqac.dim.ddb.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:
static Table ca.uqac.dim.ddb.XmlQueryParser.parseTable ( Node  e) throws XmlQueryParser.ParseException [static, protected]

Parse a table. XML syntax:

 <table>name</table>
 
Parameters:
eAn XML DOM node
Returns:
static Tuple ca.uqac.dim.ddb.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:
static Relation ca.uqac.dim.ddb.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:
static Value ca.uqac.dim.ddb.XmlQueryParser.parseValue ( Node  e) throws XmlQueryParser.ParseException [static, protected]

Parse a value. XML syntax:

 <value>name</value>
 
Parameters:
eAn XML DOM node
Returns:
static VariableTable ca.uqac.dim.ddb.XmlQueryParser.parseVariableTable ( Node  e) throws XmlQueryParser.ParseException [static, protected]

Parse a table. XML syntax:

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

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