|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectuk.ac.bbk.dcs.automed.qproc.iql.IQLUtility
uk.ac.ic.doc.automed.p2p.util.IQLToolKit
public class IQLToolKit
Field Summary |
---|
Fields inherited from class uk.ac.bbk.dcs.automed.qproc.iql.IQLUtility |
---|
ASG_COLLECTION_SIZE_ITEMS, ASG_COLLECTION_SIZE_ITEMS_TIMES_TUPLE_TYPE, COMMA, HDM_PREFIX, logger, PREFIX, SCHEME_CLOSED_BRACKET, SCHEME_NAME_SEPARATOR, SCHEME_OPEN_BRACKET |
Constructor Summary | |
---|---|
private |
IQLToolKit()
|
Method Summary | |
---|---|
protected static void |
appendGenerator(ASG q,
java.util.List gens)
|
static void |
appendGenerator(ASG q,
java.util.List genHeadVars,
ASG genQuery)
Append a generator, whose RHS is an ASG query, to an existing query. |
protected static void |
appendGenerator(ASG q,
java.lang.String[] hvars,
Cell gen)
|
protected static void |
appendGenerator(java.util.Collection queries,
java.lang.String[] hvars,
Cell gen)
|
static void |
appendGenerator(java.util.List queries,
java.lang.String[] hvars,
java.lang.String[] genVars,
java.lang.Object queryObj)
Create a new generator from a binary HDM query scheme and append it to each query in an existing collection. Also add the the second variable to the head of each query in the collection. |
static void |
appendGenerator(java.util.List queries,
java.lang.String var1,
java.lang.String var2,
java.lang.String scheme1,
java.lang.String scheme2)
Create a new generator from a binary HDM query scheme and append it to each query in an existing collection. Also add the the second variable to the head of each query in the collection. |
static void |
appendHeadVar(java.util.Collection queries,
java.lang.String var)
Add a new head variable to the each of the query in a query collection. |
static ASG |
createASG(java.lang.String head,
Cell qualifier)
Generate an ASG query from its elements: (String) head, (Cell) qualifiers |
static Cell |
createFunction(java.lang.String fname,
java.lang.String pid)
|
static Cell |
createGen(java.lang.String s1,
java.lang.String s2,
SchemeInfo si)
Create a binary generator Cell from two variables and a
binary scheme. |
static ASG |
createQuery(java.util.ArrayList vars,
ASG genq)
Create a (nested) ASG query whose head variables are given in vars , and the RHS of the generator is an ASG query. |
static ASG |
createQuery(java.util.ArrayList vars,
Cell gen)
Create a (nested) ASG query whose head variables are given in vars , and given the generator. |
static ASG |
createQueryFromGen(Cell gen,
boolean copy)
|
static java.lang.String |
escapeHTML(java.lang.String iqlStr)
|
static Cell |
extractQualifier(ASG q,
java.lang.String... vars)
Extract a qualifier whose head variables match with the specified variables. |
static java.util.Collection |
getPeers(ASG asg)
Extract from a query the peers that implement the schemes of the query. |
static java.util.List |
getPredicates(java.lang.String var,
java.util.List predicates)
Extract range from an range ASG |
static AutoMedQueryToken |
getPredicateToken(java.lang.String tkString)
|
static java.lang.Object[] |
getRange(java.util.List filters)
|
static java.util.List |
getVarsObjects(Cell c,
boolean copy)
|
static Cell |
lookUpGenerator(ASG q,
Cell g,
boolean copy)
|
static java.lang.Object[][] |
parseIQLList(java.lang.String query)
Parse an IQL list (normally returned by the query processor) in to a standard value array which can be displayed on a GUI table |
static void |
rewriteKWLookup(Cell c,
java.lang.String kw,
Cell peerFunction)
Rewrite the lookup function of a keyword query and replace it with the corresponding peer function |
static java.util.List |
splitHDMString(java.lang.String str)
Recursively split an AutoMed scheme definition string into elements. Each scheme element is contained in a List object. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
private IQLToolKit()
Method Detail |
---|
public static java.lang.Object[][] parseIQLList(java.lang.String query)
query
-
public static java.util.List getVarsObjects(Cell c, boolean copy)
public static ASG createQueryFromGen(Cell gen, boolean copy)
public static ASG createASG(java.lang.String head, Cell qualifier)
public static Cell lookUpGenerator(ASG q, Cell g, boolean copy)
public static Cell extractQualifier(ASG q, java.lang.String... vars)
q
- v
-
public static Cell createGen(java.lang.String s1, java.lang.String s2, SchemeInfo si)
Cell
from two variables and a
binary scheme.
s1
- s2
- si
-
public static ASG createQuery(java.util.ArrayList vars, ASG genq)
vars
, and the RHS of the generator is an ASG query.
vars
- list of variable cellsgenq
- generator query
public static ASG createQuery(java.util.ArrayList vars, Cell gen)
vars
, and given the generator.
vars
- list of variable cellsgen
- the generator
public static void appendHeadVar(java.util.Collection queries, java.lang.String var)
queries
- var
- public static void appendGenerator(java.util.List queries, java.lang.String var1, java.lang.String var2, java.lang.String scheme1, java.lang.String scheme2)
queries
- var1
- var2
- scheme1
- scheme2
- public static void appendGenerator(java.util.List queries, java.lang.String[] hvars, java.lang.String[] genVars, java.lang.Object queryObj)
queries
- var1
- var2
- scheme1
- scheme2
- protected static void appendGenerator(java.util.Collection queries, java.lang.String[] hvars, Cell gen)
protected static void appendGenerator(ASG q, java.util.List gens)
protected static void appendGenerator(ASG q, java.lang.String[] hvars, Cell gen)
public static void appendGenerator(ASG q, java.util.List genHeadVars, ASG genQuery)
q
- an existing querygenHeadVars
- (optional) a list of variables (String) that make up the generator
variables, if set to null then use the head variables of the
generator query insteadgenQuery
- the generator querypublic static Cell createFunction(java.lang.String fname, java.lang.String pid)
public static void rewriteKWLookup(Cell c, java.lang.String kw, Cell peerFunction)
c
- kw
- peerFunction
- public static java.util.List getPredicates(java.lang.String var, java.util.List predicates)
public static java.lang.Object[] getRange(java.util.List filters)
public static java.lang.String escapeHTML(java.lang.String iqlStr)
public static AutoMedQueryToken getPredicateToken(java.lang.String tkString)
public static java.util.Collection getPeers(ASG asg)
asg
-
public static java.util.List splitHDMString(java.lang.String str)
List
object.
For example:
<<S,<<_,citation_author,<<_,citation,citation_cid1>>>>,<<_,author,author_name>>>>
;
is splitted into:[S, [_, citation_author, [_, citation, citation_cid1]], [_, author, author_name]]
str
-
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |