|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectedu.lehigh.swat.obione.KAON2AbstractConnection
edu.lehigh.swat.obione.LAVProcessor
public class LAVProcessor
LAV processor implelements the Minicon in to Semantic Web
| Field Summary | |
|---|---|
private static int |
nextMCDId
|
private OBI1Query |
theQry
|
private boolean |
verbose
|
private java.util.Vector<Rewrite> |
viewHeadRewrites
|
| Fields inherited from class edu.lehigh.swat.obione.KAON2AbstractConnection |
|---|
m_connection |
| Constructor Summary | |
|---|---|
LAVProcessor()
|
|
| Method Summary | |
|---|---|
MiniConDescription |
attemptMCD(org.semanticweb.kaon2.api.rules.Literal qs,
LegacySourceView v)
|
java.util.Vector[] |
combineMCDs(java.util.Vector<java.util.BitSet> mcd)
A wrapper around the doRewrite of MCDFromBitSet |
private org.semanticweb.kaon2.api.rules.Literal |
convertLitCandidate(java.lang.String litcan)
|
java.util.Vector<Rewrite> |
decompose(org.semanticweb.kaon2.api.reasoner.Query sprqlQ,
LegacySourceView[] r)
Entry point to the LAV reformulation. |
java.util.ArrayList<MiniConDescription> |
decompose(java.util.Vector<Node> gns,
org.semanticweb.kaon2.api.rules.Rule r)
Entry point to the LAV reformulation from PDMS Generates the MCDs, combines them to find the covering MCDs and then finally gets all the rewrites (this may change, we may return something that is more convi nient |
private boolean |
distinguished(org.semanticweb.kaon2.api.rules.Variable v,
org.semanticweb.kaon2.api.rules.Rule r)
Helper - checks if a variable is distinguished or not |
MiniConDescription |
extendSubgoals(org.semanticweb.kaon2.api.rules.Variable existVar,
org.semanticweb.kaon2.api.rules.Literal qs,
java.util.HashMap varmap,
java.util.HashMap hm,
LegacySourceView sv)
|
java.util.ArrayList<MiniConDescription> |
generateMCDs(LegacySourceView[] views)
|
(package private) java.util.Vector<Rewrite> |
getAllRewrites(java.util.Vector[] paths,
java.util.ArrayList<MiniConDescription> mcds)
Generates the rewrites once we have found all the paths through out Bitset implementation |
java.util.Vector<Rewrite> |
getSpecialRewrites()
gets all the "special rewrites |
OBI1Query |
getTheQuery()
|
private java.util.List<org.semanticweb.kaon2.api.rules.Variable> |
getVariables(org.semanticweb.kaon2.api.rules.Rule r)
Helper function |
private void |
initHomomorphism(java.util.Map hmap,
LegacySourceView view)
Intialize the homomorphism to identity by mapping all variables in the rule to themselves |
private boolean |
isIn(MiniConDescription mcd,
java.util.ArrayList<MiniConDescription> mcds)
Helper method to check if an MCD is already in the array list. |
static void |
main(java.lang.String[] args)
|
LegacySourceView[] |
parseInput(java.lang.String filename)
|
boolean |
predMatch(org.semanticweb.kaon2.api.rules.Literal queryGoal,
org.semanticweb.kaon2.api.rules.Literal viewGoal,
java.util.HashMap hmapIn,
java.util.HashMap varmapIn)
Matches a query literal with a view literal, extending the head homomorphism and the variable map in the process. |
(package private) void |
printRule(org.semanticweb.kaon2.api.rules.Rule r)
|
| Methods inherited from class edu.lehigh.swat.obione.KAON2AbstractConnection |
|---|
createOntology, endConnection, loadOntology, makeConnection, showOntologyAxioms, showOntologyEntities |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private OBI1Query theQry
private java.util.Vector<Rewrite> viewHeadRewrites
private static int nextMCDId
private boolean verbose
| Constructor Detail |
|---|
public LAVProcessor()
| Method Detail |
|---|
public java.util.Vector<Rewrite> getSpecialRewrites()
java.util.Vector<Rewrite> getAllRewrites(java.util.Vector[] paths,
java.util.ArrayList<MiniConDescription> mcds)
paths - mcds -
public java.util.ArrayList<MiniConDescription> decompose(java.util.Vector<Node> gns,
org.semanticweb.kaon2.api.rules.Rule r)
sprqlQ - r -
public java.util.Vector<Rewrite> decompose(org.semanticweb.kaon2.api.reasoner.Query sprqlQ,
LegacySourceView[] r)
sprqlQ - r -
public java.util.Vector[] combineMCDs(java.util.Vector<java.util.BitSet> mcd)
mcd -
public java.util.ArrayList<MiniConDescription> generateMCDs(LegacySourceView[] views)
dlp - Gernerates Minicon for a query given a set of source viewspublic static void main(java.lang.String[] args)
public LegacySourceView[] parseInput(java.lang.String filename)
filename - parses a text file (assuming no formatting error) in to an array of KAON2 rules
Two issues
a) We assume the first rule to be the CQ. It is read in as a rule because CQ is
a rule, but it may have to be translated later to be compatible with KAON2 query
b) array of rules is a quick and dirty implemenation of the DLP. This needs to be fixed
private boolean isIn(MiniConDescription mcd,
java.util.ArrayList<MiniConDescription> mcds)
public MiniConDescription attemptMCD(org.semanticweb.kaon2.api.rules.Literal qs,
LegacySourceView v)
qs - v - uses the 4 cases to create an MCD from a query subgoal and a view
public MiniConDescription extendSubgoals(org.semanticweb.kaon2.api.rules.Variable existVar,
org.semanticweb.kaon2.api.rules.Literal qs,
java.util.HashMap varmap,
java.util.HashMap hm,
LegacySourceView sv)
public OBI1Query getTheQuery()
public boolean predMatch(org.semanticweb.kaon2.api.rules.Literal queryGoal,
org.semanticweb.kaon2.api.rules.Literal viewGoal,
java.util.HashMap hmapIn,
java.util.HashMap varmapIn)
private java.util.List<org.semanticweb.kaon2.api.rules.Variable> getVariables(org.semanticweb.kaon2.api.rules.Rule r)
r -
private void initHomomorphism(java.util.Map hmap,
LegacySourceView view)
hmap - A Map representing the homomophismr - A KAON rule representing the viewvoid printRule(org.semanticweb.kaon2.api.rules.Rule r)
r - A debug utilty to print rules
private boolean distinguished(org.semanticweb.kaon2.api.rules.Variable v,
org.semanticweb.kaon2.api.rules.Rule r)
v - r -
private org.semanticweb.kaon2.api.rules.Literal convertLitCandidate(java.lang.String litcan)
litcan - Creates a KAON2 Literal from string parsed from the data.in file
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||